本文介绍了如何使用g ++生成确定性二进制输出?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我在一个非常受监管的环境中工作,我们需要能够产生相同的二进制输入,每次都生成相同的源代码。我们目前使用一个古老版本的g ++,已经打补丁,不写任何像日期/时间在生成的二进制文件,从构建到构建,但我想更新到g ++ 4.7.2。有没有人知道一个补丁,或建议我需要寻找两个相同的源代码,并产生相同的二进制输出?解决方案 除了设置 PWD = / / div> 我们还依赖于位相同的重建,并使用gcc-4.7.x。 proc / self / cwd 并使用 -frandom-seed =< input-file-name> ,有几个补丁,可在 svn://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7 分支中找到。 I work in a very regulated environment where we need to be able to produce identical binary input give the same source code every time be build out products. We currently use an ancient version of g++ that has been patched to not write anything like a date/time in the resulting binaries that would change from build to build, but I would like to update to g++ 4.7.2. Does anyone know of a patch, or have suggestions of what I need to look for to take two identical pieces of source code and produce identical binary outputs? 解决方案 We also depend on bit-identical rebuilds, and are using gcc-4.7.x.Besides setting PWD=/proc/self/cwd and using -frandom-seed=<input-file-name>, there are a handful of patches, which can be found in svn://gcc.gnu.org/svn/gcc/branches/google/gcc-4_7 branch. 这篇关于如何使用g ++生成确定性二进制输出?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-31 11:02