]> git.ipfire.org Git - thirdparty/gcc.git/commit
driver: Fix up -freport-bug for ASLR [PR119727]
authorJakub Jelinek <jakub@redhat.com>
Sat, 12 Apr 2025 11:15:13 +0000 (13:15 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 12 Apr 2025 11:15:13 +0000 (13:15 +0200)
commit8b2ceb421f045ee8b39d7941f39f1e9a67217583
tree673a4e39f181239070b83420091b8fe396fca3b9
parent3f9dfb94eab1ab1bbf9a2b5e20d1f61e36516063
driver: Fix up -freport-bug for ASLR [PR119727]

With --enable-host-pie -freport-bug almost never prepares preprocessed
source and instead emits
The bug is not reproducible, so it is likely a hardware or OS problem.
message even for bogus which are 100% reproducible.
The way -freport-bug works is that it reruns it 3 times, capturing stdout
and stderr from each and then tries to compare the outputs in between
different runs.
The libbacktrace emitted hexadecimal addresses at the start of the lines
can differ between runs due to ASLR, either of the PIE executable, or
even if not PIE if there is some frame with e.g. libc function (say
crash in strlen/memcpy etc.).

The following patch fixes it by ignoring such differences at the start of
the lines.

2025-04-12  Jakub Jelinek  <jakub@redhat.com>

PR driver/119727
* gcc.cc (files_equal_p): Rewritten using fopen/fgets/fclose instead
of open/fstat/read/close.  At the start of lines, ignore lowercase
hexadecimal addresses followed by space.
gcc/gcc.cc