This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: always producing the same object code...
- From: Ben Davis <bnd25 at cam dot ac dot uk>
- To: Dave Airlie <airlied at linux dot ie>,gcc-help at gcc dot gnu dot org
- Date: Wed, 19 Mar 2003 14:17:46 +0000
- Subject: Re: always producing the same object code...
- Organization: University of Cambridge
- References: <Pine.LNX.4.53.0303190546420.20641@skynet>
On Wednesday 19 March 2003 5:51 am, Dave Airlie wrote:
> Hi,
> I've got a customer (and government for what I work on) requirement that
> the same object is produced from our source code every time, so that the
> regulatory body can do validity checks on the software running in the
> target environment,
Have you tried compiling something multiple times and comparing object files?
> A colleague just noticed -fno-guess-branch-probability and I believe that
> go meet the above requirement I would need to use this switch,
What leads you to this conclusion? "Guess" might mean "educated guess" ...
I suggest you obtain GCC's source code and grep for 'rand'. That should tell
you pretty quickly if random numbers are being used anywhere. You may like to
look for other variable values such as times and dates - and even hardware
info, if GCC alters its code generation according to the processor it's
running on (I don't know if this is the case). If you want to be thorough,
find out if there's any nondeterministic thread behaviour going on (but this
is unlikely).
Finally, run GCC through valgrind. This will tell you if any uninitialised
values are getting used.
Hope that helps,
Ben