From f5d1f629c693bc30ccc8ff1246cb37986c1adb1c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Fri, 23 Feb 2018 11:29:27 -0800 Subject: 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. 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 only if GEN_AS_CONST_HEADERS isn't defined. * sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Don't include . --- sysdeps/unix/sysv/linux/i386/lowlevellock.h | 9 ++++++++- sysdeps/unix/sysv/linux/x86_64/lowlevellock.h | 1 - 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'sysdeps') diff --git a/sysdeps/unix/sysv/linux/i386/lowlevellock.h b/sysdeps/unix/sysv/linux/i386/lowlevellock.h index fb59b57934..38fbc2556f 100644 --- a/sysdeps/unix/sysv/linux/i386/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/i386/lowlevellock.h @@ -26,7 +26,14 @@ # include # include # include -# include +/* is generated from tcb-offsets.sym to define offsets + and sizes of types in as well as which includes + via nptl/descr.h. Don't include + when generating to avoid circular dependency which + may lead to build hang on a many-core machine. */ +# ifndef GEN_AS_CONST_HEADERS +# include +# 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 a8bcfbe4a3..eedb6fc990 100644 --- a/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h +++ b/sysdeps/unix/sysv/linux/x86_64/lowlevellock.h @@ -26,7 +26,6 @@ # include # include # include -# include # ifndef LOCK_INSTR # ifdef UP -- cgit v1.2.3-70-g09d2