Open DaanA32 opened 7 months ago
Have you installed llvm
, too? pacman -S llvm
.
I have it installed... I'm not sure why it would try to link to missing libs. I've tried setting the clang-sys and bindgen to feature runtime, but that doesn't seem to work either.
sudo pacman -S llvm
[sudo] password for daan:
warning: llvm-16.0.6-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Package (1) Old Version New Version Net Change
extra/llvm 16.0.6-1 16.0.6-1 0.00 MiB
Total Installed Size: 102.03 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
I found https://bugs.archlinux.org/task/66283, so it seems we need to link to only libclang-cpp.so
instead of all of the individual libclang*.so
s. I think this happend in https://gitlab.archlinux.org/archlinux/packaging/packages/clang/-/commit/aaab40456297f626dfd60ad6632559c65d86bf6b. I'm not sure how package versions work on Arch; can you install an older version of the clang
package, or how can we detect which clang
package version it is so we can link to libclang-cpp.so
instead?
Hi kkysen,
I'll try finding / installing a version which does include the shared libs.
The list of all clang.*.so files from the default clang version installed on arch (x86_64) is: https://archlinux.org/packages/extra/x86_64/clang/files/
$ pacman -Ql clang | grep '\.so'
clang /usr/lib/libclang-cpp.so
clang /usr/lib/libclang-cpp.so.16
clang /usr/lib/libclang.so
clang /usr/lib/libclang.so.16
clang /usr/lib/libclang.so.16.0.6
I tried installing clang10, but that also is compiled with the same options.
I've not found an quick to install version with the BUILD_SHARED_LIBS=ON
yet.
I think providing a ENV or feature flag to know what to compile against should be sufficient.
Hi kkysen,
I've managed to fix building by doing the following:
export LLVM_LIB_DIR=/usr/lib
It looks like arch linux installs it to /usr/lib
instead of /usr/lib/llvmXX
I think build.rs
from c2rust-ast-export does not search /usr/lib
.
I've managed to fix building by doing the following:
export LLVM_LIB_DIR=/usr/lib
It looks like arch linux installs it to
/usr/lib
instead of/usr/lib/llvmXX
I thinkbuild.rs
from c2rust-ast-export does not search/usr/lib
.
If we just need to add /usr/lib/
to build.rs
's search path on top of /usr/lib/llvm*
, we should be able to do that. I can open a PR for that. Thanks for figuring that out!
Hi all,
I cannot build on arch linux, presumably due to only having
libclang.so
and not the other files.