From: Tom Tromey Date: Tue, 9 Oct 2018 17:51:33 +0000 (-0600) Subject: Disable the undefined behavior sanitizer by default X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=eff98030f90d3dab4c7d133ab0b0cb02d1921543;p=binutils-gdb.git Disable the undefined behavior sanitizer by default There have been a few undefined behavior failures reported, and Pedro suggested that the sanitizer be disabled by default. This patch implements this. gdb/ChangeLog 2018-10-09 Tom Tromey * configure: Rebuild. * sanitize.m4 (AM_GDB_UBSAN): Default to no. * NEWS: Update --enable-ubsan documentation. gdb/doc/ChangeLog 2018-10-09 Tom Tromey * gdb.texinfo (Configure Options): Update --enable-ubsan documentation. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f37070ea484..f9e56be46da 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2018-10-09 Tom Tromey + + * configure: Rebuild. + * sanitize.m4 (AM_GDB_UBSAN): Default to no. + * NEWS: Update --enable-ubsan documentation. + 2018-10-09 Gary Benson * dwarf2read.c (create_dwp_hash_table): Fix buffer overrun diff --git a/gdb/NEWS b/gdb/NEWS index 8a0dd52fa7f..126e61e282a 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -122,11 +122,11 @@ FreeBSD/riscv riscv*-*-freebsd* --enable-ubsan - Enable or disable the undefined behavior sanitizer. Release - versions of GDB disable this by default if it is available, but - development versions enable it. Enabling this can cause a - performance penalty. The undefined behavior sanitizer was first - introduced in GCC 4.9. + Enable or disable the undefined behavior sanitizer. This is + disabled by default, but passing --enable-ubsan=yes or + --enable-ubsan=auto to configure will enable it. Enabling this can + cause a performance penalty. The undefined behavior sanitizer was + first introduced in GCC 4.9. *** Changes in GDB 8.2 diff --git a/gdb/configure b/gdb/configure index 304adc81fec..adb26e5d4d3 100755 --- a/gdb/configure +++ b/gdb/configure @@ -15614,7 +15614,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "${enable_ubsan+set}" = set; then : enableval=$enable_ubsan; else - enable_ubsan=auto + enable_ubsan=no fi if test "x$enable_ubsan" = xauto; then diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a3aace7d6bc..c67798399f2 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2018-10-09 Tom Tromey + + * gdb.texinfo (Configure Options): Update --enable-ubsan + documentation. + 2018-10-08 John Baldwin * gdb.texinfo (Contributors): Add SRI International and University diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index efd6dffb1e5..b0dc3bf67c1 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -35771,12 +35771,13 @@ to the compiler, which will fail the compilation if the compiler outputs any warning messages. @item --enable-ubsan -Enable the GCC undefined behavior sanitizer. By default this is -disabled in @value{GDBN} releases, but enabled, when available, when -building from git. The undefined behavior sanitizer checks for -C@t{++} undefined behavior. It has a performance cost, so if you are -looking at @value{GDBN}'s performance, you should disable it. The -undefined behavior sanitizer was first introduced in GCC 4.9. +Enable the GCC undefined behavior sanitizer. This is disabled by +default, but passing @code{--enable-ubsan=yes} or +@code{--enable-ubsan=auto} to @code{configure} will enable it. The +undefined behavior sanitizer checks for C@t{++} undefined behavior. +It has a performance cost, so if you are looking at @value{GDBN}'s +performance, you should disable it. The undefined behavior sanitizer +was first introduced in GCC 4.9. @end table @node System-wide configuration diff --git a/gdb/sanitize.m4 b/gdb/sanitize.m4 index 76df44da4fe..979f6461c0d 100644 --- a/gdb/sanitize.m4 +++ b/gdb/sanitize.m4 @@ -20,7 +20,7 @@ AC_DEFUN([AM_GDB_UBSAN],[ AC_ARG_ENABLE(ubsan, AS_HELP_STRING([--enable-ubsan], [enable undefined behavior sanitizer (auto/yes/no)]), - [],enable_ubsan=auto) + [],enable_ubsan=no) if test "x$enable_ubsan" = xauto; then if $development; then enable_ubsan=yes