[Haskell-cafe] How to statically link some external libraries?
Kai Zhang
kai at kzhang.org
Thu Jul 20 06:11:16 UTC 2017
Thanks, but that would link all libraries statically.
On Wed, Jul 19, 2017 at 1:17 AM Sylvain Henry <sylvain at haskus.fr> wrote:
> 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.
>
>
> _______________________________________________
> 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/20170720/f9fcfd36/attachment.html>
More information about the Haskell-Cafe
mailing list