-
-
Notifications
You must be signed in to change notification settings - Fork 470
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
invalid relocation for non-allocated sections: R_X86_64_GOTPC64 #1003
Comments
Thank you for your report! This should be fixed in mold. I'll make a change to support that relocation type. |
On second thought, it is odd that a debug section contains a PC-relative relocation because the notion of PC-relative doesn't make sense for non-memory-mapped section. Can you upload your |
Absolutely. The version checked in to our repository has this issue. It's very old and built in Debian 9, but gives the same error. It's available here. But I'll also upload a freshly built one that has the same issue but built on a newer build container (Debian 10). For comparison I'll also upload this one built in the same container from the exact same Makefile and source code, but with clang: |
Can you also run the final link command with |
Github will only allow me to upload 25 MiB files, and this repro tar achive is 1.3 GiB (~150MiB when compressed).... And I can't push it to a temporary git branch either because there files can only be 100 MiB... I'll sort this out somehow. |
Here we go! The extra layer of zip is just because that's the only format Github allowed 😅 mullvad_daemon-96dd93fc4006358c.repro.tar.xz.zip EDIT: I should probably also mention my mold version:
|
This is apparently a bug of an old version of GCC. According to its |
The build I uploaded the repro from is indeed very old. We have not had any reason to rebuild I can create a new repro build with the 8.3.0 build if you think that makes a difference. But it would be awesome if mold would support the newest GCC supported by Debian 10 (it's still supported, albeit in LTS now) |
Does the above change work for you? |
Interesting. This actually solves it for that specific version of Here is my repro for the failing build using mullvad_daemon-4eecad6dfc3f04fb.repro-gcc8.3.0.tar.xz Thank you so much for paying attention to this gcc issue :) |
Can you paste the new error message? It should be different from the previous one. |
I should not have trusted my eyes. I thought it looked the same, but it is indeed a different one! |
Should be fixed in the above change. |
This works! Thank you so much! |
update to the commit that fixes this issue, rui314/mold#1003 current commit points to version that does not contain fix. the issue was reopened after the commit detailing an issue that was unresolved, this commit contains that fix
I'm trying to switch over to
mold
for linking our Rust projects at https://github.com/mullvad/mullvadvpn-app/. But I get the following error when building Rust binaries that pull in our static library archive forlibnftnl
:I can avoid the error and link fine if I rebuild
libnftnl.a
with either gcc or clang directly on my Fedora development machine (gcc 12.2.1 and clang 14.0.5) or with clang in our Debian 10 based build container (clang version 7.0.1-8+deb10u2). However, buildinglibnftnl.a
with gcc in the Debian 10 build container (gcc version 8.3.0)) is what triggers the error above.Is the only recommended solution simply to use clang / upgrade the build environment, or is this issue fixable in
mold
in some way that allows us to continue building with gcc on Debian 10? I would prefer to not have to change compiler just for this, if possible.Here is the
Makefile
used for buildinglibnftnl
. And here is the container definition.Thank you for an amazingly fast linker <3
The text was updated successfully, but these errors were encountered: