You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that clang-rs does not search for libraries in the environment variable LIBRARY_PATH during execution of the build.rs script.
I am using GUIX (like NIX) and my library path is /gnu/store/qb41j953iam58gj3cwsz9jlnnfn25cwa-profile/lib.
In that folder there is a libclang and libLLVM etc.
But it seems that the build.rs script is instead linking with the libclang and libllvm that is present in /lib/x86_64-linux-gnu/.
This leads to all sorts of linker errors, see snippet below:
= note: ld: /lib/x86_64-linux-gnu/libedit.so.2: undefined reference to `__isoc23_wcstol@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `arc4random@GLIBC_2.36'
ld: /lib/x86_64-linux-gnu/libbsd.so.0: undefined reference to `__isoc23_strtoimax@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `__isoc23_strtoull@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `__isoc23_sscanf@GLIBC_2.38'
ld: /usr/lib/llvm-17/lib/libclang-17.0.6.so: undefined reference to `__isoc23_strtoul@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `std::condition_variable::wait(std::unique_lock<std::mutex>&)@GLIBCXX_3.4.30'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `fmodf@GLIBC_2.38'
ld: /usr/lib/llvm-17/lib/libclang-17.0.6.so: undefined reference to `__isoc23_strtol@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `fmod@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `__isoc23_scanf@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libbsd.so.0: undefined reference to `__isoc23_strtoumax@GLIBC_2.38'
ld: /lib/x86_64-linux-gnu/libLLVM-17.so.1: undefined reference to `__isoc23_strtoll@GLIBC_2.38'
If LIBRARY_PATH is set, the build.rs script should search for libclang and similar in all the paths specified there, before it looks anywhere else. This is compatible with how gcc works.
The text was updated successfully, but these errors were encountered:
It seems that clang-rs does not search for libraries in the environment variable LIBRARY_PATH during execution of the build.rs script.
I am using GUIX (like NIX) and my library path is
/gnu/store/qb41j953iam58gj3cwsz9jlnnfn25cwa-profile/lib
.In that folder there is a
libclang
andlibLLVM
etc.But it seems that the
build.rs
script is instead linking with the libclang and libllvm that is present in/lib/x86_64-linux-gnu/
.This leads to all sorts of linker errors, see snippet below:
Why fix this?
The
LIBRARY_PATH
variable is a convention established bygcc
, and it makes sense to follow it.See here https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html#index-LIBRARY_005fPATH
How to fix this:
If
LIBRARY_PATH
is set, thebuild.rs
script should search forlibclang
and similar in all the paths specified there, before it looks anywhere else. This is compatible with howgcc
works.The text was updated successfully, but these errors were encountered: