Skip to content

Commit d856402

Browse files
authored
gh-156115: Use the simulator deployment-target flag for iOS simulator builds (#156116)
Ensures that CFLAGS and LDFLAGS use -mios-simulator-version-min, rather than the device-based -mios-version-min. This only matters if the CFLAGS and LDFLAGS are used in a bare call to clang without a -target; but that is a legal usage, so it's worth catching.
1 parent 999a046 commit d856402

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
iOS simulator builds are now configured with
2+
``-mios-simulator-version-min`` instead of the device's
3+
``-mios-version-min``. The device flag made the linker reject libraries
4+
resolved from the simulator SDK, so library detection silently failed.

configure

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,8 +1006,12 @@ AS_CASE([$host],
10061006
)
10071007

10081008
dnl Add the compiler flag for the iOS minimum supported OS version.
1009-
AS_CASE([$ac_sys_system],
1010-
[iOS], [
1009+
AS_CASE([$host],
1010+
[*-apple-ios*-simulator], [
1011+
AS_VAR_APPEND([CFLAGS], [" -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
1012+
AS_VAR_APPEND([LDFLAGS], [" -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
1013+
],
1014+
[*-apple-ios*], [
10111015
AS_VAR_APPEND([CFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
10121016
AS_VAR_APPEND([LDFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"])
10131017
],

0 commit comments

Comments
 (0)