diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2024-06-28 15:14:15 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2024-07-09 20:00:11 +0100 |
commit | 3cd410fe4f48ffd841fcd5442d1f2d6350666330 (patch) | |
tree | 1a8f43e5dbb4292abe9059d13360073cab6768aa | |
parent | 58ef04d26d1ba9eaf54fabc84b656b6b965d83ac (diff) | |
download | gcc-3cd410fe4f48ffd841fcd5442d1f2d6350666330.zip gcc-3cd410fe4f48ffd841fcd5442d1f2d6350666330.tar.gz gcc-3cd410fe4f48ffd841fcd5442d1f2d6350666330.tar.bz2 |
libstdc++: Define __glibcxx_assert_fail for non-verbose build [PR115585]
When the library is configured with --disable-libstdcxx-verbose the
assertions just abort instead of calling __glibcxx_assert_fail, and so I
didn't export that function for the non-verbose build. However, that
option is documented to not change the library ABI, so we still need to
export the symbol from the library. It could be needed by programs
compiled against the headers from a verbose build.
The non-verbose definition can just call abort so that it doesn't pull
in I/O symbols, which are unwanted in a non-verbose build.
libstdc++-v3/ChangeLog:
PR libstdc++/115585
* src/c++11/assert_fail.cc (__glibcxx_assert_fail): Add
definition for non-verbose builds.
(cherry picked from commit 52370c839edd04df86d3ff2b71fcdca0c7376a7f)
-rw-r--r-- | libstdc++-v3/src/c++11/assert_fail.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libstdc++-v3/src/c++11/assert_fail.cc b/libstdc++-v3/src/c++11/assert_fail.cc index 540e953..774ffa7 100644 --- a/libstdc++-v3/src/c++11/assert_fail.cc +++ b/libstdc++-v3/src/c++11/assert_fail.cc @@ -22,10 +22,10 @@ // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see // <http://www.gnu.org/licenses/>. -#include <cstdio> // for std::fprintf, stderr #include <cstdlib> // for std::abort #ifdef _GLIBCXX_VERBOSE_ASSERT +#include <cstdio> // for std::fprintf, stderr namespace std { [[__noreturn__]] @@ -41,4 +41,12 @@ namespace std abort(); } } +#else +namespace std +{ + [[__noreturn__]] + void + __glibcxx_assert_fail(const char*, int, const char*, const char*) noexcept + { abort(); } +} #endif |