-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
any ld.exe from binutils > v2.30 is broken #6107
Comments
You need to provide a recipe to reproduce the problem based on publicly available resources. It is very important that the recipe is as simple as possible. See for example this for some good advice.
|
By saying broken I meant buggy of course. |
binutils has been updated, maybe give the new version a try. |
Thank you for the info, I will give it a try. |
KeePassXC is experiencing this same problem with binutils 2.34. Just downgraded to 2.33 and the problem went away immediately. To reproduce simply checkout our repository (develop branch) and build keepassxc-proxy ( https://github.com/keepassxreboot/keepassxc I narrowed down the fault to the combination of linker parameters: |
@droidmonkey I experienced the same linker error for some but not all keepassx unit tests. |
A recent fresh install of MSYS2 did not exhibit these problems, I think this can be closed. |
For me its still a problem without the additional linker flag mentioned above. |
I have the same problem. |
v2.35 still have the problem |
That's very odd. There was a change in binutils 2.34 which should have made I recently authored a patch against binutils upstream to make dynamicbase, nxcompat, and high-entropy-va (on x64) the default, and this project is currently in the process of enabling those flags and testing for breakage in packages. Hopefully this will help suss out any issues with them. Whatever is going on in this issue (and it may be several different things that just happen to result in ld failing with error code 5), sounds like an issue in binutils upstream and not in the packaging of binutils here. |
There was just a discussion on gitter which revealed that upstream cmake attempts to create executables with -Wl,--out-implib and that that is failing now with --enable-reloc-section enabled, which is now enabled by default, and was enabled with -Wl,--dynamicbase as of 2.34 IIRC. And -Wl,--export-all-symbols does work around it. So it sounds like attempting to create an import library while linking an executable with a relocation section but no exported symbols fails with exit code 5. |
Hey @jeremyd2019 The patch to cmake predates adding this switch so this has been an issue forever AFAIR! I'll add a link to your comment to my PR later though anyway. |
Pasting my comment from CMake pull request:
Backtrace is not useful since all debug info has been stripped:
|
Interesting. Might want to report that to binutils bugzilla. I'm going to try to get a symbolicated backtrace at least, maybe I can find a simple patch for it. |
|
@jeremyd2019 should we patch this downstream for now? |
Just wondering. As we are importing many patches from upstream, how about using a git commit as source tarball for binutils? |
I was wondering the same thing. Was trying to have a little patience for upstream to get to the bug. If you like I can make another PR.
Are you talking about an upstream git commit, with whatever other changes might be pending for 2.36, or a branch on a fork with the desired patches cherry-picked on top of 2.35? |
Fixes msys2#6107 (most of the comments at least). Also, added another upstream test patch, and turned my last patch into a git-format one.
Fixes msys2#6107 (most of the comments at least). Also, added another upstream test patch, and turned my last patch into a git-format one.
Fixes msys2#6107 (most of the comments at least). Also, added another upstream test patch, and turned my last patch into a git-format one.
Fixes msys2#6107 (most of the comments at least). Also, added another upstream test patch, and turned my last patch into a git-format one.
I wish gcc/ld gave a better indication of a crash than 'exited with code 5'. When ld was run directly rather than through gcc I saw "Segmentation fault" printed, but I could not figure out how to get it to trigger the Windows JIT debugger. Something must be catching the exception and printing "Segmentation fault", but I couldn't find it (keeping in mind this is mingw not msys/cygwin, where there's error_start). |
Hello,
I found that any
ld.exe
from binutils > v2.30 is broken and returns ld returned 5 exit status error code. So I have tried to downloadmingw-w64-i686-binutils-2.30-6-any.pkg.tar.xz
from msys2 repo http://repo.msys2.org and replaced the installedld.exe
with the downloaded one, this times it compiled and linked without problems.My code is very big to share it so you can reproduce it yourself. My code requires at least wxWidgets v3.1.3 to build.
What can I do make you believe that any version > v2.30 is really broken!? Because it is working without problems for small projects and makes you believe it is working properly.
Thank you in advance.
The text was updated successfully, but these errors were encountered: