reproducible build

Stephan Gatzka stephan.gatzka@gmail.com
Mon Aug 24 04:46:00 GMT 2015


Hi!

> but based on the mention of -frandom-seed I suspect a better test
> case might be one whose outcome can be controlled by the option,
> which is pretty much any file compiled with -flto:
> 
> $ (set -x; cat a.c && for o in '' -frandom-seed=123; do gcc -flto -c
> $o 
> -o a1.o a.c && gcc -flto -c $o -o a2.o a.c && diff a1.o a2.o; done)
> + cat a.c
> int bar (void) { return 0; }
> + for o in ''\'''\''' -frandom-seed=123
> + gcc -flto -c -o a1.o a.c
> + gcc -flto -c -o a2.o a.c
> + diff a1.o a2.o
> Binary files a1.o and a2.o differ
> + for o in ''\'''\''' -frandom-seed=123
> + gcc -flto -c -frandom-seed=123 -o a1.o a.c
> + gcc -flto -c -frandom-seed=123 -o a2.o a.c
> + diff a1.o a2.o

Ah, thanks, that is the stuff I was looking for.

Regards,

Stephan



More information about the Gcc-help mailing list