From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id BDB2A3857B98; Thu, 9 Feb 2023 19:45:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BDB2A3857B98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675971951; bh=aabOWi4Og50i+ITbx470ZBXcqWyKc+pUSnnxjXr2dcE=; h=From:To:Subject:Date:From; b=U/DjQXLioS/NaUw05/yCOWTGUSQvU3ry/OP8oZ4l4dxuCiwckB5Z+PuCLjF0PgEHT pFPI6ONMUOtxPqQ+QWFArKxueRD2bkDvW7s8YTmm7J70JEwoVFuHaK782efnaW6qjc 0VqJcfmbydOWQBTbxzLTtiJsP1zhRLBK4xg1BTMo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/azanella/clang] Disable __USE_EXTERN_INLINES for clang X-Act-Checkin: glibc X-Git-Author: Fangrui Song X-Git-Refname: refs/heads/azanella/clang X-Git-Oldrev: e8cc8c769deb75adbf027024489a8c3a79a6e814 X-Git-Newrev: 54e2ce20f29f8c0fb64ee5e0b6e7427109f955a3 Message-Id: <20230209194551.BDB2A3857B98@sourceware.org> Date: Thu, 9 Feb 2023 19:45:51 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=54e2ce20f29f8c0fb64ee5e0b6e7427109f955a3 commit 54e2ce20f29f8c0fb64ee5e0b6e7427109f955a3 Author: Fangrui Song Date: Thu Oct 7 18:16:04 2021 -0700 Disable __USE_EXTERN_INLINES for clang 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. Diff: --- include/features.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/features.h b/include/features.h index 26534f2b52..33eeb46a0a 100644 --- a/include/features.h +++ b/include/features.h @@ -503,7 +503,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