Title: gh-101525: configure: Add PIE detection logic for BOLT optimizations compatibility by stratakis · Pull Request #140203 · python/cpython · GitHub
Open Graph Title: gh-101525: configure: Add PIE detection logic for BOLT optimizations compatibility by stratakis · Pull Request #140203 · python/cpython
X Title: gh-101525: configure: Add PIE detection logic for BOLT optimizations compatibility by stratakis · Pull Request #140203 · python/cpython
Description: BOLT requires the --relocs flag if a binary is built as PIE (Position Independent Executable). Test if a build system enforces PIE during compilation, via the preprocessor macros, or via linkage via creating a test binary. If so, -fno-pie and -no-pie flags will not be enforced when --enable-bolt is used and --relocs will be added to the BOLT flags. This resolves the compilation failure when enabling BOLT optimizations in Fedora, where -pie is enforced during linkage and also hidden inside GCC specs. Tested with both llvm and gcc, static and shared builds, lto combinations and -fPIE,-pie in CFLAGS, LDFLAGS. Note: This change adds a dependency on file for unix when using --enable-bolt. I'm not aware of a better way to test for -pie in the linker flags when it's hidden behind GCC specs, unless I grep for the Fedora specific GCC specs, essentially the -specs=/usr/lib/rpm/redhat/redhat-hardened-ld linker flag. file is used in configure here for MacOS builds. Issue: gh-101525
Open Graph Description: BOLT requires the --relocs flag if a binary is built as PIE (Position Independent Executable). Test if a build system enforces PIE during compilation, via the preprocessor macros, or via linkage vi...
X Description: BOLT requires the --relocs flag if a binary is built as PIE (Position Independent Executable). Test if a build system enforces PIE during compilation, via the preprocessor macros, or via linkage vi...
Opengraph URL: https://github.com/python/cpython/pull/140203
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:dbbbecec-9ba7-54d1-7b78-d4554724ab4c |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 841E:20A616:98775:D8BC3:6969F7B6 |
| html-safe-nonce | 85ece34ed06eef4e1ddd47dd3af837ef47b28437f8d5869796fa6370b972ef1b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDFFOjIwQTYxNjo5ODc3NTpEOEJDMzo2OTY5RjdCNiIsInZpc2l0b3JfaWQiOiI2NDYwOTE0OTA3MDk0ODQxMjcwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 03d846fe1fce97f460db4a7ef197edefc204c97b3c945314b085b25ada6178fe |
| hovercard-subject-tag | pull_request:2920252426 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/python/cpython/pull/140203/files |
| twitter:image | https://avatars.githubusercontent.com/u/14812606?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/14812606?s=400&v=4 |
| og:image:alt | BOLT requires the --relocs flag if a binary is built as PIE (Position Independent Executable). Test if a build system enforces PIE during compilation, via the preprocessor macros, or via linkage vi... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7b32f1c7c4549428ee399213e8345494fc55b5637195d3fc5f493657579235e8 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | bdde15ad1b403e23b08bbd89b53fbe6bdf688cad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width