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