Hi Guix,

after debugging this further, this appears to be an issue in either
Clang or Meson.

For context, Meson invokes the compiler with "--print-search-paths" to
establish which directories belong to the system, and also consults
pkg-config files for `-Wl,-rpath' and similar definitions.  The latter 
do not influence Meson whatsoever, as fmt merely communicates

--8<---------------cut here---------------start------------->8---
Libs: -L${libdir} -lfmt
--8<---------------cut here---------------end--------------->8---

so the former get to dictate the system rpath.

In GCC, the system search path includes LIBRARY_PATH (visible here
through $GUIX_ENVIRONMENT)
--8<---------------cut here---------------start------------->8---
install: /gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-gnu/15.2.0/
programs: =/gnu/store/pdsp8rhjj3vwjw01wv2555rfdxkgph7j-gcc-
15.2.0/libexec/gcc/x86_64-unknown-linux-
gnu/15.2.0/:/gnu/store/pdsp8rhjj3vwjw01wv2555rfdxkgph7j-gcc-
15.2.0/libexec/gcc/x86_64-unknown-linux-
gnu/15.2.0/:/gnu/store/pdsp8rhjj3vwjw01wv2555rfdxkgph7j-gcc-
15.2.0/libexec/gcc/x86_64-unknown-linux-
gnu/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-
gnu/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../../../../x86_64-unknown-linux-gnu/bin/x86_64-
unknown-linux-gnu/15.2.0/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-
gcc-15.2.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../../../../x86_64-unknown-linux-gnu/bin/
libraries: =$GUIX_ENVIRONMENT/lib/x86_64-unknown-linux-
gnu/15.2.0/:$GUIX_ENVIRONMENT/lib/../lib/:/gnu/store/xm7i1gvi0i9pyndlkv
627r08rsw1ny96-gcc-15.2.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../../../../x86_64-unknown-linux-gnu/lib/x86_64-
unknown-linux-gnu/15.2.0/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-
gcc-15.2.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../../../../x86_64-unknown-linux-
gnu/lib/../lib/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-gnu/15.2.0/../../../x86_64-unknown-
linux-gnu/15.2.0/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-
15.2.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../lib/:/gnu/store/yj053cys0724p7vs9kir808x7fivz17m
-glibc-2.41/lib/x86_64-unknown-linux-
gnu/15.2.0/:/gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-
2.41/lib/../lib/:$GUIX_ENVIRONMENT/lib/:/gnu/store/xm7i1gvi0i9pyndlkv62
7r08rsw1ny96-gcc-15.2.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../../../../../x86_64-unknown-linux-
gnu/lib/:/gnu/store/xm7i1gvi0i9pyndlkv627r08rsw1ny96-gcc-15.2.0-
lib/lib/gcc/x86_64-unknown-linux-
gnu/15.2.0/../../../:/gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-
2.41/lib/
--8<---------------cut here---------------end--------------->8---

In Clang OTOH, only a very basic search path is printed and environment
variables are not evaluated.
--8<---------------cut here---------------start------------->8---
programs: =/gnu/store/vlqbnsja44qiwlfclkksfixqbibh3pmv-clang-
21.1.8/bin:/gnu/store/lyk51h6jkdapjkbg0wxfxkjj5fq7aii4-gcc-14.3.0-
lib/lib/gcc/x86_64-unknown-linux-gnu/14.3.0/../../../../x86_64-unknown-
linux-gnu/bin
libraries: =/gnu/store/vlqbnsja44qiwlfclkksfixqbibh3pmv-clang-
21.1.8/lib/clang/21:/gnu/store/lyk51h6jkdapjkbg0wxfxkjj5fq7aii4-gcc-
14.3.0-lib/lib/gcc/x86_64-unknown-linux-
gnu/14.3.0:/gnu/store/yj053cys0724p7vs9kir808x7fivz17m-glibc-
2.41/lib:/gnu/store/lyk51h6jkdapjkbg0wxfxkjj5fq7aii4-gcc-14.3.0-
lib/lib/gcc/x86_64-unknown-linux-gnu/14.3.0/../../..
--8<---------------cut here---------------end--------------->8---

So the solution would probably be to consult LIBRARY_PATH either in
Clang or in Meson.  WDYT?

Cheers



Reply via email to