GNU bug report logs - #63728
GHC cannot find lrt

Previous Next

Package: guix;

Reported by: Antero Mejr <antero <at> mailbox.org>

Date: Thu, 25 May 2023 22:26:01 UTC

Severity: normal

Merged with 63258

To reply to this bug, email your comments to 63728 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Thu, 25 May 2023 22:26:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Antero Mejr <antero <at> mailbox.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 25 May 2023 22:26:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: bug-guix <at> gnu.org
Subject: GHC cannot find lrt
Date: Thu, 25 May 2023 22:25:29 +0000
Attempting to build a trivial Haskell program using ghc fails, as the
linker cannot find the rt library:

```
~ $ ghc -O2 test.hs
Linking test ...
/home/a/.guix-profile/bin/ld: cannot find -lrt: No such file or directory
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
```

Glibc and gcc-toolchain are installed in the profile, and
~/.guix-profile/lib/librt.so.1 exists.

Maybe this is related to this new bug, or the recent core-updates merge?
https://issues.guix.gnu.org/63238




Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Fri, 26 May 2023 09:20:01 GMT) Full text and rfc822 format available.

Message #8 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Mekeor Melire <mekeor <at> posteo.de>
To: Antero Mejr <antero <at> mailbox.org>
Cc: 63728 <at> debbugs.gnu.org
Subject: Re: bug#63728: GHC cannot find lrt
Date: Fri, 26 May 2023 09:17:55 +0000
2023-05-25 22:25 bug-guix <at> gnu.org:

> Attempting to build a trivial Haskell program using ghc fails, 
> as the linker cannot find the rt library:

Does installing gcc-toolchain:static help as a work-around?




Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Fri, 26 May 2023 09:24:01 GMT) Full text and rfc822 format available.

Message #11 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Mekeor Melire <mekeor <at> posteo.de>
To: Antero Mejr <antero <at> mailbox.org>
Cc: 63728 <at> debbugs.gnu.org
Subject: Re: bug#63728: GHC cannot find lrt
Date: Fri, 26 May 2023 09:21:02 +0000
2023-05-25 22:25 bug-guix <at> gnu.org:

> Attempting to build a trivial Haskell program using ghc fails, 
> as the linker cannot find the rt library:
>
> ```
> ~ $ ghc -O2 test.hs
> Linking test ...
> /home/a/.guix-profile/bin/ld: cannot find -lrt: No such file or 
> directory
> collect2: error: ld returned 1 exit status
> `gcc' failed in phase `Linker'. (Exit code: 1)
> ```
>
> Glibc and gcc-toolchain are installed in the profile, and
> ~/.guix-profile/lib/librt.so.1 exists.
>
> Maybe this is related to this new bug, or the recent 
> core-updates merge? https://issues.guix.gnu.org/63238

There is also this bug I had reported:

https://issues.guix.gnu.org/63258

I suggest to merge this bug (63728) and the bug I just linked 
(63258). What do you think?




Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Fri, 26 May 2023 15:17:02 GMT) Full text and rfc822 format available.

Message #14 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: control <at> debbugs.gnu.org
Cc: 63728 <at> debbugs.gnu.org
Date: Fri, 26 May 2023 15:16:16 +0000
merge 63258 63728




Merged 63258 63728. Request was from Antero Mejr <antero <at> mailbox.org> to control <at> debbugs.gnu.org. (Fri, 26 May 2023 15:17:03 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Fri, 26 May 2023 15:45:02 GMT) Full text and rfc822 format available.

Message #19 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Antero Mejr <antero <at> mailbox.org>
To: Mekeor Melire <mekeor <at> posteo.de>
Cc: 63728 <at> debbugs.gnu.org
Subject: Re: bug#63728: GHC cannot find lrt
Date: Fri, 26 May 2023 15:44:26 +0000
Mekeor Melire <mekeor <at> posteo.de> writes:

> 2023-05-25 22:25 bug-guix <at> gnu.org:
>
>> Attempting to build a trivial Haskell program using ghc fails, as the linker
>> cannot find the rt library:
>
> Does installing gcc-toolchain:static help as a work-around?

I merged this bug with #63258.

The gcc-toolchain:static workaround fixes the rt problem, but now the
binaries aren't linked to libgmp and libffi, even though gmp and libffi
packages are installed in the profile:

--8<---------------cut here---------------start------------->8---
~$ ghc -O2 test.hs
~$ ldd ./test
  linux-vdso.so.1 (0x00007ffe0956f000)
  libgmp.so.10 => not found
  libc.so.6 => /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so.6 (0x00007fbe27e3f000)
  libm.so.6 => /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libm.so.6 (0x00007fbe27d62000)
  libffi.so.8 => not found
  libgcc_s.so.1 => /gnu/store/qcg59v4yg239jj1k0xvqqqkqv6l8q6ll-gcc-12.2.0-lib/lib/libgcc_s.so.1 (0x00007fbe27d41000)
  /gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/ld-linux-x86-64.so.2 => /gnu/store/ip9mj1pwymxi1yq32zbhwp3n3bycy6yi-glibc-2.35/lib/ld-linux-x86-64.so.2 (0x00007fbe2803d000)
--8<---------------cut here---------------end--------------->8---

Maybe there should be a ghc-toolchain package that has libgmp and
libffi as inputs, and makes sure GHC links them correctly?




Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Mon, 29 May 2023 20:08:01 GMT) Full text and rfc822 format available.

Message #22 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Mekeor Melire <mekeor <at> posteo.de>
To: Antero Mejr <antero <at> mailbox.org>
Cc: 63728 <at> debbugs.gnu.org
Subject: Re: bug#63728: GHC cannot find lrt
Date: Mon, 29 May 2023 20:04:21 +0000
2023-05-26 15:44 antero <at> mailbox.org:

> The gcc-toolchain:static workaround fixes the rt problem, but 
> now the binaries aren't linked to libgmp and libffi, even though 
> gmp and libffi packages are installed in the profile:
>
> Maybe there should be a ghc-toolchain package that has libgmp 
> and libffi as inputs, and makes sure GHC links them correctly?

Hm. Alternatively, we could just fix gcc-toolchain (so that it 
includes rt). But maintainers (understandably) hesitate because 
this will trigger a world rebuild.




Information forwarded to bug-guix <at> gnu.org:
bug#63728; Package guix. (Wed, 31 May 2023 18:41:02 GMT) Full text and rfc822 format available.

Message #25 received at 63728 <at> debbugs.gnu.org (full text, mbox):

From: Josselin Poiret <dev <at> jpoiret.xyz>
To: Mekeor Melire <mekeor <at> posteo.de>, Antero Mejr <antero <at> mailbox.org>
Cc: 63728 <at> debbugs.gnu.org
Subject: Re: bug#63728: GHC cannot find lrt
Date: Wed, 31 May 2023 20:40:28 +0200
[Message part 1 (text/plain, inline)]
Hi everyone,

Mekeor Melire <mekeor <at> posteo.de> writes:

> Hm. Alternatively, we could just fix gcc-toolchain (so that it 
> includes rt). But maintainers (understandably) hesitate because 
> this will trigger a world rebuild.

Yet another alternative would be to patch GHC to not include `-lrt` in
its flags.  Yet another big rebuild though!  The proper fix in the
meantime is as you mentioned: add ghc-toolchain to contain everything
that's needed.  I find it weird though, since I've never had to do
anything of the sort when building Agda locally since the core-updates
merge though.

Best,
-- 
Josselin Poiret
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 2 years and 14 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.