]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Disable __USE_EXTERN_INLINES for clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 17 Oct 2025 19:12:38 +0000 (16:12 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Oct 2025 12:23:59 +0000 (09:23 -0300)
clang does not allow to redefine attributes after function declaration.
Although it work for external usage, its breaks the build for internal
symbol that glibc provides as optimization (for instance bsearch
with stdlib-bsearch.h or __cmsg_nxthdr).

Disable such optimization for clang while building glibc.

Reviewed-by: Sam James <sam@gentoo.org>
include/features.h

index 03b83cd34c70d371c9df43891613a4bcdd83d8d6..673c4036cde5cea2578eff3717d0891e85c58a25 100644 (file)
 /* Decide whether we can define 'extern inline' functions in headers.  */
 #if __GNUC_PREREQ (2, 7) && defined __OPTIMIZE__ \
     && !defined __OPTIMIZE_SIZE__ && !defined __NO_INLINE__ \
-    && defined __extern_inline
+    && defined __extern_inline && !(defined __clang__ && defined _LIBC)
 # define __USE_EXTERN_INLINES  1
 #endif