-
Notifications
You must be signed in to change notification settings - Fork 13.5k
bolt: fails to build with /usr/bin/ld.gold: internal error in do_layout, at ../../gold/object.cc:1939
#57545
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
Comments
@llvm/issue-subscribers-bolt |
Can you re-link the output with Having the gold version information will be useful, too. |
Of course, it works with lld ;) gold version (debian testing)
|
Hi @sylvestre, Thank you for flagging. It's a known problem that gold linker doesn't support emit-relocs together with icf. Merge-fdata binary is linked with relocs for one BOLT test. You can disable tests for your build with I guess we can try to detect the host linker and disable that particular test if the linker is gold. |
This is https://sourceware.org/bugzilla/show_bug.cgi?id=25968 With |
As I am building with stage2, maybe we could use lld to do the linking ? |
Not ideal but this skips the issue:
|
Yes, I think adding |
Hello, Any news from the LLVM maintainers of bolt ? The problem is still present
@sylvestre seems to have solved it the hard way in the debian build script (https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/snapshot/debian/patches/bolt-disable-emit-relocs.patch). |
The problem falls squarely on gold linker, see Fangrui's comment above. We add emit-relocs to this secondary tool for testing purposes, under BOLT_INCLUDE_TESTS cmake variable. If fixing the linker is not a priority, there are several ways to work around the issue, with the one used in debian build script being quite acceptable. One can also simply disable BOLT_INCLUDE_TESTS, or disable gc-sections during the build. |
Thank for the response. The binutils linker issue seems pretty old now (at least 17 yo) so I guess it will remain that way forever. |
Trying to build bolt in 15 rc3:
The text was updated successfully, but these errors were encountered: