Bug 1133508 - llvm-3.4.16 and newer does not (re-)build against glibc-2.19.90-32.fc21
Summary: llvm-3.4.16 and newer does not (re-)build against glibc-2.19.90-32.fc21
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 21
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1133301 (view as bug list)
Depends On:
Blocks: 1123103
TreeView+ depends on / blocked
 
Reported: 2014-08-25 10:48 UTC by David Sommerseth
Modified: 2016-11-24 12:03 UTC (History)
11 users (show)

Fixed In Version: glibc-2.20-3.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-17 10:56:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description David Sommerseth 2014-08-25 10:48:40 UTC
llvm-3.4.16 and newer does not build with glibc-2.19.90-32.fc21 installed.  The issue is related to the __extern_always_inline is no longer available when the compiler identifies itself as GCC 4.2 or older.  llvm/clang-3.4.16 needs this macro and identifies itself as GCC 4.2.

Propsal:
Allow #ifdef __clang__ to qualify for enabling the __extern_always_inline macro in sys/cdefs.h.

Comment 1 David Sommerseth 2014-08-25 11:39:16 UTC
A patch with the suggestion:

--- include/sys/cdefs.h	2014-08-25 11:37:25.980027701 +0000
+++ include/sys/cdefs.h-proposal	2014-08-25 11:37:07.070028122 +0000
@@ -319,7 +319,7 @@
 
 /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
    inline semantics, unless -fgnu89-inline is used.  */
-#if !defined __cplusplus || __GNUC_PREREQ (4,3)
+#if !defined __cplusplus || __GNUC_PREREQ (4,3) || defined __clang__
 # if defined __GNUC_STDC_INLINE__ || defined __cplusplus
 #  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
 #  define __extern_always_inline \

Comment 2 Jakub Jelinek 2014-09-01 10:22:56 UTC
What does it need the macro for?  That macro is only optionally defined, so all uses of it should be guarded.
Your patch doesn't look right to me, do all clang versions support the __gnu_inline__ attribute in C++?  As it has been only introduced in GCC 4.3, it is unclear if clang had that support from the very first release.

Comment 3 Siddhesh Poyarekar 2014-09-01 10:36:06 UTC
According to the earlier clang patch that we had accepted upstream (and then later reverted along with earlier patches in recently in Fedora), all clang versions that support __gnu_inline__ attribute export either __GNUC_STDC_INLINE__ or __GNUC_GNU_INLINE__.  The conditional in comment 1 is wrong, but maybe we could add another (untested) snippet:

#if !defined __extern_always_inline && defined __clang__
# if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
#  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
#  define __extern_always_inline \
  extern __always_inline __attribute__ ((__gnu_inline__))
# else
#  define __extern_inline extern __inline
#  define __extern_always_inline extern __always_inline
# endif
#endif

This ought to ensure that the gcc use case is unchanged and the clang use case remains as it was before.

Comment 4 Siddhesh Poyarekar 2014-09-16 10:26:14 UTC
I've posted a candidate patch upstream:

https://sourceware.org/ml/libc-alpha/2014-09/msg00375.html

Comment 5 Siddhesh Poyarekar 2014-09-16 17:18:32 UTC
Pushed build.  Please verify once it is done and post results.

http://koji.fedoraproject.org/koji/taskinfo?taskID=7593210

Comment 6 Siddhesh Poyarekar 2014-09-17 10:56:54 UTC
David confirmed offline that the patch helps build llvm successfully, so closing this bug with a build in f21 and f22.  Please reopen if you find and issues.

Comment 7 Fedora Update System 2014-09-17 16:37:32 UTC
glibc-2.20-2.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/glibc-2.20-2.fc21

Comment 8 Fedora Update System 2014-09-24 01:06:49 UTC
glibc-2.20-3.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/glibc-2.20-3.fc21

Comment 9 Fedora Update System 2014-09-27 09:58:16 UTC
glibc-2.20-3.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 10 Siddhesh Poyarekar 2015-03-11 10:48:50 UTC
*** Bug 1133301 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.