Skip to content
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

Add aarch64 to ubuntu release #9

Closed
hn8 opened this issue Feb 8, 2024 · 5 comments
Closed

Add aarch64 to ubuntu release #9

hn8 opened this issue Feb 8, 2024 · 5 comments

Comments

@hn8
Copy link

hn8 commented Feb 8, 2024

Would you please consider adding aarch64 binary release for linux VM running on Apple Silicon without rosetta2? Thanks

@bolinfest
Copy link
Contributor

If you build DotSlash from source on that Linux VM right now, does it work?

But yes, we should be able to provide ARM Ubuntu release builds pretty easily.

@bolinfest
Copy link
Contributor

Hmm, this is going to be a bit harder than I thought since GitHub does not seem to provide these runners by default yet:

actions/runner-images#2536

On my Ubuntu 20.04 machine, I tried updating Cargo.toml to include:

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

and did:

sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev-arm64-cross

but the build fails with:

          /usr/bin/ld: /home/mbolin/src/dotslash/target/aarch64-unknown-linux-gnu/debug/deps/dotslash-1106e55710a63aa1.11827l57e7qgx8lz.rcgu.o: error adding symbols: file in wrong format

Based on the articles I've found, my best guess is that something in the transitive deps of DotSlash has some build step that is outside of Cargo (so a build.rs) that is likely producing x86_64 artifacts instead of ARM64 ones, which don't link.

@dtolnay any suggestions?

@bolinfest
Copy link
Contributor

Incidentally, this does not match anything:

find target/aarch64-unknown-linux-gnu/ -name \*.o | xargs -I {} file {} | grep -v ARM

@dtolnay
Copy link

dtolnay commented Feb 8, 2024

This builds successfully for me from Ubuntu: CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc cargo build --target aarch64-unknown-linux-gnu --release

@bolinfest
Copy link
Contributor

Hmm, that works for me as well. I saw a comment somewhere that maybe I needed to update .cargo/config.toml instead of Cargo.toml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants