Hi,

This is what I have in my .cabal file to get a statically-linked executable:

   ghc-options: -Wall -static -threaded
   cc-options: -static
   ld-options: -static -pthread

Sylvain


On 18/07/2017 20:46, Kai Zhang wrote:
I want to produce a statically-linked executable. First I tried "-optl-static -optc-static -optl-pthrea", which statically links all external libraries. But when I ran this executable it gives me "abort (core dumped)" error. I suspect the statically-linked glibc library might be the cause. So I decide to statically link all other libraries and leave the glibc as a dynamic library. How to do this using Cabal? Should I write a custom "Setup.hs"?


_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
Only members subscribed via the mailman list are allowed to post.