all groups > visual c libraries > june 2004 >
You're in the

visual c libraries

group:

Same code build twice => diff binary


Re: Same code build twice => diff binary Carl Daniel [VC++ MVP]
6/5/2004 6:41:41 AM
visual c libraries:
[quoted text, click to view]

Re-building a small program, I only see a couple bytes difference around
offset 0xe8 in the file. This is a timestamp that the linker puts in the PE
header that tells when the image was linked.

-cd

Re: Same code build twice => diff binary Carl Daniel [VC++ MVP]
6/5/2004 9:18:37 AM
[quoted text, click to view]

I believe that you assume incorrectly. There is no option to suppress the
timestamp - it's a required part of the PE header.

-cd

Same code build twice => diff binary Viviana Vc
6/5/2004 3:12:10 PM
Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple application like void main(){} and 2 times rebuilding the project
gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Re: Same code build twice => diff binary Viviana Vc
6/5/2004 4:20:38 PM
I found the following article:
http://support.microsoft.com/default.aspx?scid=kb;en-us;164151
which tells that indeed the timestamp is the diff, but I couldn't find
in VC++ IDE any setting to disable the timepstamp stuff, and I assume
this should be somehow doable.

Thx,
Viv


On Sat, 05 Jun 2004 15:12:10 +0200, Viviana Vc <vcotirlea@hotmail.com>
wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Carl Daniel [VC++ MVP]
6/7/2004 6:09:33 AM
[quoted text, click to view]

There may well be timestamps in the .obj files as well, but if so, they
don't influence the output of the linker.

-cd

Re: Same code build twice => diff binary Julie
6/7/2004 9:58:11 AM
[quoted text, click to view]

Or -- you could use a PE editor and manually change the timestamp to a value of
Re: Same code build twice => diff binary Russell Hind
6/7/2004 12:15:18 PM
Maybe a different way of handling updates is required, not based on
binary compares.

Cheers

Russell

[quoted text, click to view]
Re: Same code build twice => diff binary Viviana Vc
6/7/2004 12:40:45 PM
But I also get the obj different so I thought that this is a compiler
option not linker option.

Viv

On Sat, 5 Jun 2004 06:41:41 -0700, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nospam@mvps.org.nospam> wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Viviana Vc
6/7/2004 12:41:46 PM
That is sad :( I am having an update feature in my product, and because
of the timestamp it will have to update all the binaries, even though
they are identical.

On Sat, 5 Jun 2004 09:18:37 -0700, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nospam@mvps.org.nospam> wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Michael J. Mooney
6/7/2004 2:16:49 PM
Is there a can't you use version numbers to identify binary versions?

--
Michael J. Mooney
MCP+SB, MCAD, MCSD

[quoted text, click to view]

Re: Same code build twice => diff binary Jussi Jumppanen
6/8/2004 10:32:26 AM
[quoted text, click to view]

But that is the point, they are not identical as the two
binaries have a different PE information.

Why not change the diff program so that it skips over the PE
header, in which case it would report no differences in the
binaries.

Jussi Jumppanen
Author of: Zeus for Windows (All new version 3.92 out now)
"The C/C++, Cobol, Java, HTML, Python, PHP, Perl programmer's editor"
Re: Same code build twice => diff binary Viviana Vc
6/8/2004 12:48:14 PM
Already tried that.
I have used the editor downloaded from:
http://www.softpedia.com/public/cat/5/4/5-4-4.shtml

I changed the time stamp and still there are 2 diffs between the exes
(initially there were 3 diffs).

Viv

On Mon, 07 Jun 2004 09:58:11 -0700, Julie <julie@nospam.com> wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Viviana Vc
6/8/2004 12:50:52 PM
Any tool I could use for skipping the PE header?
As I said I already tried to change the time stamp in the PE header
using a PE editor, but still there are 2 diffs between the exes
(initially there were 3).

Viv

On Tue, 08 Jun 2004 10:32:26 +1000, Jussi Jumppanen
<jussij@zeusedit.com> wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Andrew McDonald
6/11/2004 12:28:57 AM
Can't you include a version info resource and check the version number?

Andrew

[quoted text, click to view]

Re: Same code build twice => diff binary Viviana Vc
6/14/2004 12:42:52 PM
I could of course, but the problem is like this: I have let's say a
binary that uses common code from other libraries, like some header
files, so would be hard to know when to change the version number ...
There are many developers working on the same header files, so hard to
check if something has changed in order to change the version number.

On Fri, 11 Jun 2004 00:28:57 +0100, "Andrew McDonald"
<myrmecophagavir@no-spam-thanks.bigfoot.com> wrote :

[quoted text, click to view]
Re: Same code build twice => diff binary Walter Briscoe
6/14/2004 1:50:52 PM
In message <2j5dm4FtnmhnU1@uni-berlin.de> of Mon, 14 Jun 2004 12:42:52
in comp.os.ms-windows.programmer.misc, Viviana Vc
<vcotirlea@hotmail.com> writes
[Poster wants an executable built twice to compare equal.
Poster cross-posted to 5 newsgroups and should consider fewer. The same
poster started another thread in 9 newsgroups. This is unlikely to be
productive. Some knowledgeable people would ignore the posting on that
basis. They are a LOT better than corresponding multi-postings.]

[quoted text, click to view]

If you use a project file (Microsoft's term for Makefile) appropriately,
your product will be rebuilt if and only if a contributing component
changes. Version control systems can help in organising this.

Your problem is in a class which is not reasonably soluble with the sort
of technique you hope to apply.

If I wanted to solve your problem, I would find or write a PE dumper - I
can propose no suitable URL - and then compare files with boring things
filtered from the comparison. Hopefully, this will work.

I usually take the line that files with different dates or sizes are
different. This is a fairly conservative approach. It is highly likely
that the "same" thing can not be built on my machine and yours or even
twice on mine. The same river can not be viewed twice. ;)
--
AddThis Social Bookmark Button