[3.14] gh-156115: Use the simulator deployment-target flag for iOS simulator builds (GH-156116) (#156212)

freakboy3742 <[email protected]>
Newsgroups gmane.comp.python.cvs
Message-ID <[email protected]>
https://github.com/python/cpython/commit/c12f822e47bef4fec07d2c73356038b0978e5eb0
commit: c12f822e47bef4fec07d2c73356038b0978e5eb0
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: freakboy3742 <[email protected]>
date: 2026-08-22T03:26:49Z
summary:

[3.14] gh-156115: Use the simulator deployment-target flag for iOS simulator builds (GH-156116) (#156212)

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 <[email protected]>

files:
A Misc/NEWS.d/next/Build/2026-08-20-14-02-33.gh-issue-156115.KXr8wU.rst
M configure
M configure.ac

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 2cb22a7806fa550..1124cb09dd23d34 100755
--- a/configure
+++ b/configure
@@ -4806,8 +4806,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 967d34d47a3e1f4..10a5f25dffdbb64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -980,8 +980,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}"])
   ],

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.