]> git.ipfire.org Git - thirdparty/gcc.git/commit
driver: On linux hosts disable ASLR during -freport-bug [PR119727]
authorJakub Jelinek <jakub@redhat.com>
Mon, 14 Apr 2025 08:18:13 +0000 (10:18 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 19 Apr 2025 06:13:06 +0000 (08:13 +0200)
commit438c4df22217280df3f141bd0b1df0523b4de6d3
treef0fa23ea7804aea9a74e3615249c25c0ed852783
parent2aa812386ad5950283f800257c37bdb78691e770
driver: On linux hosts disable ASLR during -freport-bug [PR119727]

Andi had a useful comment that even with the PR119727 workaround to
ignore differences in libbacktrace printed addresses, it is still better
to turn off ASLR when easily possible, e.g. in case some address leaks
in somewhere in the ICE message elsewhere, or to verify the ICE doesn't
depend on a particular library/binary load addresses.

The following patch adds a configure check and uses personality syscall
to turn off randomization for further -freport-bug subprocesses.

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

PR driver/119727
* configure.ac (HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE): New check.
* gcc.cc: Include sys/personality.h if
HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE is defined.
(try_generate_repro): Call
personality (personality (0xffffffffU) | ADDR_NO_RANDOMIZE)
if HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE is defined.
* config.in: Regenerate.
* configure: Regenerate.

(cherry picked from commit 5a32e85810d33dc46b1b5fe2803ee787d40709d5)
gcc/config.in
gcc/configure
gcc/configure.ac
gcc/gcc.cc