How to prevent DMD from changing the executable files at each compilation ?
Ecstatic Coder
ecstatic.coder at gmail.com
Sun Sep 29 13:06:37 UTC 2019
On Sunday, 29 September 2019 at 12:30:46 UTC, H. S. Teoh wrote:
> On Sun, Sep 29, 2019 at 11:15:43AM +0000, Ecstatic Coder via
> Digitalmars-d wrote:
>> Every time I compile the same code with DMD, I get a slightly
>> different ".exe" file on Windows.
>>
>> fc /b basil.exe basil_old_1.exe
>> 00000118: 9F 55
>> 00000119: 8C 89
>> 00156554: 9F 55
>> 00156555: 8C 89
>>
>> fc /b basil.exe basil_old_2.exe
>> 00000118: 9F 1B
>> 00000119: 8C 8A
>> 00156554: 9F 1B
>> 00156555: 8C 8A
>>
>> This problem is D specific, as for instance Go will generate
>> the same executable each time.
>>
>> So before I implement a tool for this, is there an easy way to
>> prevent DMD from "timestamping" its generated binaries, so
>> that they become more "git-friendly" ?
>
> Seems this is Windows-specific; I can't reproduce this on my
> Linux box. Which leads me to think this isn't a dmd problem; it
> may be the linker that's inserting the timestamp. Which linker
> is being used? Perhaps an approprate option passed to the
> linker is what you need. You can pass options to the linker
> with -L... (on Windows it might be /L..., not 100% sure).
>
>
> T
Ah, then I guess it's probably because I'm using the MinGW option
when installing the DMD compiler, as unfortunately it's the only
"lean" option that remains :(
OK, I'll try deinstalling DMD, and then reinstalling it with the
"huge" option (=VS)...
Thanks for the hint :)
More information about the Digitalmars-d
mailing list