static linking

Peter Gammie peteg42 at
Mon May 26 23:37:56 EDT 2008


I am having a bit of trouble static linking my program using GHC 6.8.2.

In brief: "rt" uses "pthread", but -lrt is the final thing on the  
command line passed to the linker, and so the pthread symbols are not  
resolved. Manually moving -lpthread to the end of the collect2 command  
line does the trick.

The question is how to do this using ghc.

This is on Debian, using the 6.8.2-5 from unstable.

I can provide the command lines if that is helpful.

Note the same setup worked fine under GHC 6.6.1.


More information about the Glasgow-haskell-users mailing list