-
Notifications
You must be signed in to change notification settings - Fork 14k
[BOLT][AArch64] Fix PREL Relocs on RHEL8 #144505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Hey folks, We run into issues with this test on RHEL8. See details below. Where do these recent lit failures come from?You may have recently seen a few patches adjusting tests; a few more may follow. So here are their origins: Arm recently released Arm Toolchain for Linux (ATfL), which bundles compilers and tools for several platforms. Many colleagues have contributed to this effort, led by @pawosm-arm. BOLT will be packaged into ATfL, and the goal is to run nightly builds and tests on those platforms. Details of the failureIt appears to be some typo at this line:
Essentially has the same effect as:
What happens on non-RHEL8:On distributions other than RHEL8, lld proceeds as normal, ignores the missing symbol and emits:
Then, llvm-bolt succeeds, the PC-Relative relocations to 16/32/64 bit words are found, and the test passes. What happens on RHEL8:On RHEL-8, the linker aborts with error:
Fixing the typo lets the linker succeeds on any platform. However, because
For more, see PC-relative addressing (last bullet point) in the 5.7.9 Relocation optimization section of our ABI. This triggers
This happens because Next Steps:First, I'ld like to confirm whether this was indeed a typo. Given it is a typo, we can correct it and skip the lld optimization using Also, should we extend ADRRelaxation to handle the above case better? |
Out of interest, what flags are being passed to lld? I am surprised that lld ignores the missing symbol unless the driver is passing lld something like -z undefs or --shared. For example on my clang command line:
LLD (built from main branch alongside clang) is invoked as
With the -L just happpen to be the paths to a GCC cross compilation system on my x86_64 Ubuntu machine. I have to pass -Wl,-zundefs to get lld to link correctly. I don't think datable is weak either. If I add --shared I get:
|
Hey Peter, Yes, your assumption is correct,
Do you think there is an issue on RHEL8 not respecting |
@paschalis-mpeis based on the test header this test has to check only relocations, -Wl,--no-relax is acceptable. |
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.
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. |
No description provided.