[Bug c++/92717] precompiled headers non-deterministic
gnu.org at mrks dot info
gcc-bugzilla@gcc.gnu.org
Fri Nov 29 08:52:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717
--- Comment #8 from Markus Dreseler <gnu.org at mrks dot info> ---
Interesting. Is this implementation documented somewhere?
I can confirm that disabling ASLR results in reproducible gchs:
# setarch $(uname -m) -R /usr/bin/c++ -x c++-header -include test.hxx -o
test.hxx.gch -c test.hxx.cxx && md5sum test.hxx.gch
54486c6ffc08db87d4b58792dcb46091 test.hxx.gch
# setarch $(uname -m) -R /usr/bin/c++ -x c++-header -include test.hxx -o
test.hxx.gch -c test.hxx.cxx && md5sum test.hxx.gch
54486c6ffc08db87d4b58792dcb46091 test.hxx.gch
For CI builds of trusted files, this might be an option, but generally setting
the ADDR_NO_RANDOMIZE personality for gcc when gchs are build does not sound
like a good approach.
More information about the Gcc-bugs
mailing list