chore(arm64): make the BPF build arch-aware for aarch64 - #63
Open
tattoosonmyskin wants to merge 1 commit into
Open
chore(arm64): make the BPF build arch-aware for aarch64#63tattoosonmyskin wants to merge 1 commit into
tattoosonmyskin wants to merge 1 commit into
Conversation
Prep for running Jinn Guard on arm64. Nothing here changes x86 output (ARCH still resolves to `x86` on x86_64, verified), it just stops the build from hardcoding x86 so an aarch64 host builds without manual flags. - bpf/Makefile: derive ARCH from `uname -m` (x86_64->x86, aarch64->arm64), overridable with `make ARCH=...`; defaults to x86 for unknown machines. Add a `regen-vmlinux` target: the committed bpf/vmlinux.h is x86-generated (vendored so CI can compile without BTF), so a foreign-arch build must regenerate it from local BTF. - scripts/validate_m2_path_resolution.sh, scripts/run_professor_validation.sh: derive -D__TARGET_ARCH_ from the host instead of hardcoding _x86. - rust-toolchain.toml: add aarch64-unknown-linux-gnu to the target list. Does not touch the x86-hosted CI compile-gate. Real on-board bring-up (BTF gate, runner registration, kernel_lsm validation) is tracked in the internal arm64 bring-up runbook and still needs the hardware. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR makes the eBPF (BPF-LSM) build and validation flow architecture-aware so the project can be built on arm64/aarch64 hosts without manually editing flags, while preserving the existing x86_64 behavior.
Changes:
- Derive the kernel-style BPF arch name (
x86vsarm64) fromuname -min the BPF Makefile (withARCHstill overridable viamake ARCH=...). - Update validation scripts to pass
-D__TARGET_ARCH_${arch}instead of hardcoding__TARGET_ARCH_x86. - Add
aarch64-unknown-linux-gnuto the Rust toolchain target list.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
bpf/Makefile |
Makes ARCH host-derived (x86_64→x86, aarch64→arm64) and adds a regen-vmlinux helper target for local BTF regeneration. |
scripts/validate_m2_path_resolution.sh |
Uses host-derived __TARGET_ARCH_* define when compiling BPF LSM objects during validation. |
scripts/run_professor_validation.sh |
Uses host-derived __TARGET_ARCH_* define when compiling/installing BPF LSM objects in Tier 4. |
rust-toolchain.toml |
Adds the aarch64 Linux target to the pinned toolchain configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Prep for running Jinn Guard on arm64. No change to x86 output —
ARCHstill resolves tox86onx86_64(verified:ARCH=[x86] UNAME_M=[x86_64]), and an LSM object still compiles identically. This just stops the build hardcoding x86 so an aarch64 host builds without manual flags.bpf/Makefile: deriveARCHfromuname -m(x86_64->x86,aarch64->arm64), overridable withmake ARCH=..., defaulting tox86for unknown machines. Adds aregen-vmlinuxtarget — the committedbpf/vmlinux.his x86-generated (vendored so CI compiles without BTF), so a foreign-arch build regenerates it from local BTF.scripts/validate_m2_path_resolution.sh,scripts/run_professor_validation.sh: derive-D__TARGET_ARCH_from the host instead of hardcoding_x86.rust-toolchain.toml: addaarch64-unknown-linux-gnuto the target list.Does not touch the x86-hosted CI compile-gate (correct as-is). Real on-board bring-up (BTF gate, runner registration,
kernel_lsmvalidation) still needs the aarch64 hardware and is tracked in the internal bring-up runbook.🤖 Generated with Claude Code