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 00000000000000..612180d3b65db2 --- /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 ea560d60072259..cb37159c32bba2 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 7dfc6ca29297a8..7bf04b87cf617f 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}"]) ], )