unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "Jakub Kądziołka" <kuba@kadziolka.net>
To: Timothy Sample <samplet@ngyro.com>
Cc: help-guix@gnu.org
Subject: Re: Using Haskell library packages - linker error
Date: Mon, 7 Sep 2020 17:29:02 +0200	[thread overview]
Message-ID: <20200907152902.x73pun4546wbcnfo@gravity> (raw)
In-Reply-To: <87eendpuf8.fsf@ngyro.com>

[-- Attachment #1: Type: text/plain, Size: 1545 bytes --]

On Mon, Sep 07, 2020 at 09:50:51AM -0400, Timothy Sample wrote:
> 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”.

ghc-ieee754:static doesn't seem to exist, but passing -dynamic does
indeed work. The workaround also translates to Agda, with

$ agda --ghc-flag=-dynamic --compile hello-world.agda

I'd really rather this wasn't necessary, though. I can already imagine
having to figure out how to pass this flag to agda through build systems
and editor plugins.

On a related note, shouldn't it be possible to use agda without
specifying ghc (and transitively, gcc) in your profile?

Regards,
Jakub Kądziołka

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-09-07 15:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 23:27 Using Haskell library packages - linker error Jakub Kądziołka
2020-09-07 13:50 ` Timothy Sample
2020-09-07 15:29   ` Jakub Kądziołka [this message]
2020-09-07 17:36     ` Timothy Sample

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200907152902.x73pun4546wbcnfo@gravity \
    --to=kuba@kadziolka.net \
    --cc=help-guix@gnu.org \
    --cc=samplet@ngyro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).