This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Repeated gcc yields differing .exe files


Hi!

Friday, 20 December, 2002 fergus@bonhard.uklinux.net fergus@bonhard.uklinux.net wrote:

fbun> I found this just now. I'm afraid I don't know enough about gcc to deduce
fbun> whether this is just yet another symptom of problems already reported or
fbun> something else, that genuinely matters (I think it does) and that can be
fbun> mended (I hope it can).

fbun> I just repeatedly used gcc with hello.c attached to get this:

~/tmp>> gcc -o hello hello.c; md5sum hello.exe
fbun> 15fbfaadc53cede5d797eb544dae032e *hello.exe
~/tmp>> gcc -o hello hello.c; md5sum hello.exe
fbun> 3a7d9a1536e0b3dcb4fa8557a2933ffb *hello.exe
~/tmp>> gcc -o hello hello.c; md5sum hello.exe
fbun> 952a3bee8d35b627a92c679640e1d1df *hello.exe

fbun> The fact that hello.exe alters seems a bit non-optimal to me, given that
fbun> md5sums are a pretty standard way for people like you and me to check that
fbun> we're running the same stuff, intended to do the same thing. Incidentally,
fbun> it's always the same two bytes that alter:

~/tmp>> cmp -l hello.exe hello1.exe
fbun>   137  74 254
fbun>   217  33 213
~/tmp>> cmp -l hello.exe hello2.exe
fbun>   137  74 257
fbun>   217  33 216
~/tmp>> cmp -l hello.exe hello3.exe
fbun>   137  74 262
fbun>   217  33 221

fbun> I had an earlier problem with a _long_ myfile.c giving variant myfile.exe. I
fbun> knew you wouldn't like to be bothered with myfile.c which is why I looked at
fbun> hello.c. The variations in successive copies of myfile.exe were again in
fbun> bytes 137 and 217.

This is by design. PE specification states that binary files should
have a timestamp field in their header. Obviously, it changes whenever
you rebuild the application. As we generate windows executables we
should comply with standards adopted by microsoft for their platform.
Other option -- i.e. zeroing timestamp in PE header will solve your
problem but may pose problems with compatibility with new versions of
microsoft's OSes and, possibly, other windows software. So i highly
doubt that current situation will change anytime soon.

Egor.            mailto:deo@logos-m.ru ICQ 5165414 FidoNet 2:5020/496.19


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]