[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Repeatable builds with Visual C++ ?
From: |
Uwe Schuster |
Subject: |
Re: Repeatable builds with Visual C++ ? |
Date: |
Wed, 5 Dec 2001 18:01:28 +0100 |
Johan Holmberg [SMTP:address@hidden wrote:
> I wonder if anyone knows if it is possible to reproduce an exe-file
> "byte-by-byte" with Visual C++.
>
> Visual C++ puts timestamps in the object files, but I think I found
> a way around that by running "dumpbin" on the resulting exe, like
> this:
> 1) remove all object- and exe-files
> 2) compile/link appl. with Cons.
> 3) run "dumpbin /all EXEFILE > EXEFILE.dump-1
> 4) remove all object- and exe-files
> 5) compile/link appl. with Cons.
> 6) run "dumpbin /all EXEFILE > EXEFILE.dump-2
> 7) run "diff EXEFILE.dump-1 EXEFILE.dump-2"
>
> Does anyone know anything about this problem ?
Have a look at the ms-knowledge base article: Q164151 HOWTO: Comparing Binary
Images of Same Project Builds
You will see, that there are many difficulties and special cases to observe,
like time-stamps also in ressources, differently linker behaviour between two
builds (thanks to ms).
We use such a way for comparing our executables, but not with cons. We make the
builds directly in the VC IDE and then we use a little make script or batch
file that calls the dumpbin and then call a diff utility to compare with the
other executable.
// compare exe files
dumpbin /disasm %1.exe >%1.txt
dumpbin /disasm %2.exe >%2.txt
diff %1.txt %2.txt
// compare dll files
dumpbin /RAWDATA %1.dll >%1.txt
dumpbin /headers %1.dll >%1.hdr
dumpbin /RAWDATA %2.dll >%2.txt
dumpbin /headers %2.dll >%2.hdr
diff %1.txt %2.txt
diff %1.hdr %2.hdr
This works fine for us, in the moment, but i think it is not suitable for all
situations.
Hope that helps.