all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ian Eure <ian@retrospec.tv>
To: help-guix@gnu.org
Subject: Re: LD_LIBRARY_PATH issues when compiling package
Date: Tue, 02 Jan 2024 16:39:30 -0800	[thread overview]
Message-ID: <87jzorfdfn.fsf@meson> (raw)
In-Reply-To: <871qbajyk6.fsf@h-brs.de>


Alexander Asteroth <alexander.asteroth@h-brs.de> writes:

> Dear all,
>
> (snip)
>
> Now I have basically three questions:
>
> 1. how can I advice the package build process (see [0]) to set 
> the 
> LDFLAGS correctly?
>    (shouldn't this be done by adding `(input [...] libffi [...] 
>    )` 
>    to the package description?)
>

For the few packages I’ve put together, adding the library to the 
package inputs has enabled the build to see and link against them. 
I don’t know the mechanics of how this works, but it seems to.

If your package requires the library at runtime (which sounds like 
it’s the case for you), it needs to be in propagated-inputs 
instead.


> 2. how do programs in a guix system find the libraries (which 
> reside in $HOME/.guix-profile/lib and in the store directories) 
> anyway?

The rpath[1] in the ELF header of compiled binaries it set to the 
store location of the libraries it’s linked against.  This is very 
easy to see on a foreign distribution with Guix installed.  Here’s 
one of my machines, which is running Debian, and has SBCL 
installed both via apt and guix:

meson!ieure:~$ readelf -d /usr/bin/sbcl | grep 'R.*PATH'
meson!ieure:~$ readelf -d ~/.guix-profile/bin/sbcl | grep 
'R.*PATH'
 0x000000000000001d (RUNPATH)            Library runpath: 
 [/gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib:/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib:/gnu/store/3x3dl71d4xm6y4hjwq110hmfyfx0xc6j-zstd-1.5.0-lib/lib:/gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/10.3.0/../../..]


> 3. does anybody have an idea what could have caused the library 
> not to be found anymore after an update of the packages?
>    (that even could not be resolved by rolling back to the old 
>    environment of before the change)

Hard to say, I don’t have a hypothesis.

  — Ian

[1]: https://en.wikipedia.org/wiki/Rpath


      reply	other threads:[~2024-01-03  0:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-25 11:24 LD_LIBRARY_PATH issues when compiling package Alexander Asteroth
2024-01-03  0:39 ` Ian Eure [this message]

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

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

  git send-email \
    --in-reply-to=87jzorfdfn.fsf@meson \
    --to=ian@retrospec.tv \
    --cc=help-guix@gnu.org \
    /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.
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.