fix: stop forwarding host RUSTFLAGS into RISC-V cross-compilation#32
fix: stop forwarding host RUSTFLAGS into RISC-V cross-compilation#32zouguangxian merged 2 commits intoLayerZero-Labs:mainfrom
Conversation
PR SummaryMedium Risk Overview Adds Written by Cursor Bugbot for commit fd9b239. This will update automatically on new commits. Configure here. |
RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS target the host compiler. Forwarding them into riscv64imac cross-compilation leaks host-specific flags like -C target-cpu=native and -C embed-bitcode=yes, which LLVM rejects with "RV64 target requires an RV64 CPU". Replace the RUSTFLAGS injection in build-syscall-cycles.sh with a new --no-machine-outliner flag on BuildArgs. The machine outliner disable is an internal correctness invariant of the cycle-counting tool, not a user-configurable knob, so it belongs in the build interface rather than the caller's environment. Also add ZEROOS_GUEST_RUSTFLAGS as an explicit opt-in escape hatch for callers that genuinely need to inject flags into the guest build. The name makes the target unambiguous and prevents accidental host flag leakage.
RUSTFLAGS and CARGO_ENCODED_RUSTFLAGS target the host compiler. Forwarding
them into riscv64imac cross-compilation leaks host-specific flags like
-C target-cpu=native and -C embed-bitcode=yes, which LLVM rejects with
"RV64 target requires an RV64 CPU".
Replace the RUSTFLAGS injection in build-syscall-cycles.sh with a new
--no-machine-outliner flag on BuildArgs. The machine outliner disable is
an internal correctness invariant of the cycle-counting tool, not a
user-configurable knob, so it belongs in the build interface rather than
the caller's environment.
Also add ZEROOS_GUEST_RUSTFLAGS as an explicit opt-in escape hatch for
callers that genuinely need to inject flags into the guest build. The
name makes the target unambiguous and prevents accidental host flag leakage.