[aarch64] Regression with BTI after nightly-2022-08-14 #102162
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
regression-from-stable-to-nightly
Performance or correctness regression from stable to nightly.
requires-nightly
This issue requires a nightly compiler in some way.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Enabling
-Zbranch-protection=bti
on rustc (nightly-2022-08-14) doesn't generate staticlibraries or cdylib anymore. This happens after the LLVM 14 to LLVM 15 change as bisected below cargo-bisect-rustc where LLVM-15 sets thebranch-target-enforcement
flag only for the module being compiled. Even with-Z build-std
this build fails as there is a module without a name that doesn't havebranch-target-enforcement
set.Earlier in
nightly-2022-08-12
BTI works even without requiring the-Z build-std
The way I'm reproducing this (patch attached to make this easier) is by:
cargo new --lib bti
#[lib] crate-type = ["staticlib"]
in Cargo.tomlRUSTFLAGS="-C embed-bitcode -C lto -Z branch-protection=bti" cargo +nightly-2022-08-14 build --release --target aarch64-unknown-linux-gnu
Meta
Working in -- nightly-2022-08-12
rustc --version --verbose
:First failing in -- nightly-2022-08-14
rustc --version --verbose
This issue persists even in the latest build
nightly-2022-09-21
Error output
Backtrace
How to reproduce:
reproduce.sh
llvm-ir
folders generated in thenon-working
andworking
foldersLLVM-IR for working:
LLVM-IR regressed:
cargo-bisect-rustc
searched nightlies: from nightly-2022-08-12 to nightly-2022-08-14
regressed nightly: nightly-2022-08-13
searched commit range: 20ffea6...f22819b
regressed commit: e2b52ff
bisected with cargo-bisect-rustc v0.6.4
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
The text was updated successfully, but these errors were encountered: