diff --git a/ChangeLog b/ChangeLog index e14f3d8764..66e9c5bbea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2018-02-23 H.J. Lu + + [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 + . + 2018-02-23 Joseph Myers [BZ #15105] diff --git a/Makerules b/Makerules index ef6abeac6d..b2c2724fcb 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: is generated from tcb-offsets.sym to define +# offsets and sizes of types in and maybe which +# may include . 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 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