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
Internal linker (LLD) produces crashing executable on Windows #2823
Comments
I'd guess so too. We don't treat LLD any different than the MS linker - codegen is the same, even the linker command-line arguments are. Just to rule out it has anything to do with our integration, you could use the The size seems to be around 50K; does 32K happen to be the magic threshold? |
The results are the same for I noticed that |
Submitted the LLVM bug https://bugs.llvm.org/show_bug.cgi?id=38645 |
Thx; you'll probably have more luck/responses with an object file, ideally minimized to a betterC version, so that the guys can link themselves and debug what's wrong. |
@rracariu: From the LLD 7 release log:
I tested the code above with LLVM 7, and it works for me. You can give it a shot yourself with https://github.com/ldc-developers/llvm/releases/download/CI/llvm-7.0.0-windows-x64-withAsserts.7z (e.g., |
@kinke I can confirm it works here with ldc 1.11.0 and the linker form LLVM7. Thanks for the update! |
You may want to close this (v1.12-beta2 with LLVM 7 just released) and the LLD bug then. |
On Windows using the
-link-internally
makes the following program crash (segmentation fault).This crashes both under
LDC 1.10.0
andLDC 1.11.0
when building for Windows X86-64, the X86 32 bit variant doesn't crash.Linking with the system linker produces a working executable.
The bug is strange, it is related to the size of the enum string - shortening that makes the crash go away. This looks like a
lld
bug, but I want to get some input from LDC experts on why this bug exists so we can point the issue to the LLVM team. I'm suspecting the way data segments are linked is having issues with larger constants (see bottom with the sections report).Sections info as reported by https://github.com/zodiacon/PEExplorer
The text was updated successfully, but these errors were encountered: