Skip to content

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Oct 24, 2025

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. I learned that here.

Closes #83989

try-job: aarch64-gnu

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 24, 2025
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
@Enselic
Copy link
Member Author

Enselic commented Oct 24, 2025

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Oct 24, 2025
tests/ui/sanitizer/hwaddress.rs: Run on aarch64 and remove cgu hack

try-job: aarch64-gnu
@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

---- [ui] tests/ui/sanitizer/hwaddress.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sanitizer/hwaddress/hwaddress.stderr`
normalized stderr:
warning: unknown and unstable feature specified for `-Ctarget-feature`: `tagged-globals`
   |
   = 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
   = help: consider filing a feature request

warning: 1 warning emitted
---
To only update this specific test, also pass `--test-args sanitizer/hwaddress.rs`

error: 1 errors occurred comparing output.
status: exit status: 0
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui/sanitizer/hwaddress.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui/sanitizer/hwaddress/a" "-A" "unused" "-W" "unused_attributes" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Lnative=/checkout/obj/build/aarch64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "sanitizer=hwaddress" "-O" "-g" "-C" "target-feature=+tagged-globals" "-C" "unsafe-allow-abi-mismatch=sanitizer"
stdout: none
--- stderr -------------------------------
warning: unknown and unstable feature specified for `-Ctarget-feature`: `tagged-globals`
   |
   = 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
   = help: consider filing a feature request

warning: 1 warning emitted

@rust-bors
Copy link

rust-bors bot commented Oct 24, 2025

💔 Test for 8af5644 failed: CI. Failed jobs:

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

Labels

PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI test sanitize/hwaddress.rs fails with linker error on aarch64 when executed with 1 CGU

3 participants