From 47f27cd5658d64236c30f2816ffd7fbe0446642b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Sat, 22 Aug 2026 05:05:20 +0200 Subject: [PATCH] gh-156115: Use the simulator deployment-target flag for iOS simulator builds (GH-156116) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. (cherry picked from commit d856402e7176e5a03c5c578f0efc1be968be3257) Co-authored-by: Clément Péron --- .../Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst | 4 ++++ configure | 9 +++++++-- configure.ac | 8 ++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst diff --git a/Misc/NEWS.d/next/Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst b/Misc/NEWS.d/next/Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst new file mode 100644 index 000000000000000..612180d3b65db21 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst @@ -0,0 +1,4 @@ +iOS simulator builds are now configured with +``-mios-simulator-version-min`` instead of the device's +``-mios-version-min``. The device flag made the linker reject libraries +resolved from the simulator SDK, so library detection silently failed. diff --git a/configure b/configure index 2c0349c8c4c98e7..a68a98c5a4de4a0 100755 --- a/configure +++ b/configure @@ -4855,8 +4855,13 @@ case $host in #( ;; esac -case $ac_sys_system in #( - iOS) : +case $host in #( + *-apple-ios*-simulator) : + + as_fn_append CFLAGS " -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" + as_fn_append LDFLAGS " -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" + ;; #( + *-apple-ios*) : as_fn_append CFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" as_fn_append LDFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" diff --git a/configure.ac b/configure.ac index 928a7b6d72388f3..ed8b53dd3a4d282 100644 --- a/configure.ac +++ b/configure.ac @@ -995,8 +995,12 @@ AS_CASE([$host], ) dnl Add the compiler flag for the iOS minimum supported OS version. -AS_CASE([$ac_sys_system], - [iOS], [ +AS_CASE([$host], + [*-apple-ios*-simulator], [ + AS_VAR_APPEND([CFLAGS], [" -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) + AS_VAR_APPEND([LDFLAGS], [" -mios-simulator-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) + ], + [*-apple-ios*], [ AS_VAR_APPEND([CFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) AS_VAR_APPEND([LDFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) ],