[llvm] [BOLT][AArch64] Fix PREL Relocs on RHEL8 (PR #144505)
Peter Smith via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 17 12:22:19 PDT 2025
smithp35 wrote:
> Hey Peter,
>
> Yes, your assumption is correct, `-Wl,--unresolved-symbols=ignore-all` is passed. Full command line:
>
> ```
> clang --target=aarch64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -Wl,--build-id=none -pie --target=aarch64-unknown-linux-gnu -nostartfiles -nostdlib -ffreestanding -nostartfiles -nostdlib bolt/test/AArch64/r_aarch64_prelxx.s -o build/tools/bolt/test/AArch64/Output/r_aarch64_prelxx.s.tmp.exe -mlittle-endian -Wl,-q -Wl,-z,max-page-size=4
> ```
>
> Do you think there is an issue on RHEL8 not respecting `--unresolved-symbols`? Unsure if `-Wl,-zundefs` would have worked there.
The code-path will be the same. I don't think it will have made a difference. Using an older ld.lld on my system rather than one I've just built (lld from llvm-14) I get the same error message as on RHEL8. I think it is just an older lld being used.
`--no-relax` was added in 2021. That's old enough for my llvm14 lld to accept it. May be worth checking RHEL8 as that might predate the option.
This does highlight a potential problem with these tests that you may be able to solve by requiring an lld built from source at the same time as BOLT or setting a REQUIRES minimum lld version. For example lets say a new lld version does some additional optimisations, under a new flag not accepted by older lld versions so it can't be used to turn them off; then you may find that there's no way to avoid different linker output from affecting your tests.
https://github.com/llvm/llvm-project/pull/144505
More information about the llvm-commits
mailing list