c++dllbuildlinkervisual-studio-2005

Identical build on different systems


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?


Solution

  • 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?