From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 4FD783853D0E; Wed, 30 Aug 2023 12:33:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4FD783853D0E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1693398836; bh=TpFfnBkN0Hbza5A/EHCTRV1RbWN1jNZABrrDUxlTXeE=; h=From:To:Subject:Date:From; b=fJWMDrXmiGo9pwjocSEJJKDSq7hFWTYy/cY23N0E1kAWTb9WibEiBo+XnbMZqCEVU EB/JpYgvC/Q8WCqQUsHVGVJety01Yryo/yQjoGb7+L2E68cZEtBBRt3ovfK/CENzwu BVJj0aKIe+jhCydHyYVZxzmghB2VWkBXozQtFuvY= 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: d04d5b8b656dc091710a028091fa1cdffbf5b0c2 X-Git-Newrev: 45233d45600cc588c393a84e7e5af9e139ba733d Message-Id: <20230830123356.4FD783853D0E@sourceware.org> Date: Wed, 30 Aug 2023 12:33:56 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=45233d45600cc588c393a84e7e5af9e139ba733d commit 45233d45600cc588c393a84e7e5af9e139ba733d 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 7c51b4a2e4..a94fc1b3a4 100644 --- a/include/features.h +++ b/include/features.h @@ -515,7 +515,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