This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.27.9000-115-gf5d1f62


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f5d1f629c693bc30ccc8ff1246cb37986c1adb1c (commit)
      from  54412d20618b7b93f136a168e788573575f8a7a6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f5d1f629c693bc30ccc8ff1246cb37986c1adb1c

commit f5d1f629c693bc30ccc8ff1246cb37986c1adb1c
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Feb 23 11:29:27 2018 -0800

    Define GEN_AS_CONST_HEADERS when generating header files [BZ #22792]
    
    Glibc build generates header files to define constants from special .sym
    files.  If a .sym file includes the same header file which it generates,
    it leads to circular dependency which may lead to build hang on a
    many-core machine.  Define GEN_AS_CONST_HEADERS when generating header
    files to avoid circular dependency.
    
    <tcb-offsets.h> is needed for i686 and it isn't needed for x86-64 at
    least since glibc 2.23.
    
    Tested on i686 and x86-64.
    
    	[BZ #22792]
    	* Makerules ($(common-objpfx)%.h): Pass -DGEN_AS_CONST_HEADERS
    	to $(CC).
    	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Include
    	<tcb-offsets.h> only if GEN_AS_CONST_HEADERS isn't defined.
    	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't include
    	<tcb-offsets.h>.

diff --git a/ChangeLog b/ChangeLog
index e14f3d8..66e9c5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-02-23  H.J. Lu  <hongjiu.lu@intel.com>
+
+	[BZ #22792]
+	* Makerules ($(common-objpfx)%.h): Pass -DGEN_AS_CONST_HEADERS
+	to $(CC).
+	* sysdeps/unix/sysv/linux/i386/lowlevellock.h: Include
+	<tcb-offsets.h> only if GEN_AS_CONST_HEADERS isn't defined.
+	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't include
+	<tcb-offsets.h>.
+
 2018-02-23  Joseph Myers  <joseph@codesourcery.com>
 
 	[BZ #15105]
diff --git a/Makerules b/Makerules
index ef6abea..b2c2724 100644
--- a/Makerules
+++ b/Makerules
@@ -276,10 +276,17 @@ ifdef gen-as-const-headers
 # Generating headers for assembly constants.
 # We need this defined early to get into before-compile before
 # it's used in sysd-rules, below.
+# Define GEN_AS_CONST_HEADERS to avoid circular dependency [BZ #22792].
+# NB: <tcb-offsets.h> is generated from tcb-offsets.sym to define
+# offsets and sizes of types in <tls.h> and maybe <pthread.h> which
+# may include <tcb-offsets.h>.  Target header files can check if
+# GEN_AS_CONST_HEADERS is defined to avoid circular dependency which
+# may lead to build hang on a many-core machine.
 $(common-objpfx)%.h $(common-objpfx)%.h.d: $(..)scripts/gen-as-const.awk \
 					   %.sym $(common-before-compile)
 	$(AWK) -f $< $(filter %.sym,$^) \
-	| $(CC) -S -o $(@:.h.d=.h)T3 $(CFLAGS) $(CPPFLAGS) -x c - \
+	| $(CC) -S -o $(@:.h.d=.h)T3 $(CFLAGS) $(CPPFLAGS) \
+		-DGEN_AS_CONST_HEADERS -x c - \
 		-MD -MP -MF $(@:.h=.h.d)T -MT '$(@:.h=.h.d) $(@:.h.d=.h)'
 	sed -n 's/^.*@@@name@@@\([^@]*\)@@@value@@@[^0-9Xxa-fA-F-]*\([0-9Xxa-fA-F-][0-9Xxa-fA-F-]*\).*@@@end@@@.*$$/#define \1 \2/p' \
 		$(@:.h.d=.h)T3 > $(@:.h.d=.h)T
diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
index fb59b57..38fbc25 100644
--- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h
@@ -26,7 +26,14 @@
 # include <sys/param.h>
 # include <bits/pthreadtypes.h>
 # include <kernel-features.h>
-# include <tcb-offsets.h>
+/* <tcb-offsets.h> is generated from tcb-offsets.sym to define offsets
+   and sizes of types in <tls.h> as well as <pthread.h> which includes
+   <lowlevellock.h> via nptl/descr.h.  Don't include <tcb-offsets.h>
+   when generating <tcb-offsets.h> to avoid circular dependency which
+   may lead to build hang on a many-core machine.  */
+# ifndef GEN_AS_CONST_HEADERS
+#  include <tcb-offsets.h>
+# endif
 
 # ifndef LOCK_INSTR
 #  ifdef UP
diff --git a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
index a8bcfbe..eedb6fc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
+++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h
@@ -26,7 +26,6 @@
 # include <sys/param.h>
 # include <bits/pthreadtypes.h>
 # include <kernel-features.h>
-# include <tcb-offsets.h>
 
 # ifndef LOCK_INSTR
 #  ifdef UP

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |   10 ++++++++++
 Makerules                                     |    9 ++++++++-
 sysdeps/unix/sysv/linux/i386/lowlevellock.h   |    9 ++++++++-
 sysdeps/unix/sysv/linux/x86_64/lowlevellock.h |    1 -
 4 files changed, 26 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]