From 31bf620688f92742b44cfc93e44535afe080404e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20P=C3=A9ron?= Date: Thu, 20 Aug 2026 16:02:33 +0200 Subject: [PATCH] Use the simulator deployment-target flag for simulator builds -mios-version-min names the device platform, so against the simulator SDK the linker rejects every dylib it resolves there. Configuring for the simulator still exits 0, but conftest links fail and iconv, sqlite3 and zlib features are misdetected as absent; a build with a library on LDFLAGS before the first compiler check fails outright instead. The device/simulator split is already known from the host triple, so select the flag from it. --- .../2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst | 4 ++++ configure | 11 +++++++++-- configure.ac | 9 +++++++-- 3 files changed, 20 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 ea560d600722592..cb37159c32bba21 100755 --- a/configure +++ b/configure @@ -4898,8 +4898,15 @@ esac case $ac_sys_system in #( iOS) : - as_fn_append CFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" - as_fn_append LDFLAGS " -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}" + if test "x$_host_device" = "xsimulator" +then : + _ios_version_min_flag=-mios-simulator-version-min +else case e in #( + e) _ios_version_min_flag=-mios-version-min ;; +esac +fi + as_fn_append CFLAGS " ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}" + as_fn_append LDFLAGS " ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}" ;; #( *) : ;; diff --git a/configure.ac b/configure.ac index 7dfc6ca29297a8b..7bf04b87cf617f1 100644 --- a/configure.ac +++ b/configure.ac @@ -1008,8 +1008,13 @@ AS_CASE([$host], dnl Add the compiler flag for the iOS minimum supported OS version. AS_CASE([$ac_sys_system], [iOS], [ - AS_VAR_APPEND([CFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) - AS_VAR_APPEND([LDFLAGS], [" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}"]) + dnl -mios-version-min names the device platform; against the simulator SDK it + dnl makes the linker reject every dylib it resolves there. + AS_IF([test "x$_host_device" = "xsimulator"], + [_ios_version_min_flag=-mios-simulator-version-min], + [_ios_version_min_flag=-mios-version-min]) + AS_VAR_APPEND([CFLAGS], [" ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}"]) + AS_VAR_APPEND([LDFLAGS], [" ${_ios_version_min_flag}=${IPHONEOS_DEPLOYMENT_TARGET}"]) ], )