public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Linking with g++ under AIX
@ 1999-12-29  7:38 Ford, Mark (MFORD)
  1999-12-31 22:24 ` Ford, Mark (MFORD)
  0 siblings, 1 reply; 2+ messages in thread
From: Ford, Mark (MFORD) @ 1999-12-29  7:38 UTC (permalink / raw)
  To: 'gcc-help@gcc.gnu.org'

After installing GCC under AIX 4.2.1, I was unable to link functions from
IBM's
"threadsafe" library (libc_r.a), using g++ (strangely gcc seems to link
fine).
Turns out, the problem is that, in stdlib.h, some functions were #ifdef'ed
out,
like this:
   #ifdef _THREAD_SAFE
      <decl.'s>
      extern int rand_r();
      <more decl.'s>
   #endif

As a quick workaround, I added "-D_THREAD_SAFE to my compile and link
commands.   But, I'm still looking for a compiler switch to turn on this
macro.

Does GCC support threads?   And, if so, is there a compiler switch that will
turn on this macro, or is this just something that only IBM recognizes?

Also, is there some easy way to correlate which macros, if any, are set by
which
compiler options?

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Linking with g++ under AIX
  1999-12-29  7:38 Linking with g++ under AIX Ford, Mark (MFORD)
@ 1999-12-31 22:24 ` Ford, Mark (MFORD)
  0 siblings, 0 replies; 2+ messages in thread
From: Ford, Mark (MFORD) @ 1999-12-31 22:24 UTC (permalink / raw)
  To: 'gcc-help@gcc.gnu.org'

After installing GCC under AIX 4.2.1, I was unable to link functions from
IBM's
"threadsafe" library (libc_r.a), using g++ (strangely gcc seems to link
fine).
Turns out, the problem is that, in stdlib.h, some functions were #ifdef'ed
out,
like this:
   #ifdef _THREAD_SAFE
      <decl.'s>
      extern int rand_r();
      <more decl.'s>
   #endif

As a quick workaround, I added "-D_THREAD_SAFE to my compile and link
commands.   But, I'm still looking for a compiler switch to turn on this
macro.

Does GCC support threads?   And, if so, is there a compiler switch that will
turn on this macro, or is this just something that only IBM recognizes?

Also, is there some easy way to correlate which macros, if any, are set by
which
compiler options?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-29  7:38 Linking with g++ under AIX Ford, Mark (MFORD)
1999-12-31 22:24 ` Ford, Mark (MFORD)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).