Overview
| Artifact ID: | 6f278fff75699c4ba60005c2037b525de63f89cd |
|---|---|
| Ticket: | 4d72a5f77f268c6882d974562e53a34354273a31
[tcl] unix build of the 8.5 branch fails to build on Mac OS X with LTO (-flto) |
| User & Date: | anonymous on 2016-09-13 14:57:19 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
I don't think I ever got around reporting this issue here: Building the generic Unix flavour of Tcl 8.5 on OS X (as done for instance by MacPorts to obtain the interpreter driving the entire build/packaging system) fails when using Link-Time Optimisation (-flto compiler/linker option). When this option is used, the Tcl build system erroneously detects the presence of the pthread_attr_get_np() function which exists only on Linux; as a result, compilation fails on #include <pthread_np.h> . This issue boils down to a failing conftest.c programme generated by the configure script (and I think specified by the tcl.m4 file). In essence, this test does main () { char pthread_attr_get_np(); char (*f)() = pthread_attr_get_np; return f != pthread_attr_get_np; } Semantically, the actual value of f is moot in the boolean expression, which in fact can only evaluate to false. With LTO activated, clang recognises this fact, suppresses the reference to the actual function and as a result does not fail to link when that function isn't available. Adding a call to a function with side-effects (unknown to the linker, such as printf("%p", pthread_attr_get_np); restores the expected behaviour (i.e. the link step fails, and thus the test also). - foundin changed to: "8.5"
- is_private changed to: "0"
- login: "anonymous"
- priority changed to: "5 Medium"
- private_contact changed to: "feaf88b9ff5360927d4e110eb8bf5ebfc61e7c2d"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "anonymous"
- subsystem changed to: "53. Configuration and Build Tools"
- title changed to:
[tcl] unix build of the 8.5 branch fails to build on Mac OS X with LTO (-flto)
- type changed to: "Bug"