binary-reproducibility

Why don't two binaries of programs with only comments changed exactly match in gcc?

孤街浪徒 提交于 2019-11-28 16:34:47
问题 I created two C programs Program 1 int main() { } Program 2 int main() { //Some Harmless comments } AFAIK, when compiling, the compiler(gcc) should ignore the comments and redundant whitepaces, and hence the output must be similar. But when I checked the md5sums of the output binaries, they don't match. I also tried compiling with optimisation -O3 and -Ofast but they still didn't match. What is happening here? EDIT: the exact commands and there md5sums are(t1.c is program 1 and t2.c is

Determine whether .NET assemblies were built from the same source

丶灬走出姿态 提交于 2019-11-27 11:48:25
Does anyone know of a way to compare two .NET assemblies to determine whether they were built from the "same" source files? I am aware that there are some differencing utilities available, such as the plugin for Reflector, but I am not interested in viewing differences in a GUI, I just want an automated way to compare a collection of binaries to see whether they were built from the same (or equivalent) source files. I understand that multiple different source files could produce the same IL, and realise that the process would only be sensitive to differences in the IL, not the original source.

How to store CMake build settings

ⅰ亾dé卋堺 提交于 2019-11-27 08:44:12
There are often many swiches to enable/disable when trying to build a project that uses CMake. How do you store the build settings made by some user to make a build reproduceable on another machine? Is there some kind of export functionality or do you just copy the build (cache) folder? Beachwalker There is an option to pre-load a script for populating the cache file with cmake using cmake -C <initial-cache> The initial-cache is a file containing variables set in the following way, e.g. for the install prefix: set(CMAKE_INSTALL_PREFIX "/my/install/prefix" CACHE PATH "") Then just pass this

Why is the binary output not equal when compiling again?

余生长醉 提交于 2019-11-27 08:34:20
I'm using a build script to compile several C# projects. The binary output is copied to a result folder, overwriting the previous version of the files, and then added/committed to subversion. I noticed that the binary output of the compilation are different even when there was no change to the source or environment at all. How is this possible? Isn't the binary result supposed to be exactly equal for the same input? I'm not intentionally using any kind of special timestamps anywhere, but does the compiler (Microsoft, the one included in .NET 4.0) possibly add timestamps itself? The reason I'm

Determine whether .NET assemblies were built from the same source

南笙酒味 提交于 2019-11-26 18:06:15
问题 Does anyone know of a way to compare two .NET assemblies to determine whether they were built from the "same" source files? I am aware that there are some differencing utilities available, such as the plugin for Reflector, but I am not interested in viewing differences in a GUI, I just want an automated way to compare a collection of binaries to see whether they were built from the same (or equivalent) source files. I understand that multiple different source files could produce the same IL,

How to store CMake build settings

橙三吉。 提交于 2019-11-26 14:16:46
问题 There are often many swiches to enable/disable when trying to build a project that uses CMake. How do you store the build settings made by some user to make a build reproduceable on another machine? Is there some kind of export functionality or do you just copy the build (cache) folder? 回答1: There is an option to pre-load a script for populating the cache file with cmake using cmake -C <initial-cache> The initial-cache is a file containing variables set in the following way, e.g. for the

Why is the binary output not equal when compiling again?

允我心安 提交于 2019-11-26 14:14:36
问题 I'm using a build script to compile several C# projects. The binary output is copied to a result folder, overwriting the previous version of the files, and then added/committed to subversion. I noticed that the binary output of the compilation are different even when there was no change to the source or environment at all. How is this possible? Isn't the binary result supposed to be exactly equal for the same input? I'm not intentionally using any kind of special timestamps anywhere, but does