|View Issue Details [ Jump to Notes ]||[ Issue History ] [ Print ]|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000275||mercury||Bug||public||2013-02-18 11:47||2013-02-20 11:58|
|Target Version||Fixed in Version|
|Summary||0000275: hidden symbol pthread_atfork|
|Description||On Ubuntu 12.04 (at least) the linker spits out an error message when you try to build most programs in a parallel grade, e.g. hlc.par.gc.|
/usr/bin/ld: test: hidden symbol `pthread_atfork' in /usr/lib/i386-linux-gnu/libpthread_nonshared.a(pthread_atfork.oS) is referenced by DSO
The solution appears to be to pass -pthread at the link step, either in addition to or replacing -lpthread. Actually we should probably pass -pthread for compilation steps as well.
|Tags||No tags attached.|
You should only pass -pthread for C compilers that actually support that
option. The (Mercury) compiler should have enough version information about the
C compiler available in order to determine this.
|I'm thinking we just need to update configure.ac near line 2962 for $host = *linux*. The compilers in use there seem to all support -pthread (gcc, clang, icc, does lcc even work?).|
Older versions of gcc (e.g. 4.2 etc) only seem to support it for things
like IA64, PowerPC and SPARC. (Presumably, it has no effect on other
things?) So, it should be ok to enable it for all versions of GCC.
It should be ok to always enable it for clang.
AFAIK, we don't support icc.
If some uses lcc and it doesn't work then we'll do something about that.
(Otherwise, I don't care about it for the time being.)
Yes, you need to pass -pthread for all compilation steps since on some
platforms it apparently affects the preprocessor as well.
|Fixed the underlying issue.|
|2013-02-18 11:47||wangp||New Issue|
|2013-02-18 13:05||juliensf||Note Added: 0000496|
|2013-02-18 14:36||wangp||Note Added: 0000497|
|2013-02-18 16:02||juliensf||Note Added: 0000498|
|2013-02-20 11:58||wangp||Note Added: 0000499|
|2013-02-20 11:58||wangp||Status||new => resolved|
|2013-02-20 11:58||wangp||Resolution||open => fixed|
|2013-02-20 11:58||wangp||Assigned To||=> wangp|