public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Ensure __glibcxx_assert_fail has default visibility
@ 2022-03-05 20:34 Jonathan Wakely
  2022-03-07 15:14 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Wakely @ 2022-03-05 20:34 UTC (permalink / raw)
  To: libstdc++, gcc-patches

Tested powerpc64le-linux, pushed to trunk.

-- >8 --

This ensures there's no linker error if libstdc++ headers are included
following a pragma that sets hidden visibility.

Similarly for std::__terminate, which is always-inline so shouldn't
matter, but it's not wrong to do this anyway.

libstdc++-v3/ChangeLog:

	* include/bits/c++config (__glibcxx_assert_fail): Add visibility
	attribute.
	(__terminate): Likewise.
---
 libstdc++-v3/include/bits/c++config | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index c64b61b3c90..6c134f13509 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -305,6 +305,7 @@ namespace std
   // This allows the library to terminate without including all of <exception>
   // and without making the declaration of std::terminate visible to users.
   extern "C++" __attribute__ ((__noreturn__, __always_inline__))
+  _GLIBCXX_VISIBILITY(default)
   inline void __terminate() _GLIBCXX_USE_NOEXCEPT
   {
     void terminate() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__noreturn__));
@@ -554,7 +555,7 @@ namespace std
 {
   // Avoid the use of assert, because we're trying to keep the <cassert>
   // include out of the mix.
-  extern "C++" _GLIBCXX_NORETURN
+  extern "C++" _GLIBCXX_NORETURN _GLIBCXX_VISIBILITY(default)
   void
   __glibcxx_assert_fail(const char* __file, int __line,
 			const char* __function, const char* __condition)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-03-07 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-05 20:34 [committed] libstdc++: Ensure __glibcxx_assert_fail has default visibility Jonathan Wakely
2022-03-07 15:14 ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).