Executing on host: /mnt/gnu/gcc-3.3/objdir/gcc/xgcc -B/mnt/gnu/gcc-3.3/objdir/gc c/ /mnt/gnu/gcc-3.3/gcc/libgomp/testsuite/libgomp.c/appendix-a/a.15.1.c -B/mnt/ gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/./libgomp/ -I/mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp -I/mnt/gnu/gcc-3.3/gcc/libgomp/testsuite/.. -fmessage- length=0 -fopenmp -O2 -fopenmp -L/mnt/gnu/gcc-3.3/objdir/hppa64-hp-hpux11.11/ ./libgomp/.libs -lgomp -lm -o ./a.15.1.exe (timeout = 300) ld: (Warning) Unsatisfied symbol "sem_init" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_post" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_wait" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_destroy" in file /mnt/gnu/gcc-3.3/objdir/h ppa64-hp-hpux11.11/./libgomp/.libs/libgomp.sl 4 warnings. output is: ld: (Warning) Unsatisfied symbol "sem_init" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_post" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_wait" in file /mnt/gnu/gcc-3.3/objdir/hppa 64-hp-hpux11.11/./libgomp/.libs/libgomp.sl ld: (Warning) Unsatisfied symbol "sem_destroy" in file /mnt/gnu/gcc-3.3/objdir/h ppa64-hp-hpux11.11/./libgomp/.libs/libgomp.sl 4 warnings. FAIL: libgomp.c/appendix-a/a.15.1.c (test for excess errors) I'm not sure what's going on here. While the header files and manpages seem to indicate the presence of POSIX semaphores, they seem missing from the libraries.
I bet -lrt has to be linked in as sem_* are part of the real time extensions of POSIX.
Subject: Re: FAIL: libgomp.c/appendix-a/a.15.1.c (test for excess errors) > I bet -lrt has to be linked in as sem_* are part of the real time extensions of > POSIX. I believe that you would win that bet: -bash-2.05b$ nm librt.2|less Symbols from librt.2: [Index] Value Size Type Bind O Shndx Name ... [98] | 4611686018427395792| 100|FUNC |GLOB |0| .text|sem_close [119] | 4611686018427395280| 164|FUNC |GLOB |0| .text|sem_destroy [60] | 4611686018427396688| 160|FUNC |GLOB |0| .text|sem_getvalue [88] | 4611686018427395072| 208|FUNC |GLOB |0| .text|sem_init [96] | 4611686018427395464| 308|FUNC |GLOB |0| .text|sem_open [102] | 4611686018427396512| 172|FUNC |GLOB |0| .text|sem_post [72] | 4611686018427396208| 300|FUNC |GLOB |0| .text|sem_trywait [67] | 4611686018427395896| 132|FUNC |GLOB |0| .text|sem_unlink [109] | 4611686018427396032| 172|FUNC |GLOB |0| .text|sem_wait Dave
Confirmed.
This problem affects both hppa*-hp-hpux* and ia64-hp-hpux*. It appears that the required sem_init, sem_wait, sem_post, etc... symbols are defined both in the -lrt libraries on HPUX and in the -lc_r libraries. The fix is to update LIB_SPEC, perhaps in the -pthread clause, for HPUX, but I'm not sure if it requires adding -lrt or changing -lc to -lc_r, or adding -lc_r? I notice that config/pa/pa-hpux10.h does mention -lc_r, but for use with -threads. Should -pthread pull in the required symbols? i.e. is this a libgomp problem or a target problem?
Subject: Re: libgomp needs to link against rt on HPUX > This problem affects both hppa*-hp-hpux* and ia64-hp-hpux*. It appears that > the required sem_init, sem_wait, sem_post, etc... symbols are defined both in > the -lrt libraries on HPUX and in the -lc_r libraries. The fix is to update > LIB_SPEC, perhaps in the -pthread clause, for HPUX, but I'm not sure if it > requires adding -lrt or changing -lc to -lc_r, or adding -lc_r? I notice that > config/pa/pa-hpux10.h does mention -lc_r, but for use with -threads. I'm not 100% certain but I believe libc_r needs to be used with dce threads, and librt with posix threads. HP-UX 10 doesn't have the latter. We only support posix threads on hppa*-hp-hpux11*. > Should -pthread pull in the required symbols? i.e. is this a libgomp problem > or a target problem? Although it's relatively easy to change LIB_SPEC, I'd like to keep the number of libraries that are linked against to a minimum. Dave
Subject: Bug 25936 Author: sayle Date: Mon Feb 13 02:33:37 2006 New Revision: 110908 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=110908 Log: 2006-02-12 Roger Sayle <roger@eyesopen.com> John David Anglin <dave@hiauly1.hia.nrc.ca> PR libgomp/25936 * configure.tgt: Link against -lrt for sem_init on HPUX v11 systems. Modified: trunk/libgomp/ChangeLog trunk/libgomp/configure.tgt
This has now been fixed on mainline.