-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Building fails on alpine: "libclang.so could not be opened: Dynamic loading not supported" #724
Comments
Note: The segfault only occurs when using cargo / rust from Note that And yes, this is very much possible: I was once debugging an issue where two incompatible I think it may be possible that something similar happens here when the build succeeds without disabling the |
This is btw. the backtrace with debug symbols in
I get the exact same backtrace when building RIOT apps from the However, the issues with forcing static linking of |
$ export RUSTFLAGS=-Ctarget-feature=-crt-static fixes the issue with the Update: It fixes the segfault. It doesn't fix the issue that |
I've tried installing c2rust on Alpine Linux, and run into build failures that could not be fixed just by adding new packages.
Reproducing
by means of Docker (but should be the same on any other virtualization or native):
The second apk line is not needed immediately, but at later stages after applying a patch.
(Alternatively, build from git -- same result).
Output
Further references
There is ongoing work to package c2rust for alpine, and @maribu has experimental fixes in a patch at https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/41287/diffs#diff-content-e7a5df424a0722085783354ec4640b08da0b9312 (essentially, building the bindgen dependency statically). When applying these, building continues a bit further (the second
apk add
line above installed the relevant dependencies), but then segfaults -- possibly due to statically and dynamically linked symbols being present at the same time. Maybe what it'd need here is a more general switch that makes everything either staticlally or dynamically linked, but I don't know how complicated that'd be.(By the way, the referenced patches also manually apply the latest fixes to LLVM-15 (which can be dropped once #690 is done hint hint); the package aims at the edge release of alpine, whereas the above reproducing lines work on Alpine 3.16, which still has clang 13.)
wasmer had similar troubles at wasmerio/wasmer#1766 and fixed them differently in wasmerio/wasmer@5962d3f. Maybe that's a more fruitful approach, but I haven't really found out whether that's a real fix or it just disables something that'd break on musl.
The text was updated successfully, but these errors were encountered: