Per Larsson wrote:
[...] Is there a GHC switch that I have missed that enables you to statically link the parts of libc that is used by the haskell program? [...]

Passing "-static" to the GNU linker results in a, well, statically linked program. :-) Using "-optl -static" with GHC does what you want, see:

   
http://haskell.org/ghc/docs/latest/html/users_guide/options-phases.html#FORCING-OPTIONS-THROUGH

And here the proof:

   [EMAIL PROTECTED]:> ghc --make -optl -static Main.hs
   Chasing modules from: Main.hs
   Compiling Main             ( Main.hs, Main.o )
   Linking ...
   [EMAIL PROTECTED]:> file a.out
   a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 
2.2.5, statically linked, not stripped
   [EMAIL PROTECTED]:> ldd a.out
        not a dynamic executable

For non-GNU linkers consult the man pages for "ld", differing linking techniques
are one of the most annoying incompatibilities between different *nices IMHO.

Cheers,
   S.

_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to