<div dir="ltr">Thanks, but that would link all libraries statically.</div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 19, 2017 at 1:17 AM Sylvain Henry <<a href="mailto:sylvain@haskus.fr">sylvain@haskus.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Hi,</p>
<p>This is what I have in my .cabal file to get a statically-linked
executable:</p>
<p> ghc-options: -Wall -static -threaded<br>
cc-options: -static<br>
ld-options: -static -pthread<br>
<br>
Sylvain<br>
</p></div><div text="#000000" bgcolor="#FFFFFF">
<br>
<div class="m_-2643096525027446471moz-cite-prefix">On 18/07/2017 20:46, Kai Zhang wrote:<br>
</div>
</div><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite">
<div dir="ltr">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"?</div>
<br>
<fieldset class="m_-2643096525027446471mimeAttachmentHeader"></fieldset>
<br>
</blockquote></div><div text="#000000" bgcolor="#FFFFFF"><blockquote type="cite"><pre>_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a class="m_-2643096525027446471moz-txt-link-freetext" href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>