[PATCH v2 4/6] nptl: Only issues __libc_unwind_link_get for SHARED

Adhemerval Zanella adhemerval.zanella@linaro.org
Wed Feb 25 18:31:15 GMT 2026


The compiler already optimizes it away for static builds.
---
 nptl/pthread_exit.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/nptl/pthread_exit.c b/nptl/pthread_exit.c
index 4d320e608f..4c15171992 100644
--- a/nptl/pthread_exit.c
+++ b/nptl/pthread_exit.c
@@ -24,12 +24,14 @@
 void
 __pthread_exit (void *value)
 {
+#ifdef SHARED
   {
     struct unwind_link *unwind_link = __libc_unwind_link_get ();
     if (unwind_link == NULL)
       __libc_fatal (LIBGCC_S_SO
                     " must be installed for pthread_exit to work\n");
   }
+#endif
 
   __do_cancel (value);
 }
-- 
2.43.0



More information about the Libc-alpha mailing list