[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problem compiling (gcc? glibc?)

On Tue, 18 Jan 2005 4:52 pm, you wrote:
> Andrew,
> I have a similar problem here where the only way I can compile
> 'successfully' is with the static flag. The errors I'm getting are
> different such that all my _r methods are throwing warnings and my
> binaries hang when I execute the built apps.
> One thing I noticed was the difference between thread safe and
> non-thread safe libraries. I am hunting down compile flags to get
> threadsafe compiling activated as so far I've read everything compiles
> non-thread safe by default. You can try the following (I haven't tried
> yet--not at work):

Can you compile an empty source file (i.e. only main() defined, doing nothing) 
successfully? Does setting LD_LIBRARY_PATH=/lib or /lib/tls make a 

> 1) Compile all source files with "-D_THREAD_SAFE" macro defined.
> 2) Link with "-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a" to
I presume you mean -lpthread rather than -lpthreads.
I can't find any libc_r. What is it?

> obtain the pthreads support and add "-nostartfiles /usr/lib/crt0_r.o" to
> the beginning of the link command line (using gcc to link!) to
> initialize threads.
> If that works then it's the posix thread issue.
> Good luck.
> Cliff Wong

Andrew Walbran

Reply to: