bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70349: Clang fails to communicate RUNPATH?


From: Ludovic Courtès
Subject: bug#70349: Clang fails to communicate RUNPATH?
Date: Sat, 25 May 2024 11:26:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Hi Liliana,

Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> skribis:

> I've noticed a strange error when attempting to build my software
> against clang-toolchain.  I've attached a minimally breaking example,
> but the gist of it is that RUNPATH validation fails as shown below.
>
>   starting phase `validate-runpath'
>   validating RUNPATH of 1 binaries in
>   "/gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin"...
>   /gnu/store/sd1zjjf13mi448qbqaphhcvf9ap5jxji-why-hello-0/bin/hello:
>   error: depends on 'libfmt.so.9', which cannot be found in RUNPATH
>   ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib")
>
> Is this expected?  I know that the -for-system have historically
> disregarded the existence of clang-toolchain and hence led to issues,
> but I think this is something else…

Could this be an issue specific to ‘meson-build-system’?

For instance, this works fine (both mpfr and mpc use
‘gnu-build-system’):

  guix build mpc --with-c-toolchain=mpfr=clang-toolchain

If we add this to the example you posted:

   (arguments
    (list #:phases #~(modify-phases %standard-phases
                       (add-after 'unpack 'debug-ld-wrapper
                         (lambda _
                           (setenv "GUIX_LD_WRAPPER_DEBUG" "yes"))))))

… we see:

--8<---------------cut here---------------start------------->8---
ld-wrapper: library search path: 
("/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0"
 "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.."
 "/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-meson-1.1.0/lib" 
"/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" 
"/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" 
"/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib" 
"/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib" 
"/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib" 
"/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib" 
"/gnu/store/0irvg0gvvfwagdjckigvr4g8xap94y1j-clang-toolchain-18.1.5/lib")
ld-wrapper: libraries linked: 
("/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib/libfmt.so" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libstdc++.so"
 "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libm.so" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libgcc_s.so"
 "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/libc.so" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../../libgcc_s.so")
ld-wrapper: invoking 
`/gnu/store/zh4x65snfis7svs6906gj1z8i7dx2j3m-binutils-2.38/bin/ld' with 
("--eh-frame-hdr" "-m" "elf_x86_64" "-pie" "-dynamic-linker" 
"//gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/ld-linux-x86-64.so.2"
 "-o" "hello" 
"/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/Scrt1.o" 
"/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/crti.o" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtbeginS.o"
 
"-L/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0"
 "-L/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" 
"-L/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.."
 "-L/gnu/store/inpy5mz35fwvclynpag5gsp6d1hflfsz-meson-1.1.0/lib" 
"-L/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" 
"-L/gnu/store/j8wlfmlmfvpbza6is9wv9xsd8psrxn00-bzip2-1.0.8/lib" 
"-L/gnu/store/gr0sy0m1mv36qv54idm6cn10l3mngshq-file-5.44/lib" 
"-L/gnu/store/hc05d76f1j3iz3v2bs5jz4fpljl1r4dj-gawk-5.2.1/lib" 
"-L/gnu/store/6k1yys9wqrfn4y41ic1win8gpnimncwj-xz-5.2.8/lib" 
"-L/gnu/store/visfdda934gvivwihwhlm63fdqhhcc8a-glibc-utf8-locales-2.35/lib" 
"-L/gnu/store/0irvg0gvvfwagdjckigvr4g8xap94y1j-clang-toolchain-18.1.5/lib" 
"hello.p/hello.cpp.o" "--as-needed" "--no-undefined" 
"-rpath=/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/lib" "-rpath" 
"/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "-rpath-link" 
"/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "--start-group" 
"/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib/libfmt.so" 
"--end-group" "-lstdc++" "-lm" "-lgcc_s" "-lgcc" "-lc" "-lgcc_s" "-lgcc" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/crtendS.o"
 "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib/crtn.o" "-rpath" 
"/gnu/store/qhz8n6mxzalifcrml6fwsvnxw92bk7n0-fmt-9.1.0/lib" "-rpath" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.."
 "-rpath" "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.."
 "-rpath" "/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib" "-rpath" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../..")

[…]

starting phase `shrink-runpath'
/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: stripping 
RUNPATH to ("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib") 
(removed ("/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/lib" 
"/gnu/store/l684qgqlrqkbsh8jffp9d8ag6vrpcwgs-gcc-11.3.0-lib/lib/gcc/x86_64-unknown-linux-gnu/11.3.0/../../.."))
phase `shrink-runpath' succeeded after 0.0 seconds
starting phase `validate-runpath'
validating RUNPATH of 1 binaries in 
"/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin"...
/gnu/store/g9wxj9a27jhnxa40zafh0ff33dd8906y-why-hello-0/bin/hello: error: 
depends on 'libfmt.so.9', which cannot be found in RUNPATH 
("/gnu/store/gsjczqir1wbz8p770zndrpw4rnppmxi3-glibc-2.35/lib")
--8<---------------cut here---------------end--------------->8---

So the ‘ld’ wrapper is indeed passing ‘-rpath /path/to/fmt’ but down the
road that gets lost.  Could it be that Meson removes it when it install
files?

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]