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: always producing the same object code...


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


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