This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Numeric suffixes on symbols


Michael Morrell wrote:
I'm building some code that I want to make sure produces the same bits each
time.  I ran into a case where the only difference between the result from
two different compilation is the names of some of the symbols.

For example, I may see the symbol name:

__PRETTY_FUNCTION__.20638

in the first build, and then:

__PRETTY_FUNCTION__.20694

in the second build.

I'm not sure if it will solve your problem, but GCC has a command-line option for setting the random seed it uses to generate at least some symbol names:


-frandom-seed=string
This option provides a seed that GCC uses when it would otherwise use random numbers. It is used to generate certain symbol names that have to be different in every compiled file. It is also used to place unique stamps in coverage data files and the object files that produce them. You can use the -frandom-seed option to produce reproducibly identical object files.


The string should be different for every file you compile.

http://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html

Cheers,
Nicholas Sherlock


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]