Re: Linking completely statically

Volker Wysk <[email protected]>
Newsgroups gmane.comp.lang.haskell.glasgow.user
Message-ID <[email protected]>
Am Sonntag, den 09.08.2020, 08:59 -0400 schrieb Brandon Allbery:
> Linux is not friendly to static linking, and you would need to either
> package or match exact versions of things like the nss and locale
> libraries that are dynamically loaded at runtime and don't show up in
> ldd. This limitation comes from glibc and is documented in its
> manual.

That's bad. But, like you said, it *is* possible. The dar (disk
archiver) program comes with a statically linked version "dar_static":

% ldd dar_static 
Das Programm ist nicht dynamisch gelinkt

("The program isn't linked dynamically.")

From your answer, I assume that this isn't supported by GHC.

Cheers
Volker


> 
> On Sun, Aug 9, 2020, 08:50 Volker Wysk <[email protected]> wrote:
> > Hi!
> > 
> > I know of the command line argument "-static". But this only
> > affects
> > the Haskell libraries. I want to link some programs completely
> > statically, no external libraries needed. 
> > 
> > When just linking with "-static" I still have those dynamically
> > linked
> > things:
> > 
> > desktop ~/bin $ ldd sicherung
> >         linux-vdso.so.1 (0x00007ffdab53f000)
> >         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6
> > (0x00007f3633da0000)
> >         librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1
> > (0x00007f3633d95000)
> >         libutil.so.1 => /lib/x86_64-linux-gnu/libutil.so.1
> > (0x00007f3633d90000)
> >         libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2
> > (0x00007f3633d8a000)
> >         libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0
> > (0x00007f3633d67000)
> >         libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10
> > (0x00007f3633ce3000)
> >         libatomic.so.1 => /lib/x86_64-linux-gnu/libatomic.so.1
> > (0x00007f3633cd7000)
> >         libffi.so.7 => /lib/x86_64-linux-gnu/libffi.so.7
> > (0x00007f3633ccb000)
> >         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
> > (0x00007f3633ad9000)
> >         /lib64/ld-linux-x86-64.so.2 (0x00007f3633f0c000)
> > 
> > 
> > Is it possible to link the remaining libraries statically too?
> > 
> > Regards,
> > Volker
> > _______________________________________________
> > Glasgow-haskell-users mailing list
> > [email protected]
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users

_______________________________________________
Glasgow-haskell-users mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/glasgow-haskell-users
signature.asc (application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE-----

iF0EABECAB0WIQRqEGbxQKLEQbtVCqj6sU/BCL4k7wUCXy/2EgAKCRD6sU/BCL4k
7xzeAKCOdCokrIxdBiSNRkuUw27JM3h13ACdG7oiCG0+h0H9zNGojqsyq2mc1W4=
=I2Gd
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.