-
Notifications
You must be signed in to change notification settings - Fork 71
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
aarch64 build error: linker aarch64-linux-gnu-gcc
not found
#190
Comments
We build the aarch release through cross compile, the details can be found at https://github.com/tensorchord/pgvecto.rs/blob/main/.github/workflows/release.yml#L82-L116. Also we have binary arm release at if needed. |
Can you try with |
I am on Arch Linux and trying to use the toolchains provided by rustup. Also tried to cross-compile on host x86_64 for aarch64 target.
Interestingly, rustup doesn't provide a
I guess the deb package |
Do you have |
Yes, that would be there on x86_64. But using this cross-toolchain instead of the toolchain(s) provided by rustup would mean I have to always cross-compile. Is the toolchain hard-coded somewhere? In my understanding cargo natively should do just the right thing, and if you want to cross-compile, download and use the one you specify with the EDIT: Installed this toolchain and it now at least finds the cross-compile toolchain. But it seems to ignore the --target option all together. Not a very satisfying situation. Where can I change it? I really don't understand the purpose of the
Here the right supported rustup toolchains are specified but it seems they are overridden with |
Line 12 in 9e46faa
|
Cargo does always find the system linker for cross compilation if you do not specify one so we add this line to make cross compilation work. Probably we need find the right linker and set the environment variable in |
Why is it not possible to pull the right rustup toolchain in your docker image for cross-compilation instead of installing the extra Ubuntu deb package? |
It's possible. However, building in Docker with qemu-aarch64 is too slow. |
On Arch Linux Arm the gcc compiler is called
|
It's necessary for cross compilation from x86_64 to aarch64. Not only for Rust, if you cross compiles with clang, you still need to install these deb packages. |
Thanks @usamoi for pointing this out. After deleting .cargo/config the native compiler is being picked up now. |
I try to compile pgvecto.rs natively on Arch Linux Arm aarch64 and cargo selects the wrong linker. Instead of
aarch64-unknown-gnu-gcc
it tries to findaarch64-linux-gnu-gcc
, which does not exist.I followed the installation instructions as close as possible. Installed clang:
the default toolchain using rustup and cargo-pgrx:
initialized cargo-pgrx to use the host postgresql instance:
Then I tried to compile pgvecto.rs (first deleted the rust_toolchain.toml file to not pull in all the other toolchains):
output:
Any ideas where cargo picks up the toolchain to use and how to fix it?
To me it looks as if I am attempting to cross-compile for aarch64, although this is a native compile on the target host.
The text was updated successfully, but these errors were encountered: