From: Carlos O'Donell Date: Tue, 16 Jul 2013 21:55:43 +0000 (-0400) Subject: BZ #15711: Avoid circular dependency for syscall.h X-Git-Tag: glibc-2.18~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7e06450b9d730d7b62ba52f611585810fa902df;p=thirdparty%2Fglibc.git BZ #15711: Avoid circular dependency for syscall.h 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 [BZ #15711] * sysdeps/unix/sysv/linux/Makefile ($(objpfx)bits/syscall%h): Avoid system header dependency with -ffreestanding. ($(objpfx)bits/syscall%d): Likewise. --- diff --git a/ChangeLog b/ChangeLog index df08a3d8996..d3e66932ac3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-07-15 Carlos O'Donell + + [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 * math/libm-test.inc (casin_test_data): Annotate more cases of missing diff --git a/NEWS b/NEWS index 56ce7ef147d..c39157da612 100644 --- 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). diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index f580635c844..94916a2b13f 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -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' | \