Title: autoconf link test for tcl/tk fails with optimizing compilers · Issue #126877 · python/cpython · GitHub
Open Graph Title: autoconf link test for tcl/tk fails with optimizing compilers · Issue #126877 · python/cpython
X Title: autoconf link test for tcl/tk fails with optimizing compilers · Issue #126877 · python/cpython
Description: Bug report Bug description: The autoconf test for linking TCL/Tk libraries is flawed when using an optimizing compiler such as AOCC. AOCC 5.0 defaults to using the optimization level -O2, which includes dead-code elimination. The current...
Open Graph Description: Bug report Bug description: The autoconf test for linking TCL/Tk libraries is flawed when using an optimizing compiler such as AOCC. AOCC 5.0 defaults to using the optimization level -O2, which inc...
X Description: Bug report Bug description: The autoconf test for linking TCL/Tk libraries is flawed when using an optimizing compiler such as AOCC. AOCC 5.0 defaults to using the optimization level -O2, which inc...
Opengraph URL: https://github.com/python/cpython/issues/126877
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"autoconf link test for tcl/tk fails with optimizing compilers","articleBody":"# Bug report\n\n### Bug description:\n\nThe `autoconf` test for linking TCL/Tk libraries is flawed when using an optimizing compiler such as AOCC. AOCC 5.0 defaults to using the optimization level `-O2`, which includes dead-code elimination. The current autoconf test is trying to check for the `Tcl_Init` and `Tk_Init` symbols by assigning them to variables which are then never referenced. This is seen by the compiler as dead code, and removed. Thus, the symbols are not included in the object and the link-test passes, even if there are no TCL/Tk libraries on the system.\n\nCurrent test in `configure.ac`:\n\n```m4\n[\n void *x1 = Tcl_Init;\n void *x2 = Tk_Init;\n]\n```\n\nOne possible solution is to change the test from a simple assignment to calling those functions, at which the expression is used, and not elided by the optimizing compiler:\n\n```m4\n[\n int x1 = Tcl_Init();\n int x2 = Tk_Init();\n]\n```\n\nAnother possible solution would be to force use of `-O0` during for this test.\n\n\n### CPython versions tested on:\n\n3.12, 3.13\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-153543\n* gh-153553\n* gh-153554\n* gh-153555\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/bramoore","@type":"Person","name":"bramoore"},"datePublished":"2024-11-15T19:03:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/126877/cpython/issues/126877"}
| 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:720dfd22-1a8b-668f-8a16-e37151a6496d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 886E:135646:E326C3:132221F:6A52D012 |
| html-safe-nonce | e945e504bd3445c9a6fced3a81cd565d494d63780f7b21a4a1632742d9e67c64 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4ODZFOjEzNTY0NjpFMzI2QzM6MTMyMjIxRjo2QTUyRDAxMiIsInZpc2l0b3JfaWQiOiI2OTUzMTAzNDk2MjEzMzUyNDY2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 450027b50824dfd4af72ec9552ce7b60533eac197f81b2253a81e86b15126131 |
| hovercard-subject-tag | issue:2662874421 |
| 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/126877/issue_layout |
| twitter:image | https://opengraph.githubassets.com/272696fb590e5470ecf74cba2e55b140be325ff9821e703e7331258f38a6489d/python/cpython/issues/126877 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/272696fb590e5470ecf74cba2e55b140be325ff9821e703e7331258f38a6489d/python/cpython/issues/126877 |
| og:image:alt | Bug report Bug description: The autoconf test for linking TCL/Tk libraries is flawed when using an optimizing compiler such as AOCC. AOCC 5.0 defaults to using the optimization level -O2, which inc... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bramoore |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width