Skip to content

Commit c4747ea

Browse files
authored
Rollup merge of rust-lang#148057 - Enselic:hwasan-fix-v2, r=nagisa
tests/ui/sanitizer/hwaddress.rs: Run on aarch64 and remove cgu hack To avoid linker errors like relocation truncated to fit: R_AARCH64_ADR_PREL_PG_HI21 against `.data.rel.ro..L.hwasan' we need to have `-C target-feature=+tagged-globals`, which is documented [here](https://doc.rust-lang.org/beta/unstable-book/compiler-flags/sanitizer.html#hwaddresssanitizer). I learned that [here](llvm/llvm-project#164876 (comment)). Closes rust-lang#83989 try-job: aarch64-gnu
2 parents 5c31f33 + 38a1790 commit c4747ea

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/ui/sanitizer/hwaddress.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
//@ needs-sanitizer-support
22
//@ needs-sanitizer-hwaddress
33
//
4-
// FIXME(#83706): this test triggers errors on aarch64-gnu
5-
//@ ignore-aarch64-unknown-linux-gnu
6-
//
7-
// FIXME(#83989): codegen-units=1 triggers linker errors on aarch64-gnu
8-
//@ compile-flags: -Z sanitizer=hwaddress -O -g -C codegen-units=16 -C unsafe-allow-abi-mismatch=sanitizer
4+
//@ compile-flags: -Z sanitizer=hwaddress -O -g -C target-feature=+tagged-globals -C unsafe-allow-abi-mismatch=sanitizer
95
//
106
//@ run-fail
117
//@ error-pattern: HWAddressSanitizer: tag-mismatch
@@ -19,3 +15,5 @@ fn main() {
1915
let code = unsafe { *xs.offset(4) };
2016
std::process::exit(code);
2117
}
18+
19+
//~? WARN unknown and unstable feature specified for `-Ctarget-feature`: `tagged-globals`
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
warning: unknown and unstable feature specified for `-Ctarget-feature`: `tagged-globals`
2+
|
3+
= note: it is still passed through to the codegen backend, but use of this feature might be unsound and the behavior of this feature can change in the future
4+
= help: consider filing a feature request
5+
6+
warning: 1 warning emitted
7+

0 commit comments

Comments
 (0)