diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2018-08-01 20:52:46 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2018-08-01 20:52:46 +0100 |
commit | 9fbd2e55a11d518f049ed3e7b0b9f647383eb020 (patch) | |
tree | 02c34fc0edd2a4239fadb2a51359fd012e2bb882 /libstdc++-v3 | |
parent | c191b1abe9db08abdf3b2d792980e8eee63735b5 (diff) | |
download | gcc-9fbd2e55a11d518f049ed3e7b0b9f647383eb020.zip gcc-9fbd2e55a11d518f049ed3e7b0b9f647383eb020.tar.gz gcc-9fbd2e55a11d518f049ed3e7b0b9f647383eb020.tar.bz2 |
Add -D_GLIBCXX_ASSERTIONS to DEBUG_FLAGS
Enable assertions in the extra debug library built when
--enable-libstdcxx-debug is used. Replace some Debug Mode assertions
in src/c++11/futex.cc with __glibcxx_assert, because the library will
never be built with Debug Mode.
* configure: Regenerate.
* configure.ac: Add -D_GLIBCXX_ASSERTIONS to default DEBUG_FLAGS.
* src/c++11/futex.cc: Use __glibcxx_assert instead of
_GLIBCXX_DEBUG_ASSERT.
From-SVN: r263235
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/ChangeLog | 7 | ||||
-rwxr-xr-x | libstdc++-v3/configure | 4 | ||||
-rw-r--r-- | libstdc++-v3/configure.ac | 2 | ||||
-rw-r--r-- | libstdc++-v3/src/c++11/futex.cc | 6 |
4 files changed, 13 insertions, 6 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 71c01f9..8d7306a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2018-08-01 Jonathan Wakely <jwakely@redhat.com> + + * configure: Regenerate. + * configure.ac: Add -D_GLIBCXX_ASSERTIONS to default DEBUG_FLAGS. + * src/c++11/futex.cc: Use __glibcxx_assert instead of + _GLIBCXX_DEBUG_ASSERT. + 2018-08-01 Mike Crowe <mac@mcrowe.com> * include/std/condition_variable (wait_for): Use steady_clock. diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index 54a2e8a..d33081d 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -1571,7 +1571,7 @@ Optional Features: --enable-concept-checks use Boost-derived template checks [default=no] --enable-libstdcxx-debug-flags=FLAGS pass compiler FLAGS when building debug library - [default="-gdwarf-4 -g3 -O0"] + [default="-gdwarf-4 -g3 -O0 -D_GLIBCXX_ASSERTIONS"] --enable-libstdcxx-debug build extra debug library [default=no] --enable-cxx-flags=FLAGS @@ -17932,7 +17932,7 @@ if test "${enable_libstdcxx_debug_flags+set}" = set; then : *) as_fn_error "--enable-libstdcxx-debug-flags needs compiler flags as arguments" "$LINENO" 5 ;; esac else - enable_libstdcxx_debug_flags="-gdwarf-4 -g3 -O0" + enable_libstdcxx_debug_flags="-gdwarf-4 -g3 -O0 -D_GLIBCXX_ASSERTIONS" fi diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac index 1e0a33f..332af37 100644 --- a/libstdc++-v3/configure.ac +++ b/libstdc++-v3/configure.ac @@ -168,7 +168,7 @@ GLIBCXX_ENABLE_LONG_LONG([yes]) GLIBCXX_ENABLE_WCHAR_T([yes]) GLIBCXX_ENABLE_C99([yes]) GLIBCXX_ENABLE_CONCEPT_CHECKS([no]) -GLIBCXX_ENABLE_DEBUG_FLAGS(["-gdwarf-4 -g3 -O0"]) +GLIBCXX_ENABLE_DEBUG_FLAGS(["-gdwarf-4 -g3 -O0 -D_GLIBCXX_ASSERTIONS"]) GLIBCXX_ENABLE_DEBUG([no]) GLIBCXX_ENABLE_PARALLEL([yes]) GLIBCXX_ENABLE_CXX_FLAGS diff --git a/libstdc++-v3/src/c++11/futex.cc b/libstdc++-v3/src/c++11/futex.cc index 278a5a8..a5a8ec6 100644 --- a/libstdc++-v3/src/c++11/futex.cc +++ b/libstdc++-v3/src/c++11/futex.cc @@ -53,7 +53,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION // here on errors is abort. int ret __attribute__((unused)); ret = syscall (SYS_futex, __addr, futex_wait_op, __val, nullptr); - _GLIBCXX_DEBUG_ASSERT(ret == 0 || errno == EINTR || errno == EAGAIN); + __glibcxx_assert(ret == 0 || errno == EINTR || errno == EAGAIN); return true; } else @@ -75,8 +75,8 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION if (syscall (SYS_futex, __addr, futex_wait_op, __val, &rt) == -1) { - _GLIBCXX_DEBUG_ASSERT(errno == EINTR || errno == EAGAIN - || errno == ETIMEDOUT); + __glibcxx_assert(errno == EINTR || errno == EAGAIN + || errno == ETIMEDOUT); if (errno == ETIMEDOUT) return false; } |