00db10
Allows testing of AVX512 changes in a chroot (normally as root)
00db10
without build issues.
00db10
00db10
commit d7e06450b9d730d7b62ba52f611585810fa902df
00db10
Author: Carlos O'Donell <carlos@redhat.com>
00db10
Date:   Tue Jul 16 17:55:43 2013 -0400
00db10
00db10
    BZ #15711: Avoid circular dependency for syscall.h
00db10
    
00db10
    The generated header is compiled with `-ffreestanding' to avoid any
00db10
    circular dependencies against the installed implementation headers.
00db10
    Such a dependency would require the implementation header to be
00db10
    installed before the generated header could be built (See bug 15711).
00db10
    In current practice the generated header dependencies do not include
00db10
    any of the implementation headers removed by the use of `-ffreestanding'.
00db10
    
00db10
    ---
00db10
    
00db10
    2013-07-15  Carlos O'Donell  <carlos@redhat.com>
00db10
    
00db10
        [BZ #15711]
00db10
        * sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h):
00db10
        Avoid system header dependency with -ffreestanding.
00db10
        ($(objpfx)bits/syscall%d): Likewise.
00db10
00db10
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
00db10
index f580635..94916a2 100644
00db10
--- a/sysdeps/unix/sysv/linux/Makefile
00db10
+++ b/sysdeps/unix/sysv/linux/Makefile
00db10
@@ -50,6 +50,13 @@ tests += tst-clone
00db10
 # be the condition for those options to use in a C #if condition.
00db10
 # abi-includes may be defined to a list of headers to include
00db10
 # in the generated header, if the default does not suffice.
00db10
+#
00db10
+# The generated header is compiled with `-ffreestanding' to avoid any
00db10
+# circular dependencies against the installed implementation headers.
00db10
+# Such a dependency would require the implementation header to be
00db10
+# installed before the generated header could be built (See bug 15711).
00db10
+# In current practice the generated header dependencies do not include
00db10
+# any of the implementation headers removed by the use of `-ffreestanding'.
00db10
 
00db10
 $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
00db10
 	$(make-target-directory)
00db10
@@ -64,7 +71,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/
00db10
 	 echo ''; \
00db10
 	 $(if $(abi-variants), \
00db10
 	 $(foreach v,$(abi-variants),\
00db10
-	 $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
00db10
+	 $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
00db10
 	       -x c $(sysincludes) $< $(abi-$(v)-options) \
00db10
 	       -D_LIBC -dM | \
00db10
 	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
00db10
@@ -75,7 +82,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/
00db10
 	 $(if $(abi-$(v)-condition),echo '#endif';) \
00db10
 	 rm -f $(@:.d=.h).new$(v); \
00db10
 	 ), \
00db10
-	 $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
00db10
+	 $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
00db10
 	       -x c $(sysincludes) $< \
00db10
 	       -D_LIBC -dM | \
00db10
 	 sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \