Skip to content

Fix generic aarch64 Linux builds#97

Open
spital wants to merge 2 commits into
EpicGames:mainfrom
spital:fix-aarch64-generic-build
Open

Fix generic aarch64 Linux builds#97
spital wants to merge 2 commits into
EpicGames:mainfrom
spital:fix-aarch64-generic-build

Conversation

@spital

@spital spital commented Jul 2, 2026

Copy link
Copy Markdown

Summary

This PR makes the default aarch64-unknown-linux-gnu build portable again by
removing the hardcoded Graviton3/Neoverse 512-bit vector tuning from the generic
aarch64 path.

Previously, two default build paths forced neoverse-512tvb for all Linux
aarch64 builds:

  • .cargo/config.toml passed -C target-cpu=neoverse-512tvb through Cargo
    rustflags.
  • lore-base/build.rs passed -mcpu=neoverse-512tvb to the C compiler for
    rpmalloc.

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:

  • Set a full CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS replacement
    including -C target-cpu=neoverse-512tvb.
  • Set LORE_AARCH64_NEOVERSE_512TVB=1 so the rpmalloc C build receives
    -mcpu=neoverse-512tvb.

This also removes stale Docker docs that required arm64 users to force
linux/amd64 builds because of the previous hardcoded Graviton flags.

Testing

Tested on a native aarch64 Linux host that lacks SVE:

  • cargo fmt --all --check
  • git diff --check
  • env -u LORE_AARCH64_NEOVERSE_512TVB cargo build
  • target/debug/lore --version
  • target/debug/loreserver --version
  • target/debug/lore_chaos_client --version
  • env -u LORE_AARCH64_NEOVERSE_512TVB cargo build --release
  • target/release/lore --version
  • target/release/loreserver --version
  • target/release/lore_chaos_client --version
  • Release binary smoke test:
    start loreserver, create a repository, stage/commit/push text and binary
    files, create a shared store, clone a second worktree, branch, commit, merge,
    push, sync the clone, and confirm both worktrees are in sync.
  • Isolated opt-in check:
    CC_ENABLE_DEBUG_OUTPUT=1 LORE_AARCH64_NEOVERSE_512TVB=1 cargo build -p lore-base -vv
    with a temporary CARGO_TARGET_DIR, verifying the C compiler command contains
    -mcpu=neoverse-512tvb.

Stable rustfmt prints existing warnings that the repo's unstable rustfmt
options require nightly, but the formatting check completed successfully.

spital added 2 commits July 2, 2026 15:47
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>
@spital

spital commented Jul 6, 2026

Copy link
Copy Markdown
Author

Fixed cargo clippy and nightly fmt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant