This is the mail archive of the
mailing list for the GCC project.
Reproducibility, file names, and -frandom-seed
- From: Matt McCutchen <hashproduct at verizon dot net>
- To: gcc at gnu dot org
- Date: Sun, 12 Mar 2006 16:49:52 -0500
- Subject: Reproducibility, file names, and -frandom-seed
- Reply-to: hashproduct at verizon dot net
Dear GCC developers,
I would like a compiler that produces identical object files when run
several times with identical source files and headers.
I noticed the documentation of -frandom-seed in the GCC man page and
found a simple way to make compiles reproducible while still reliably
matching object files with coverage data files: use a hash code of all
information affecting the object file (i.e. preprocessed source file,
compiler version, and compiler settings). Alternatively, generate the
object file with a random seed of zero, hash it, and regenerate the
necessary parts using the hash as a new seed. What do you think of
Furthermore, names of source files appear in object files, so if I
compile two identical source files foo.c and bar.c, I get two different
object files. Names of source files are obviously useful to debuggers
looking for a program's source, but gcc 4.0.2 20051125 (Red Hat 4.0.2-8)
includes them even when -g is off. Is there a good reason for this?