Trying to build DFeed using DMD git head results in an OPTLINK crash. Steps to reproduce: 1) Build DMD/Druntime/Phobos from latest Git 2) Clone https://github.com/CyberShadow/DFeed and its submodules (ae) 3) rdmd --build-only -version=WindowsXP dfeed_web.d I'm not going to even reduce this one unless there's an indication that someone is going to look at it (it literally takes days, and my previous OPTLINK report was ignored).
Why is this a regression? The linker hasn't changed.
It is a regression if you consider Optlink to be just an internal component of DMD "as a whole". Yes, it technically might not be a new bug, just a bug that didn't show up before. But the point is that code which compiled fine in previous versions would break if a new release was made right now.
The problem still exists in the DMD 2.060 release. The problem seems to be triggered by some code in a library. I can't build many of my projects with DMD 2.060 on Windows, which includes DFeed.
*** Issue 8501 has been marked as a duplicate of this issue. ***
I'm facing the same problem with DMD 2.060 when taking address of constant from module that was compiled into static library. It seems to be directly related to number (or total size, probably) of constants in that module. Looks like having too many constants causes bad code generation. DMD 2.059 - no such problem.
Can someone please provide a zip with just the obj files and the linker command? I don't need the source code.
Created attachment 1134 [details] A troublesome object file Running either "dmd file.obj" or "link file.obj" triggers the error.
ok, I can duplicate the problem with this .obj file.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a7c8c120e8b69651de6524d28006498eb4a2e2bd attempt to narrow down Issue 8377
It looks like a corrupt .obj file. Can anyone add this diagnostic to cgobj.c, build dmd, and then see if the source that causes it can be isolated?
It's this file: http://svn.dsource.org/projects/bindings/trunk/win32/winnt.d
Created attachment 1135 [details] Reduced source Here is the reduced file that triggers the new assert. "dmd winnt.d" by itself triggers it.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fb0483e8a0d5492393b794e095e272f81b32ac89 fix Issue 8377 - Unexpected OPTLINK Termination at EIP=004106BE
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/5446febb6b41b952eb93e24808ae3da03e6caab7 fix Issue 8377 - Unexpected OPTLINK Termination at EIP=004106BE
This is definitely a regression in the compiler, where it puts out a corrupted .obj file when the align directive is used. It's a disastrous bug, and affects all platforms.
Confirming fix - all my projects now build correctly. Thank you!
I just built dmd for windows from the github sources, and all my projects compile and run properly now dropping in the fixed binary into the 2.060 installation.