Title: On macOS, Configure script assumes that "gcc" is an alias for "clang", even if it really is GCC · Issue #96249 · python/cpython · GitHub
Open Graph Title: On macOS, Configure script assumes that "gcc" is an alias for "clang", even if it really is GCC · Issue #96249 · python/cpython
X Title: On macOS, Configure script assumes that "gcc" is an alias for "clang", even if it really is GCC · Issue #96249 · python/cpython
Description: Your environment MacOS 12.4 Bug report Apologies if this is a known "wontfix" issue, I didn't see it mentioned in a search of past issues. The configure.ac script assumes that gcc is actually clang on MacOS and uses Clang's -fprofile-ins...
Open Graph Description: Your environment MacOS 12.4 Bug report Apologies if this is a known "wontfix" issue, I didn't see it mentioned in a search of past issues. The configure.ac script assumes that gcc is actually clang...
X Description: Your environment MacOS 12.4 Bug report Apologies if this is a known "wontfix" issue, I didn't see it mentioned in a search of past issues. The configure.ac script assumes that gcc is ...
Opengraph URL: https://github.com/python/cpython/issues/96249
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"On macOS, Configure script assumes that \"gcc\" is an alias for \"clang\", even if it really is GCC","articleBody":"# Your environment\r\n\r\n* MacOS 12.4\r\n\r\n# Bug report\r\n\r\nApologies if this is a known \"wontfix\" issue, I didn't see it mentioned in a search of past issues.\r\n\r\nThe `configure.ac` script assumes that `gcc` is actually `clang` on MacOS and uses Clang's `-fprofile-instr-generate` flag for PGO instead of GCC's `-fprofile-generate`, leading to build failure when PGO is turned on.\r\n\r\nSteps to reproduce on MacOS:\r\n\r\n```sh\r\nsudo port install gcc\r\n# or `brew install gcc`, same result\r\n\r\nCC='/opt/local/bin/gcc-mp-12' pyenv install --verbose 3.10.6\r\n```\r\n\r\nOutcome:\r\n\r\n```text\r\n...\r\ngcc-mp-12: error: unrecognized command-line option '-fprofile-instr-generate'; did you mean '-fprofile-generate'?\r\n...\r\n```\r\n\r\nThe problem is found here: https://github.com/python/cpython/blob/3.10/configure.ac#L1491-L1514\r\n```sh\r\ncase $CC in\r\n *clang*)\r\n # Any changes made here should be reflected in the GCC+Darwin case below\r\n ...\r\n ;;\r\n *gcc*)\r\n case $ac_sys_system in\r\n Darwin*)\r\n PGO_PROF_GEN_FLAG=\"-fprofile-instr-generate\"\r\n PGO_PROF_USE_FLAG=\"-fprofile-instr-use=code.profclangd\"\r\n```\r\n\r\nMacOS (perhaps annoyingly) ships with `gcc` as an alias for `clang`, so the configure script sensibly assumes that `gcc` is actually `clang` and sets its options accordingly.\r\n\r\nHowever, that isn't always a correct assumption!\r\n\r\nPossible solutions:\r\n\r\n1. Check for the presence of `Apple clang` in the `$CC --version` output.\r\n2. Check that the absolute path of `$CC` is `/usr/bin/gcc`.","author":{"url":"https://github.com/gwerbin","@type":"Person","name":"gwerbin"},"datePublished":"2022-08-24T19:52:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/96249/cpython/issues/96249"}
| 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:7aedf92c-a393-91b3-7601-90656a8bc8e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A070:11141E:F7F0F1:14ABE19:696991CB |
| html-safe-nonce | 04ee62f106e6ad22e6ebdac013300b3c177bd28558f6c6fe4a0718c7fc1c9063 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMDcwOjExMTQxRTpGN0YwRjE6MTRBQkUxOTo2OTY5OTFDQiIsInZpc2l0b3JfaWQiOiIzMjc5NzEzMzAzMzE4MzM1OTQ3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 45ea7238df5280c3e4571ce056b182342d267f2eb7cb4875e4baa5474a1a4023 |
| hovercard-subject-tag | issue:1349953129 |
| 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/96249/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ee81b07bdad156e2248d83965be157953bc5e77a752c2f29259003d075a56ef6/python/cpython/issues/96249 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ee81b07bdad156e2248d83965be157953bc5e77a752c2f29259003d075a56ef6/python/cpython/issues/96249 |
| og:image:alt | Your environment MacOS 12.4 Bug report Apologies if this is a known "wontfix" issue, I didn't see it mentioned in a search of past issues. The configure.ac script assumes that gcc is actually clang... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gwerbin |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3542e147982176a7ebaa23dfb559c8af16f721c03ec560c68c56b64a0f35e751 |
| 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 | af80af7cc9e3de9c336f18b208a600950a3c187c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width