Thread overview
[Issue 21915] dmd 2.092 is an invalid exe file on Windows XP
May 13, 2021
Walter Bright
Dec 09, 2022
Piotr Grochowski
Dec 17, 2022
Iain Buclaw
Dec 17, 2022
Piotr Grochowski
May 13, 2021
https://issues.dlang.org/show_bug.cgi?id=21915

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
Imperatorn writes:

I modified the PE header (set major version and subsystem to 5) and it worked

Sure, you can use any PE editor or even a hex editor.

I used https://petoolse.github.io/petools/

https://i.imgur.com/lnJxwkZ.png

--
December 09, 2022
https://issues.dlang.org/show_bug.cgi?id=21915

Piotr Grochowski <piotrunio-2004@wp.pl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |piotrunio-2004@wp.pl

--- Comment #2 from Piotr Grochowski <piotrunio-2004@wp.pl> ---
As of DMD32 D Compiler v2.101.0-dirty this situation is even worse since even with modified PE header, lld-link.exe relies on GetFinalPathNameByHandleW, forcing the use of -m32omf to get it to link.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21915

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=21915

--- Comment #3 from Piotr Grochowski <piotrunio-2004@wp.pl> ---
Another issues is that programs compiled with dmd also have the glitchy PE
header in some cases, and as well dub build doesn't work when dependencies are
involved. (    Warning Error querying versions for derelict-util, registry at
https://code
.dlang.org/ (fallbacks registry at https://codemirror.dlang.org/, registry at
ht
tps://dub.bytecraft.nl/, registry at https://code-mirror.dlang.io/): Failed to
d
ownload
https://code.dlang.org/api/packages/infos?packages=%5B%22derelict-util%2
2%5D&include_dependencies=true&minimize=true
     Warning Selected package derelict-util 2.0.6 doesn't exist. Using latest
ma
tching version instead., etc.)

and what do file paths like
"dub\packages\vibe-d-0.9.5\vibe-d\.dub\build\vibe-core-debug-windows-x86_64-dmd_v2.101.0-dirty-CD36DD0647735C1EAACF783E7A0448766AD1658E87E331D12580966F1A168BE1\vibed.lib"
even mean? Because that isn't going to fit in a "C:\Documents and
Settings\Administrator.TEST-CF7F6CF2B7\Local Settings\Application Data\" (an
actual path I got in a Windows Server 2003 VM)

--
March 21, 2023
https://issues.dlang.org/show_bug.cgi?id=21915

--- Comment #4 from Need start discordphobing netlifyphobing mirahezephobing makefilephobing gitphobing gnuphobing llvmphobing 265 993 303 <piotrunio-2004@wp.pl> ---
So why can't dmd be a classic Win32 app just like dmc? Are there any licensing issues preventing optlink from being used for certain executable types? In my opinion introducing artificial requirements implicitly encourages e-waste. I can't move on from C++98 if dmd is going to be like this.

--