tags:

views:

374

answers:

4

Building the same project (without any changes) produces binary different exe-files: some small regions of them are different. Empty project, version information (and auto-increment on every build) is turned off.

Why it happens? And is it possible to make delphi produce binary equal files for the same projects?

A: 

it may be, that some actual time-stamps are compiled into the exe-file.

Peter Miehle
+1  A: 

I suspect compiler insert to *.exe encoded time, special ordinal numbers (for versioning) and maybe other things :) It's impossible to force Delphi to produce equal binary output.

macropas
+2  A: 

Try changing the problem into "How do I avoid compiling if there are no changes to the source", might be easier to deal with.

Lasse V. Karlsen
What if we have no executable module at all but we want get it equal to existing (somewhere) which corresponds particular revision of projects.
valentyn
Or include a request on Quality Central asking for a compiler feature that enables to produce **exactly** equal executables.
Fabricio Araujo
+13  A: 

The various structures in the PE executable file format used by Windows include timestamps that are set by the compiler and linker.

It is possible to post-process the file to reset these values to a defined constant (I wrote a tool to do exactly this for a secure product that needed exact hash values), but this should only be done on ready-to-ship executables, as some debuggers rely on the timestamps for source lookup, etc.

devstuff