AIX library issues
David Edelsohn
dje.gcc@gmail.com
Mon Oct 24 02:36:00 GMT 2011
On Sun, Oct 23, 2011 at 10:16 AM, Perry Smith <pedzsan@gmail.com> wrote:
> libgomp.so.1 wants libc.a, libpthreads.a, and libgcc_s.a. The first two do not present a problem. But there are four libgcc_s.a (normal, ppc64, pthread, and ppc64+pthread).
>
> Note that there is also four versions of libgomp.so.1 (normal, ppc64, pthread, ppc64+pthread).
>
> My question is: which libgcc_s.a should I link to? (this question is for each of the four versions of libgomp.so.1).
>
> Setting LIBPATH or whatever I do is going to override the internal path (since the internal path is broken). So, this may be a question that has never been asked or answered.
>
> My knee jerk is that the normal libgomp.so.1 wants the normal libgcc_s.a, the ppc64 wants the ppc64, etc. But I notice that it will always include pthread so that is what caused me to pause and ask.
>
> Part of me wonders if the two non-pthread versions of libgomp make any sense. I don't really know anything about libgomp.
libgomp (-fopenmp) does not make sense without pthreads. -fopenmp
implies pthreads.
One thing to note: AIX tools default to 32 bit mode, although all
systems are 64 bit, unlike GNU/Linux, which defaults to 64 bit mode
(on x86-64 and PPC64).
Only two of the four libgomp multilibs truly are necessary, but
avoiding the non-pthread builds is not worth the trouble. The
non-pthread libgomp libraries never will be used, unless GCC is
invoked incorrectly. Each library, including libgomp, should list its
multilib install directory first, e.g., ppc64 pthread would be
-Wl,-blibpath:.../lib/gcc/powerpc-ibm-aix6.1.3.0/4.6.0/pthread/ppc64:.../lib/pthread/ppc64:/usr/lib:/lib
and default would be
-Wl,-blibpath:.../lib/gcc/powerpc-ibm-aix6.1.3.0/4.6.0:.../lib:/usr/lib:/lib
The GCC build process and driver directory search process make a lot
of assumptions that the system directories follow a Linux/SVR4/Solaris
layout. To follow AIX style, the PPC64 and PPC32 non-reentrant
(non-pthreads) libraries should be archived into the same file
libgomp.a (which never would be referenced) and the reentrant
(pthreads) libraries for PPC64 and PPC32 should be archived into
libgomp_r.a. The benefit has not been shown to be worth the effort.
- David
More information about the Gcc
mailing list