From: Adhemerval Zanella Date: Fri, 17 Oct 2025 19:13:15 +0000 (-0300) Subject: elf: Only define _dl_tls_allocate_active for SHARED X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e872036c4005f08b710f9c2e48026f0b3e6e055;p=thirdparty%2Fglibc.git elf: Only define _dl_tls_allocate_active for SHARED clang issues: dl-tls.c:108:1: error: unused function '_dl_tls_allocate_active' [-Werror,-Wunused-function] 108 | _dl_tls_allocate_active (void) | ^~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Reviewed-by: Sam James --- diff --git a/elf/dl-tls.c b/elf/dl-tls.c index a083a82933..aacd80cbe5 100644 --- a/elf/dl-tls.c +++ b/elf/dl-tls.c @@ -103,11 +103,13 @@ _dl_tls_allocate_end (void) atomic_fetch_add_relaxed (&_dl_tls_threads_in_update, -1); } +#ifdef SHARED static inline bool _dl_tls_allocate_active (void) { return atomic_load_relaxed (&_dl_tls_threads_in_update) > 0; } +#endif /* Compute the static TLS surplus based on the namespace count and the TLS space that can be used for optimizations. */