Hi,
a build of GHC with SplitObjs=NO on OpenBSD fails when trying to
link utils/installPackage during stage2, because it references some
symbols contained in libpthread. This problem has been seen earlier,
but it wasn't clear that it's related to SplitObjs. Partial build
output:
gmake -C utils with-stage-2
gmake[1]: Entering directory `/var/tmp/ghc/ghc-head/utils'
gmake -C installPackage with-stage-2
gmake[2]: Entering directory `/var/tmp/ghc/ghc-head/utils/installPackage'
[...]
Linking dist-install/build/installPackage/installPackage ...
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0xff):
In function `unixzm2zi3zi1zi0_SystemziPosixziSemaphore_zdwa_info':
: undefined reference to `sem_trywait'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0x5e7):
In function `s2aS_info':
: undefined reference to `sem_getvalue'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0x817):
In function `s2dq_info':
: undefined reference to `sem_post'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0xa4f):
In function `s2gg_info':
: undefined reference to `sem_wait'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0xfbb):
In function `s2nm_info':
: undefined reference to `sem_close'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0x1276):
In function `s2nt_info':
: undefined reference to `sem_open'
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)(.text+0x15b3):
In function `s2v9_info':
: undefined reference to `sem_unlink'
collect2: ld returned 1 exit status
gmake[2]: *** [with-stage-2] Error 1
>From the link map (invoking gcc by hand and adding -Wl,-M):
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Posix.o)
/var/tmp/ghc/ghc-head/libraries/directory/dist/build/libHSdirectory-1.0.0.2.a(Directory.o)
(__stginit_unixzm2zi3zi1zi0_SystemziPosix_)
[...]
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Semaphore.o)
/var/tmp/ghc/ghc-head/libraries/unix/dist/build/libHSunix-2.3.1.0.a(Posix.o)
(__stginit_unixzm2zi3zi1zi0_SystemziPosixziSemaphore_)
Semaphore.o is pulled in via Posix.o which is pulled in via
libHSdirectory(Directory.o). I wonder wether this works on any
unix-like system when SplitObjs=NO.
My only idea how to fix this it to add -pthread to cc-options and
ld-options of unix.buildinfo if SplitObjs=NO, but this sounds like
a crude hack to me.
If anyone has a better solution, please let me know.
Ciao,
Kili
_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc