2019-08-22 18:51 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000275mercuryBugpublic2013-02-20 11:58
Reporterwangp 
Assigned Towangp 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000275: hidden symbol pthread_atfork
DescriptionOn 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.
TagsNo tags attached.
Attached Files

-Relationships
+Relationships

-Notes

~0000496

juliensf (administrator)

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.

~0000497

wangp (developer)

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

~0000498

juliensf (administrator)

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.

~0000499

wangp (developer)

Fixed the underlying issue.
+Notes

-Issue History
Date Modified Username Field Change
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
+Issue History