++
Assignee: unassigned at gcc dot gnu.org
Reporter: gnu.org at mrks dot info
Target Milestone: ---
I found that introducing precompiled headers to my project causes ccache
lookups to fail. I tracked it down to the gcc output not being deterministic:
# /usr/bin/c++ -x c++-header
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717
--- Comment #2 from Markus Dreseler ---
> Try using __DATE__ macro and you will see it is not :).
Can't confirm:
# /usr/bin/c++ -D__DATE__=0 -D__TIMESTAMP__=0 -D__TIME__=0 -x c++-header
-include test.hxx -o test.hxx.gch -c test.hxx.cxx && md5su
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717
--- Comment #4 from Markus Dreseler ---
> By any chance, is your cc1plus built as PIE? PCH doesn't work in that case.
I don't think so:
# file `find /usr -name cc1plus`
/usr/lib/gcc/x86_64-linux-gnu/9/cc1plus: ELF 64-bit LSB executable, x86-64
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717
--- Comment #5 from Markus Dreseler ---
I took Andrew's __DATE__ suggestion as a reason to look at how much the files
actually differ. `cmp -l v1 v2 | wc -l` gives me 692634 differing bytes. This
sounds like the difference is bigger than just som
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92717
--- Comment #8 from Markus Dreseler ---
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.