<div dir="ltr"><div>I was able to get static linking working recently using docker alpine images and ghcup to install GHC based on the musl library.  The details are in my Stan fork [1].  This borrowed heavily from ShellCheck's static linking release system except it uses cabal v2-build instead of v1.</div><div><br></div><div><br></div><div>[1]</div><div>Script: <a href="https://github.com/TomMD/stan/blob/feature/basic-json-output/mkRelease.sh">https://github.com/TomMD/stan/blob/feature/basic-json-output/mkRelease.sh</a></div><div>Dockerfile: <a href="https://github.com/TomMD/stan/blob/feature/basic-json-output/Dockerfile">https://github.com/TomMD/stan/blob/feature/basic-json-output/Dockerfile</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Aug 9, 2020 at 5:51 AM Volker Wysk <<a href="mailto:post@volker-wysk.de">post@volker-wysk.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
I know of the command line argument "-static". But this only affects<br>
the Haskell libraries. I want to link some programs completely<br>
statically, no external libraries needed. <br>
<br>
When just linking with "-static" I still have those dynamically linked<br>
things:<br>
<br>
desktop ~/bin $ ldd sicherung<br>
        linux-vdso.so.1 (0x00007ffdab53f000)<br>
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6<br>
(0x00007f3633da0000)<br>
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1<br>
(0x00007f3633d95000)<br>
        libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1<br>
(0x00007f3633d90000)<br>
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2<br>
(0x00007f3633d8a000)<br>
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0<br>
(0x00007f3633d67000)<br>
        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10<br>
(0x00007f3633ce3000)<br>
        libatomic.so.1 => /lib/x86_64-linux-gnu/libatomic.so.1<br>
(0x00007f3633cd7000)<br>
        libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7<br>
(0x00007f3633ccb000)<br>
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6<br>
(0x00007f3633ad9000)<br>
        /lib64/ld-linux-x86-64.so.2 (0x00007f3633f0c000)<br>
<br>
<br>
Is it possible to link the remaining libraries statically too?<br>
<br>
Regards,<br>
Volker<br>
_______________________________________________<br>
Glasgow-haskell-users mailing list<br>
<a href="mailto:Glasgow-haskell-users@haskell.org" target="_blank">Glasgow-haskell-users@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users</a><br>
</blockquote></div>