相同的构建在不同的系统上 [英] Identical build on different systems

查看:115
本文介绍了相同的构建在不同的系统上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有3个构建机器。一个在Windows 2000上运行,一个使用XP SP3,另一个使用64位Windows Server 2008.
我有一个本地C ++项目(我正在使用visual studio 2005 SP1)。
我的目标是使用这些构建机器构建完全同样的dll。



完全是逐位的(当然除了构建时间戳)。



对于win2k和winxp,我得到了相同的dll。但它们不同于使用win2008服务器构建的dll。
我设法得到几乎相同的dll,但有一些差异。在反汇编文件后,我发现函数顺序是不一样的(3个函数是不同的顺序)。



有没有人知道可能是什么原因? / p>

还有一个问题:
在vcbuild.exe中我找到一个开关/ ORDER。其中以功能顺序文件作为输入。任何人都知道该文件应该是什么样子。

解决方案

你可能认为编译是纯粹的确定性时间),但不一定是这种情况。例如,考虑优化器 - 这将需要一些内存工作,可能更多的更高优化方法。如果在一台机器上内存分配失败(因为机器具有较少的内存),那么编译器可以省略该特定的优化,从而产生不同的代码。



很多类似的情况,所以你可能会投入很多努力的东西,是不可行的。为什么你需要DLLs按位相同?


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?

解决方案

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?

这篇关于相同的构建在不同的系统上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆