bug#63238: issue linking to librt

2023-05-26 Thread Brian Cully via Bug reports for GNU Guix
librt and libpthread were merged into libc with glibc 2.34, however, for
compatibility, there exist empty .a files to satisfy the linker. But
because Guix has a separate output for the static libraries, they need
to be explicitly installed from ‘glibc:static’, which allows Cargo to do
its thing.

Cargo itself should probably be fixed so that it no longer tries to link
with these libraries, but until that time, the above work-around suffices.





bug#63238: issue linking to librt

2023-05-07 Thread Ava Hahn
Hello All,

I believe I have stumbled on an issue with how the libraries in glibc are 
stored.
If I run "ld -lrt" it reports "ld: cannot find -lrt: No such file or directory"
Meanwhile, I can find librt with "ldconfig -p | grep librt": "librt.so.1 ... => 
/gnu/store/...".

In order to get ld to find librt I need to take the following steps:
- make a folder I can write to (not .~/guix-profile/lib)
- symlink ~/.guix-profile/lib/librt.so.1 to /my-folder/librt.so
- add the corresponding option to ld: "ld -lrt -L ~/lib"
Then ld is able to find librt.

I stumbled on this while trying to compile a rust project with "cargo build".
Compiling any dependency that relied on libc failed on linking to librt.

Feel free to let me know if there is some Guix facility I should be using 
instead. I am pretty new to this. I tried using cargo in a Guix shell but the 
same problem persisted.