[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to make a working ld in guix pure environment?
From: |
Ludovic Courtès |
Subject: |
Re: How to make a working ld in guix pure environment? |
Date: |
Thu, 24 May 2018 22:38:44 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Hello,
Fis Trivial <address@hidden> skribis:
> I tried to use ld in guix pure environment, tested with bintuils,
> gcc-toolchain, ld-wrapper, and none of them work.
>
> Take the following trivial snippy (not opencl related) as an example:
>
> // main.c
> #include <math.h>
>
> int main()
> {
> log1p(32);
> }
>
>
> To build it, one would do something similar to `ld -lm main.o` after
> compilation. But I got an error saying "ld: cannot find -lm".
You would need to use ld-wrapper, not ld, so that ld-wrapper sets the
RUNPATH appropriately.
But this won’t fix the problem above. The problem above is that glibc
is not in the search path. To fix that, a simple fix would be to add a
wrapper atop ld-wrapper (!) that would add “-L /gnu/store/…-glibc/lib”.
Perhaps there are more elegant ways to achieve it though. How is ld
invoked? Would it work to add that -L flag directly in the code that
invokes ld?
HTH!
Ludo’.