public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org, Fangrui Song <maskray@google.com>
Subject: [PATCH v2 1/4] Disable __USE_EXTERN_INLINES for clang
Date: Wed,  2 Nov 2022 11:55:56 -0300	[thread overview]
Message-ID: <20221102145559.1962008-2-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20221102145559.1962008-1-adhemerval.zanella@linaro.org>

From: Fangrui Song <maskray@google.com>

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.
---
 include/features.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/features.h b/include/features.h
index 123de9fd47..4a3fe34267 100644
--- a/include/features.h
+++ b/include/features.h
@@ -502,7 +502,7 @@
 /* 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
 
-- 
2.34.1


  reply	other threads:[~2022-11-02 14:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 14:55 [PATCH v2 0/4] Initial fixes for clang build support Adhemerval Zanella
2022-11-02 14:55 ` Adhemerval Zanella [this message]
2022-11-02 14:55 ` [PATCH v2 2/4] Rewrite find_cxx_header config configure.ac Adhemerval Zanella
2022-11-06 23:31   ` Fangrui Song
2022-11-07 13:22   ` Florian Weimer
2022-11-07 13:36     ` Adhemerval Zanella Netto
2022-11-02 14:55 ` [PATCH v2 3/4] stdlib: Remove if inline asm context casts if compiler does not support it Adhemerval Zanella
2022-11-02 14:55 ` [PATCH v2 4/4] Apply asm redirection in gmp.h before first use Adhemerval Zanella
2022-11-06 23:33   ` Fangrui Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221102145559.1962008-2-adhemerval.zanella@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.org \
    --cc=maskray@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).