[Nix-dev] Compile Haskell program on nixos that works on ubuntu server

Cody Goodman codygman.consulting at gmail.com
Sat Jul 5 23:38:25 CEST 2014


How would I go about packaging the libs needed to do static linking?

[cody at cody-nixos:~/tmp]$ ghc -optl-static static-test.hs
Linking static-test ...
/nix/store/xjvdpqgn2kd4rg0k30z020kxylvlbpx0-binutils-2.23.1/bin/ld:
cannot find -lgmp
/nix/store/1jp3vsjcl8ydiy92lzyjclwr943vh5lx-ghc-7.6.3/lib/ghc-7.6.3/libHSrts.a(Linker.o):
In function `addDLL':
Linker.c:(.text+0x1a19): warning: Using 'dlopen' in statically linked
applications requires at runtime the shared libraries from the glibc
version used for linking
collect2: error: ld returned 1 exit status

so I need a static version of libgmp.so.10 packaged? Or should I just
package musl or uClibc (I'm a beginner at packaging)? Suggestions
and/or pros/cons on musl or uClibc?

What would be the easiest way for me to have ghc -optl-static
myprogram.hs working? I am okay with doing the work to make this
happen, but I'd like to know what my options are.

On Sat, Jul 5, 2014 at 7:56 AM, Vladimír Čunát <vcunat at gmail.com> wrote:
> It's supposed to work adding -optl-static, only we lack static versions of
> some libs to make that possible out-of-box (and some are missing on that
> Gentoo I tried, too).
>
> http://stackoverflow.com/questions/10539857/statically-link-gmp-to-an-haskell-application-using-ghc-llvm
>
> Vlada
>
>
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>


More information about the nix-dev mailing list