Your message dated Fri, 03 Jun 2011 00:26:07 +0200
with message-id <1307053567.26269.26.camel@kirk>
and subject line works with -optl-pthread
has caused the Debian Bug report #593402,
regarding ghc6: static compilation fails due to missing -lpthread
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
593402: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=593402
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: ghc6
Version: 6.12.1-13
Severity: normal
Hi,
I found that ghc cannot compile static binaries anymore. It fails with
a big list of linker errors against functions from libpthread. Compiling
attached source with
ghc -Wall -O -static -optl-static -o test test.hs
generates a long list of errors like:
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `init_mparams':
(.text+0x3e): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `init_mparams':
(.text+0x53): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `init_mparams':
(.text+0xca): undefined reference to `pthread_mutex_init'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `ffi_closure_free':
(.text+0x565): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `T.229':
(.text+0x10c0): undefined reference to `pthread_mutex_lock'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `T.229':
(.text+0x10d5): undefined reference to `pthread_mutex_unlock'
/usr/lib/gcc/i486-linux-gnu/4.4.5/../../../../lib/libffi.a(closures.o): In
function `ffi_closure_alloc':
(.text+0x132c): undefined reference to `pthread_mutex_unlock'
'ghc -v3' shows that linking is not done against libpthread. Also adding
'-optl-lpthread' doesn't help as it is placed before all other libraries.
Manually copying the linker command and adding -lpthread at the end does
work.
Best,
Jaap
-- System Information:
Debian Release: squeeze/sid
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (x86_64)
Kernel: Linux 2.6.32-trunk-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages ghc6 depends on:
ii gcc 4:4.4.4-2 The GNU C compiler
ii libbsd-dev 0.2.0-1 utility functions from BSD systems
ii libc6 2.11.2-2 Embedded GNU C Library: Shared lib
ii libc6-dev 2.11.2-2 Embedded GNU C Library: Developmen
ii libffi-dev 3.0.9-2 Foreign Function Interface library
ii libffi5 3.0.9-2 Foreign Function Interface library
ii libgmp3-dev 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii libgmp3c2 2:4.3.2+dfsg-1 Multiprecision arithmetic library
ii libncurses5 5.7+20100313-2 shared libraries for terminal hand
ii perl [perl5] 5.10.1-14 Larry Wall's Practical Extraction
ghc6 recommends no packages.
Versions of packages ghc6 suggests:
pn ghc6-doc <none> (no description available)
pn ghc6-prof <none> (no description available)
pn haskell-doc <none> (no description available)
-- no debconf information
import IO
main = do putStr "Hello world!\n"
--- End Message ---
--- Begin Message ---
Version: 7.0.3-1
Hi Jaap,
static linking works if you pass -optl-static -optl-pthread to ghc.
Greetings,
Joachim
--
Joachim "nomeata" Breitner
Debian Developer
[email protected] | ICQ# 74513189 | GPG-Keyid: 4743206C
JID: [email protected] | http://people.debian.org/~nomeata
signature.asc
Description: This is a digitally signed message part
--- End Message ---