Title: iOS simulator builds get the device -mios-version-min flag, breaking library detection · Issue #156115 · python/cpython · GitHub
Open Graph Title: iOS simulator builds get the device -mios-version-min flag, breaking library detection · Issue #156115 · python/cpython
X Title: iOS simulator builds get the device -mios-version-min flag, breaking library detection · Issue #156115 · python/cpython
Description: Bug report Bug description: configure appends the device deployment-target flag to every iOS build, simulator included: dnl Add the compiler flag for the iOS minimum supported OS version. AS_CASE([$ac_sys_system], [iOS], [ AS_VAR_APPEND(...
Open Graph Description: Bug report Bug description: configure appends the device deployment-target flag to every iOS build, simulator included: dnl Add the compiler flag for the iOS minimum supported OS version. AS_CASE([...
X Description: Bug report Bug description: configure appends the device deployment-target flag to every iOS build, simulator included: dnl Add the compiler flag for the iOS minimum supported OS version. AS_CASE([...
Opengraph URL: https://github.com/python/cpython/issues/156115
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"iOS simulator builds get the device -mios-version-min flag, breaking library detection","articleBody":"# Bug report\n\n### Bug description:\n\n`configure` appends the *device* deployment-target flag to every iOS build, simulator included:\n\n```m4\ndnl Add the compiler flag for the iOS minimum supported OS version.\nAS_CASE([$ac_sys_system],\n [iOS], [\n AS_VAR_APPEND([CFLAGS], [\" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}\"])\n AS_VAR_APPEND([LDFLAGS], [\" -mios-version-min=${IPHONEOS_DEPLOYMENT_TARGET}\"])\n ],\n)\n```\n\n`-mios-version-min` is an alias for `-miphoneos-version-min`, so it sets the platform to iOS *device*. Against the simulator SDK the linker then refuses everything it resolves there:\n\n```\nld: building for 'iOS', but linking in dylib (.../iPhoneSimulator.sdk/usr/lib/libiconv.2.tbd) built for 'iOS-simulator'\n```\n\n`configure` already knows which one it is — `_host_device` is derived from the host triple at `configure.ac:794` and is `simulator` here — but the flag ignores it.\n\nThis is masked when the compiler is invoked through the wrappers in `Platforms/Apple/iOS/Resources/bin`, because those pass `--target=arm64-apple-ios-simulator`, which pins the platform and makes the later flag inert. It bites anyone driving clang directly with `-isysroot`, which is the usual arrangement for a cross-compiling build system.\n\nThe failure is quiet rather than loud. Configuring `main` for the simulator this way still exits 0, but 17 conftest links fail in `config.log` and features are misdetected:\n\n```diff\n$ diff \u003c(unpatched pyconfig.h) \u003c(patched pyconfig.h)\n\u003c /* #undef HAVE_ICONV */\n\u003c /* #undef HAVE_LIBSQLITE3 */\n\u003c /* #undef HAVE_ZLIB_COPY */\n\u003c /* #undef PY_SQLITE_HAVE_SERIALIZE */\n---\n> #define HAVE_ICONV 1\n> #define HAVE_LIBSQLITE3 1\n> #define HAVE_ZLIB_COPY 1\n> #define PY_SQLITE_HAVE_SERIALIZE 1\n```\n\nIf any library ends up on `LDFLAGS` before the first compiler check, it fails outright instead, with `configure: error: C compiler cannot create executables`.\n\nReproducer, on macOS with Xcode:\n\n```sh\nSDK=$(xcrun --sdk iphonesimulator --show-sdk-path)\nCC=\"$(xcrun --sdk iphonesimulator -f clang)\" \\\nCPP=\"$CC -E\" CFLAGS=\"-isysroot $SDK -arch arm64\" LDFLAGS=\"-isysroot $SDK -arch arm64\" \\\n../configure --host=aarch64-apple-ios12.0-simulator --build=$(../config.guess) \\\n --enable-framework --with-build-python=...\ngrep \"^ld: building for\" config.log\n```\n\nSelecting `-mios-simulator-version-min` when `_host_device` is `simulator` fixes it; the device build is unchanged. PR to follow.\n\n### CPython versions tested on:\n\nCPython main\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-156116\n* gh-156211\n* gh-156212\n* gh-156213\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/clementperon","@type":"Person","name":"clementperon"},"datePublished":"2026-08-20T14:02:20Z","url":"https://github.com/python/cpython/issues/156115"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:085f27ec-0aab-a5c6-6748-bbc5f558de90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8DFA:1AE20C:3BB5519:4B9BD07:6B01FA1D |
| html-safe-nonce | ac252d01c130c30dfa5d4d79803ae11182e2682dfd6a9866908260f06967c295 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4REZBOjFBRTIwQzozQkI1NTE5OjRCOUJEMDc6NkIwMUZBMUQiLCJ2aXNpdG9yX2lkIjoiODE4NjEyMTUzMjQwMjE3MDM5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 8d6af3bcc6d994ab49d149fa6004c28c5113107fc9d86ca96f7b8ca0bb7347a3 |
| hovercard-subject-tag | issue:5204243665 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/156115/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d84a1da746c650e2f3630ba4dbd88a538185bae098161577568b26ed94b082d2/python/cpython/issues/156115 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d84a1da746c650e2f3630ba4dbd88a538185bae098161577568b26ed94b082d2/python/cpython/issues/156115 |
| og:image:alt | Bug report Bug description: configure appends the device deployment-target flag to every iOS build, simulator included: dnl Add the compiler flag for the iOS minimum supported OS version. AS_CASE([... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | clementperon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width