views:

241

answers:

3

I have 3 build machines. One running on windows 2000, one with XP SP3 and one with 64bit Windows Server 2008. And I have a native C++ project to build (I'm building with visual studio 2005 SP1). My goal is to build "exactly" the same dll's using these build machines.

By exactly I mean bit by bit (except build timestamp of course).

With win2k and winxp I'm getting identical dll's. But they differ from dll built with win2008 server. I've managed to get almost identical dll's, but there are some differences. After disassembling the files I found out that function order is not the same (3 functions are in different order).

Does anyone know what could be the reason for that?

And a side question: In vcbuild.exe I've found a switch /ORDER. Which takes function order file as input. Anyone knows how that file should look like?

A: 

Do you run the same version of the chain tool (compiler, linker, ...), included 32/64 bits difference?

AProgrammer
Yes, I'm building with vs2005 with SP1 everywhere (.net 2.0 SP1 is also installed).Building to win32 platform.
ppiotrowicz
Are you sure you are using 32 bits version of the compiler and the linker on Win2008?
AProgrammer
Yes, i'm sure. They're in Program Files (x86)
ppiotrowicz
A: 

Is Windows Server 2008 the only machine running 64 bit? If it is, that could be your problem.

Kunla
It might be, but dlls from 32bit systems are are almost identical. The only difference is that _3_ functions are in different order (and there are lots of functions in the project).Disasembled code is almost the same.
ppiotrowicz
+7  A: 

You might think that compiling is purely deterministic (identical inputs give identical output, every time) but this need not be the case. For example, consider the optimiser - this is going to need some memory to work in, probably more for higher optimisation methods. If on one machine a memory allocation fails (because the machine has less memory) then the compiler could omit that specific optimisation, resulting in different code being emitted.

There are a lot of similar situations, so you may be putting a lot of effort into something that is not doable. Why do you need the DLLs to be bitwise identical, anyway?

anon
With optimizations turned off (/Od switch) i have the same problem.Bitwise equality is crucial in this project (can't really discuss why, sorry).
ppiotrowicz
The optimisation thing was just an example - there are LOTS of things that might make the compiler produce different output.
anon