[Haskell-cafe] How to statically link some external libraries?

Sylvain Henry sylvain at haskus.fr
Wed Jul 19 08:16:18 UTC 2017


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.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20170719/9666d5c0/attachment-0001.html>


More information about the Haskell-Cafe mailing list