chetant / LibClang

Haskell FFI to libclang
Other
58 stars 10 forks source link

libpthread symbol error? #37

Closed ghorn closed 11 years ago

ghorn commented 11 years ago

I just built the latest llvm3.4 branch, and when I tried to compile my program with ghc --make MyLibClangApp.hs I got this error:

Linking MyLibClangApp ...
/usr/bin/ld: /home/ghorn/hslibs/LibClang/build/out/lib/libLLVMSupport.a(Mutex.o): undefined reference to symbol 'pthread_mutexattr_settype@@GLIBC_2.2.5'
/lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status

I do have the pthread_mutexattr_settype symbol:

$ nm /lib/x86_64-linux-gnu/libpthread.so.0 | grep -i pthread_mutexattr_settype
000000000000af40 T __pthread_mutexattr_settype
000000000000af40 T pthread_mutexattr_settype

but it doesn't have @@GLIBC_2.2.5 appended to it.

Do you have any idea what this might be about? I'm on Debian Sid, 64 bit btw

sethfowler commented 11 years ago

Sounds like you're not getting libpthread linked in. This is probably working for me since my main application is multithreaded. Does the referenced commit fix this for you?

ghorn commented 11 years ago

Yes it does, thank you!

sethfowler commented 11 years ago

Great!