[omniORB] Re: Seg. Faults on Irix 6.5

James Riden jamesr@harlequin.co.uk
Fri, 21 May 1999 09:09:05 +0100


At 05:02 PM 5/20/99 +0100, Sai-Lai Lo wrote:
>>>>>> ryan tecco writes:
>
>>> Note the -lpthread comes after any mentions of -lomnithread .  I think
>>> this is what makes the difference - it may or may not be to do with the
>>> order of initialisation of statics in the different libraries. Should I
>>> add this to all the mips_irix_6.X_n32.mk ? (if I can work out the
>>> correct gnumake runes that is ;) I could also add some of this to the
>>> FAQ / IRIX release notes if anyone thinks it worthwhile.  Someone tell
>>> me if I've got anything particularly wrong.
>>> 
>
>> Is someone going to make corrected makefiles and post them somewhere?
>
>To James and others using Irix,
>
>   It would be very helpful if someone can get to the bottom of this
>   problem of link order.
>   I can certainly incorporate the changes recommended into the
>   distribution but I want to know this will definitely solve the cause of
>   the problem rather than just cover up the symptom.
>
>Thanks.

>From SGI TechPubs : (great resource btw. - http://techpubs.sgi.com )

[IRIX 6.5] : Books :  Developer : 
PART FOUR Models of Parallel Computation
Chapter 13 Thread-Level Parallelism
Compiling and Debugging a Pthread Application  

"It is recommended that the thread-safe options be enabled at compile time
using the feature test macro, _POSIX_C_SOURCE (see intro(3) for details).
For example, to compile these options, use this command:

cc -D_POSIX_C_SOURCE=199506L app.c -llib0 -llib1 ... -lpthread

The pthreads functions are defined in the library libpthread.so. Link with
this library using the -lpthread compiler option, which should be the last
library on the command line."

If it's documented, it must be a feature ;)

cheers, 
  James