On 21 February 2011 18:10, Peter O'Gorman wrote: > Hi, > > We're currently using gcc-4.4. > > On IRIX 6.5, we get crashes if -lpthread is ordered before > -lstdc++ (warnings about "not used for resolving any symbol" removed > below): > % echo 'int main() {}' >a.cpp > % g++ a.cpp -lpthread; ./a.out; echo $? > zsh: segmentation fault (core dumped) ./a.out > 139 > % g++ a.cpp -pthread; ./a.out; echo $? > 0 > % g++ a.cpp -lstdc++ -lpthread; ./a.out; echo $? > 0 > > With gcc-4.2.x we had a similar issue, but on Tru64, that seems to be > fixed in 4.4.5. We have not tried trunk yet, is the problem already > fixed there? > > We're looking at reordering -lpthread to come after -lstdc++ by patching > cp/g++spec.c to fix this, but perhaps that is the wrong approach? What if you use -D_REENTRANT as well as -lpthread?