Opened 9 years ago

Last modified 8 years ago

#49160 closed defect

[FWIW] "base" and port:MacPorts fail to build with -flto — at Initial Version

Reported by: RJVB (René Bertin) Owned by: macports-tickets@…
Priority: Low Milestone:
Component: base Version:
Keywords: Cc: macports-mgr@…
Port:

Description

A bug report that has a considerable FYI factor:

Using -flto in the CFLAGS when building MacPorts base or port:MacPorts leads to a build error in tcl8.5.15 because the (missing) pthread_np.h header file is (inappropriately) included. That's a Unix/Linux-specific file, so it seems the platform detection went wrong configuring tcl.

That appears to be because of the test for the availability of the pthread*_np functions succeeds because the link-optimiser suppresses the actual symbol tested for from the test app. Looking at the test code this appears to be something any good optimiser would (or could) do; after cleanup the test "payload" looks like this:

main() {

char pthread_getattr_np(); char (*f)() = pthread_getattr_np(); return f != pthread_getattr_np;

}

In other words, the main function should always return true, the actual value of the variable (including "undefined") is moot for the test result.

I'm aware that this is not a MacPorts bug but an issue in the Tcl build system. I'm reporting it here though because it occurs in a possibly customised Tcl version ... and I'm hoping at least one "base" developer already has a Tcl bug reporter account.

Change History (0)

Note: See TracTickets for help on using tickets.