This is the mail archive of the
mailing list for the GCC project.
Linking with libgomp (ia64-hp-hpux11.23)
- From: Steve Ellcey <sje at cup dot hp dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 6 Mar 2006 11:32:01 -0800 (PST)
- Subject: Linking with libgomp (ia64-hp-hpux11.23)
- Reply-to: sje at cup dot hp dot com
I have run into a couple of linking problems trying to test/use -fopenmp
and libgomp and I was hoping for some help on where to look and how to
fix these problems.
I get a lot of test failures with:
| FAIL: libgomp.c/appendix-a/a.15.1.c (test for excess errors)
| Excess errors:
| ld: (Warning) Symbol "__udivsi3" is not exported but is imported by a shared library
| ld: (Warning) Symbol "__divsi3" is not exported but is imported by a shared library
| 2 warnings.
__udivsi3 and __divsi3 are of course the integer divide routines that
are in libgcc. I can make the test pass by running it with
-shared-libgcc, but I am not sure if I should just be trying to add
-shared-libgcc when I run libgomp tests or if -shared-libgcc needs to be
used when building libgomp itself. Nor am I sure how to do either.
The other thing I found was that when I tried to compile a program
with -fopenmp outside of the test harness it fails.
| $ gcc -fopenmp loop-3.c -o x <
| ld: Can't find library or mismatched ABI for -lgomp
| Fatal error.
When I add -v I see:
| collect2 -z +Accept TypeMismatch -u main -o x -lgomp -L/proj/opensrc/nightly/gcc-ia64-hp-hpux11.23-trunk/lib/gcc/ia64-hp-hpux11.23/4.2.0 -L/usr/ccs/lib -L/proj/opensrc/nightly/gcc-ia64-hp-hpux11.23-trunk/lib/gcc/ia64-hp-hpux11.23/4.2.0/../../.. /var/tmp//ccGr80UQ.o -lgcc -lgcc_eh -lunwind -lpthread -lc -lgcc -lgcc_eh -lunwind
Notice that the -lgomp comes in front of the -L flags. With the HP
linker this means that those directories will not be searched for
libgomp. If I move the -lgomp to after the -L options then I find
When I do move -lgomp later in the link though I get the messages about
__divsi3 and __udivsi3, so I think that means that I need to have
libgomp built with the -lgcc_s option.