help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using Haskell library packages - linker error


From: Timothy Sample
Subject: Re: Using Haskell library packages - linker error
Date: Mon, 07 Sep 2020 09:50:51 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi Jakub,

Jakub Kądziołka <kuba@kadziolka.net> writes:

> I am trying to set up Agda, and I have reduced it to a simpler problem:
>
> $ cat test.hs
> import Numeric.IEEE
>
> main = return ()
> $ genv --pure --ad-hoc ghc@8.6 ghc-ieee754 gcc-toolchain
> % ghc test.hs
> Linking test ...
> ld: cannot find -lHSieee754-0.8.0-IfCS1Dp7pQVIOQRslM6kD
> collect2: error: ld returned 1 exit status
> `gcc' failed in phase `Linker'. (Exit code: 1)
>
> How can I fix this error? Am I doing something wrong, or is this a
> packaging bug?

GHC needs a special flag to link shared libraries.  We recently starting
building shared libraries for our Haskell packages.  The static ones are
still being built, but they go to a separate output.  I think you can
fix your problem in one of two ways:

    1. Pass the “-dynamic” flag to GHC (and maybe “-fPIC”);
    2. Use “ghc-ieee754:static”.

The first is preferred because the second could get really tricky if
there are nested dependencies.

The fact that the user experience is so wonky is a bit of packaging bug,
for sure.  I’m not sure how to make it nicer just yet.


-- Tim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]