Fix generic aarch64 Linux builds#97
Open
spital wants to merge 2 commits into
Open
Conversation
Keep the default aarch64-unknown-linux-gnu build portable by removing the hardcoded neoverse-512tvb Rust target CPU. Gate the matching rpmalloc C compiler flag behind LORE_AARCH64_NEOVERSE_512TVB so tuned release jobs can opt in explicitly. Update Docker docs now linux/arm64 builds no longer need the amd64 workaround. Test Plan: - cargo fmt --all --check - git diff --check - env -u LORE_AARCH64_NEOVERSE_512TVB cargo build - env -u LORE_AARCH64_NEOVERSE_512TVB cargo build --release - Ran debug and release --version checks for lore, loreserver, and lore_chaos_client - Ran release create/commit/push/clone/branch/merge/sync smoke test - Verified LORE_AARCH64_NEOVERSE_512TVB=1 passes -mcpu=neoverse-512tvb to cc in an isolated target dir Signed-off-by: spital <11034264+spital@users.noreply.github.com>
Signed-off-by: spital <11034264+spital@users.noreply.github.com>
Author
|
Fixed cargo clippy and nightly fmt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the default
aarch64-unknown-linux-gnubuild portable again byremoving the hardcoded Graviton3/Neoverse 512-bit vector tuning from the generic
aarch64 path.
Previously, two default build paths forced
neoverse-512tvbfor all Linuxaarch64 builds:
.cargo/config.tomlpassed-C target-cpu=neoverse-512tvbthrough Cargorustflags.
lore-base/build.rspassed-mcpu=neoverse-512tvbto the C compiler forrpmalloc.
That target assumes CPU features that are not present on many valid aarch64
Linux hosts. On this Cortex-A55 arm64 host, the Rust flag caused a build-script
SIGILL, and the C flag produced binaries that built successfully but failed at
runtime with an illegal instruction in rpmalloc.
The default aarch64 Linux build now uses the portable baseline. Release jobs
that intentionally build a Neoverse/Graviton tuned artifact can still opt in
without a custom target JSON:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGSreplacementincluding
-C target-cpu=neoverse-512tvb.LORE_AARCH64_NEOVERSE_512TVB=1so the rpmalloc C build receives-mcpu=neoverse-512tvb.This also removes stale Docker docs that required arm64 users to force
linux/amd64builds because of the previous hardcoded Graviton flags.Testing
Tested on a native aarch64 Linux host that lacks SVE:
cargo fmt --all --checkgit diff --checkenv -u LORE_AARCH64_NEOVERSE_512TVB cargo buildtarget/debug/lore --versiontarget/debug/loreserver --versiontarget/debug/lore_chaos_client --versionenv -u LORE_AARCH64_NEOVERSE_512TVB cargo build --releasetarget/release/lore --versiontarget/release/loreserver --versiontarget/release/lore_chaos_client --versionstart
loreserver, create a repository, stage/commit/push text and binaryfiles, create a shared store, clone a second worktree, branch, commit, merge,
push, sync the clone, and confirm both worktrees are in sync.
CC_ENABLE_DEBUG_OUTPUT=1 LORE_AARCH64_NEOVERSE_512TVB=1 cargo build -p lore-base -vvwith a temporary
CARGO_TARGET_DIR, verifying the C compiler command contains-mcpu=neoverse-512tvb.Stable
rustfmtprints existing warnings that the repo's unstable rustfmtoptions require nightly, but the formatting check completed successfully.