all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#63238: issue linking to librt
@ 2023-05-02 20:01 Ava Hahn
  2023-05-04  3:40 ` bug#63238: (no subject) semilin
  0 siblings, 1 reply; 3+ messages in thread
From: Ava Hahn @ 2023-05-02 20:01 UTC (permalink / raw)
  To: 63238

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

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.


[-- Attachment #2: Type: text/html, Size: 1279 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63238: (no subject)
  2023-05-02 20:01 bug#63238: issue linking to librt Ava Hahn
@ 2023-05-04  3:40 ` semilin
  2023-05-26 15:58   ` bug#63238: issue linking to librt Brian Cully via Bug reports for GNU Guix
  0 siblings, 1 reply; 3+ messages in thread
From: semilin @ 2023-05-04  3:40 UTC (permalink / raw)
  To: 63238

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



I encountered the same issue recently. I used to be able to compile with 
`cargo build` just fine just a few days ago. I recently upgraded my 
system from glibc 2.33 to 2.35, and I'd guess it's related to that. 
However, running it in `guix shell glibc@2.33` results in the same 
problem, so I'm not sure.

[-- Attachment #2: Type: text/html, Size: 525 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#63238: issue linking to librt
  2023-05-04  3:40 ` bug#63238: (no subject) semilin
@ 2023-05-26 15:58   ` Brian Cully via Bug reports for GNU Guix
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Cully via Bug reports for GNU Guix @ 2023-05-26 15:58 UTC (permalink / raw)
  To: semilin; +Cc: 63238

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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-26 15:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-02 20:01 bug#63238: issue linking to librt Ava Hahn
2023-05-04  3:40 ` bug#63238: (no subject) semilin
2023-05-26 15:58   ` bug#63238: issue linking to librt Brian Cully via Bug reports for GNU Guix

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.