-
Notifications
You must be signed in to change notification settings - Fork 13k
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
linking with cc
failed on AArch64 with aarch64-unknown-linux-musl
target
#73493
Comments
I have had a look into this and I have managed to get it building with musl. I think you have to add the musl-gcc specs file to the link_arg, as you are running this on a glibc distro.
Once I did this I started getting errors that libfdt couldn't be found, when I built libfdt using musl-gcc and copied libfdt to I might be missing something here but I can't see where |
What if you try to use AArch64 linker instead? |
Hi @JamieCunliffe Great thanks for your effort! It works perfectly! I probably need to think about the reason why it works. If there is anything else, I may probably contact you :)
@mati865 I also tried your method but sadly this cannot work :( Thanks for your reply anyway ^^ |
Closing this issue as it has been fixed. |
I was trying to build a rust-based binary with cargo in docker container on AArch64, however an
undefined reference to symbol
error occurs when using musl target. Any help would be greatly appreciated, thanks!Note that the binary can be successfully built with GNU toolchain on AArch64, and also the AArch64 binary can be successfully cross-built with both GNU and musl toolchain on x86_64.
Building Environment:
A docker container from this Dockerfile.
Rust toolchain version:
1.43.0
Building command:
RUSTFLAGS="-C link_arg=-lgcc" cargo build --release --target aarch64-unknown-linux-musl --no-default-features --features mmio
The reason why adding
link_arg=-lgcc
is to resolve #46651 (comment)Error log:
The text was updated successfully, but these errors were encountered: