BZ #15711: Avoid circular dependency for syscall.h
authorCarlos O'Donell <carlos@redhat.com>
Tue, 16 Jul 2013 21:55:43 +0000 (17:55 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Tue, 16 Jul 2013 21:55:43 +0000 (17:55 -0400)
The generated header is compiled with `-ffreestanding' to avoid any
circular dependencies against the installed implementation headers.
Such a dependency would require the implementation header to be
installed before the generated header could be built (See bug 15711).
In current practice the generated header dependencies do not include
any of the implementation headers removed by the use of `-ffreestanding'.

---

2013-07-15  Carlos O'Donell  <carlos@redhat.com>

[BZ #15711]
* sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h):
Avoid system header dependency with -ffreestanding.
($(objpfx)bits/syscall%d): Likewise.

ChangeLog
NEWS
sysdeps/unix/sysv/linux/Makefile

index df08a3d..d3e6693 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-07-15  Carlos O'Donell  <carlos@redhat.com>
+
+       [BZ #15711]
+       * sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h):
+       Avoid system header dependency with -ffreestanding.
+       ($(objpfx)bits/syscall%d): Likewise.
+
 2013-07-13  David S. Miller  <davem@davemloft.net>
 
        * math/libm-test.inc (casin_test_data): Annotate more cases of missing
diff --git a/NEWS b/NEWS
index 56ce7ef..c39157d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,7 @@ Version 2.18
   15395, 15405, 15406, 15409, 15416, 15418, 15419, 15423, 15424, 15426,
   15429, 15431, 15432, 15441, 15442, 15448, 15465, 15480, 15485, 15488,
   15490, 15492, 15493, 15497, 15506, 15529, 15536, 15553, 15577, 15583,
-  15618, 15627, 15631, 15654, 15655, 15666, 15667, 15674.
+  15618, 15627, 15631, 15654, 15655, 15666, 15667, 15674, 15711.
 
 * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
   #15078).
index f580635..94916a2 100644 (file)
@@ -50,6 +50,13 @@ tests += tst-clone
 # be the condition for those options to use in a C #if condition.
 # abi-includes may be defined to a list of headers to include
 # in the generated header, if the default does not suffice.
+#
+# The generated header is compiled with `-ffreestanding' to avoid any
+# circular dependencies against the installed implementation headers.
+# Such a dependency would require the implementation header to be
+# installed before the generated header could be built (See bug 15711).
+# In current practice the generated header dependencies do not include
+# any of the implementation headers removed by the use of `-ffreestanding'.
 
 $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/syscall.h
        $(make-target-directory)
@@ -64,7 +71,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/
         echo ''; \
         $(if $(abi-variants), \
         $(foreach v,$(abi-variants),\
-        $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
+        $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
               -x c $(sysincludes) $< $(abi-$(v)-options) \
               -D_LIBC -dM | \
         sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \
@@ -75,7 +82,7 @@ $(objpfx)bits/syscall%h $(objpfx)bits/syscall%d: ../sysdeps/unix/sysv/linux/sys/
         $(if $(abi-$(v)-condition),echo '#endif';) \
         rm -f $(@:.d=.h).new$(v); \
         ), \
-        $(CC) -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
+        $(CC) -ffreestanding -E -MD -MP -MF $(@:.h=.d)-t$(v) -MT '$(@:.d=.h) $(@:.h=.d)' \
               -x c $(sysincludes) $< \
               -D_LIBC -dM | \
         sed -n 's@^#define __NR_\([^ ]*\) .*$$@#define SYS_\1 __NR_\1@p' | \