Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

autoconf link test for tcl/tk fails with optimizing compilers #126877

Copy link
Copy link
Open
@bramoore

Description

@bramoore
Issue body actions

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 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.

Current test in configure.ac:

[
    void *x1 = Tcl_Init;
    void *x2 = Tk_Init;
]

One 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:

[
    int x1 = Tcl_Init();
    int x2 = Tk_Init();
]

Another possible solution would be to force use of -O0 during for this test.

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildThe build process and cross-buildtopic-tkintertype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.