Re: Linking completely statically

2020-08-12 Thread Albert Y. C. Lai
On 2020-08-12 10:15 a.m., Volker Wysk wrote: But it sounds quite complicated. What I have in mind isn't worth the trouble. I just wanted to have a statically linked version for inclusion in my backup and in my maintenance USB stick. I have an exe built by GHC in January 2014 (that's like GHC 7.

Re: Linking completely statically

2020-08-12 Thread Volker Wysk
Hi Thank you very much to Brandon, Tyson, Bardur, Thomas, Andreas, Aycan for your explanations. I thought that it probably was just another GHC argument or something like that. But it sounds quite complicated. What I have in mind isn't worth the trouble. I just wanted to have a statically linke

Re: Linking completely statically

2020-08-11 Thread Thomas DuBuisson
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. [1] Script: ht

Re: Linking completely statically

2020-08-11 Thread Aycan iRiCAN
Hi Volker, You may also want to check out ghc-musl project https://github.com/utdemir/ghc-musl which provides compiled docker images to build atatic executables for various ghc versions. Cheers, -- aycan > On Aug 11, 2020, at 5:59 AM, Volker Wysk wrote: > > Am Dienstag, den 11.08.2020, 10:

Re: Linking completely statically

2020-08-11 Thread Volker Wysk
Am Dienstag, den 11.08.2020, 10:26 +0200 schrieb Herrmann, Andreas: > Hi Volker, Hi! > > Is it possible to link the remaining libraries statically too? > > Yes, it is possible to generate fully statically linked Haskell > binaries. Though it requires a bit of setup. For example the GNU C > libra

Re: Linking completely statically

2020-08-11 Thread Herrmann, Andreas
Hi Volker, > Is it possible to link the remaining libraries statically too? > Yes, it is possible to generate fully statically linked Haskell binaries. Though it requires a bit of setup. For example the GNU C library glibc is not really intended for fully static linking, but you can use musl as

Re: Linking completely statically

2020-08-10 Thread Bardur Arantsson
On 10/08/2020 23.22, Tyson Whitehead wrote: > On Mon, 10 Aug 2020 at 03:12, Bardur Arantsson > wrote: > > Once you have that bit set up, you can copy *most* of the libraries > ..so's you're using to that folder on the install target and they'll be > loaded

Re: Linking completely statically

2020-08-10 Thread Tyson Whitehead
On Mon, 10 Aug 2020 at 03:12, Bardur Arantsson wrote: > Once you have that bit set up, you can copy *most* of the libraries > .so's you're using to that folder on the install target and they'll be > loaded from there. (Copying libc.so is ill advised, but most of the > others will work just fine.

Re: Linking completely statically

2020-08-10 Thread Volker Wysk
Am Montag, den 10.08.2020, 09:11 +0200 schrieb Bardur Arantsson: > On 09/08/2020 14.50, Volker Wysk 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 librari

Re: Linking completely statically

2020-08-10 Thread Bardur Arantsson
On 09/08/2020 14.50, Volker Wysk 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

Re: Linking completely statically

2020-08-09 Thread Volker Wysk
Am Sonntag, den 09.08.2020, 09:53 -0400 schrieb Brandon Allbery: > If you are obeying all the necessary restrictions on glibc, or you > are > using a different libc such as musl which is designed for static > linking, then "-Wl,-static" should be sufficient. Doing this with > glibc will likely resu

Re: Linking completely statically

2020-08-09 Thread Volker Wysk
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

Re: Linking completely statically

2020-08-09 Thread 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. On Sun, Aug 9, 2020,

Linking completely statically

2020-08-09 Thread Volker Wysk
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