]> 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>
Fri, 13 Jun 2025 11:07:26 +0000 (13:07 +0200)
commit9586f7a78533ef4feb92f838f9f70aa2341d0ede
treed9176523b71640769d047e6fe42b99fb06ee953d
parentd3c3322577ca0d37adf47e1b67f35be003a7425d
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