]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]
authorH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Jun 2017 16:28:14 +0000 (09:28 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 13 Jun 2017 17:53:45 +0000 (10:53 -0700)
<bits/std_abs.h> from GCC 7 will include /usr/include/stdlib.h from
"#include_next" (instead of stdlib/stdlib.h in the glibc source
directory), and this turns up as a make dependency.  Also make a copy
of <bits/std_abs.h> to prevent it from including /usr/include/stdlib.h.

[BZ #21573]
* Makerules [$(c++-bits-std_abs-h) != ""] (before-compile): Add
$(common-objpfx)bits/std_abs.h.
[$(c++-bits-std_abs-h) != ""] ($(common-objpfx)bits/std_abs.h):
New target.
* config.make.in (c++-bits-std_abs-h): New.
* configure.ac (find_cxx_header): Use "\,$1," with sed.
(CXX_BITS_STD_ABS_H): New.
(AC_SUBST(CXX_BITS_STD_ABS_H)): Likewise.
* configure: Regenerated.

ChangeLog
Makerules
config.make.in
configure
configure.ac

index a6978e644d01745c0249844911599c8eed9a1b2d..52ffaf82e17b2eacfa791ee4183adc58d4662916 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2017-06-13  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #21573]
+       * Makerules [$(c++-bits-std_abs-h) != ""] (before-compile): Add
+       $(common-objpfx)bits/std_abs.h.
+       [$(c++-bits-std_abs-h) != ""] ($(common-objpfx)bits/std_abs.h):
+       New target.
+       * config.make.in (c++-bits-std_abs-h): New.
+       * configure.ac (find_cxx_header): Use "\,$1," with sed.
+       (CXX_BITS_STD_ABS_H): New.
+       (AC_SUBST(CXX_BITS_STD_ABS_H)): Likewise.
+       * configure: Regenerated.
+
 2017-06-13  Zack Weinberg  <zackw@panix.com>
 
        * posix/bits/cpu-set.h: Correct indentation of preprocessor
index 7656c492da55b73632961cc212a098674fba3e62..f91a4c5d66f0b7837353fb3784a9e99c49474b11 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -134,6 +134,14 @@ $(common-objpfx)cstdlib: $(c++-cstdlib-header)
 $(common-objpfx)cmath: $(c++-cmath-header)
        $(INSTALL_DATA) $< $@T
        $(move-if-change) $@T $@
+ifneq (,$(c++-bits-std_abs-h))
+# Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
+# including /usr/include/stdlib.h.
+before-compile := $(common-objpfx)bits/std_abs.h $(before-compile)
+$(common-objpfx)bits/std_abs.h: $(c++-bits-std_abs-h)
+       $(INSTALL_DATA) $< $@T
+       $(move-if-change) $@T $@
+endif
 endif
 
 before-compile := $(common-objpfx)libc-abis.h $(before-compile)
index d08a462d05bb85e76ff422f46f5b1a184f2975bf..dadabf9b6af53234b818f8d3bfbe28f64cb030fe 100644 (file)
@@ -47,6 +47,7 @@ sysincludes = @SYSINCLUDES@
 c++-sysincludes = @CXX_SYSINCLUDES@
 c++-cstdlib-header = @CXX_CSTDLIB_HEADER@
 c++-cmath-header = @CXX_CMATH_HEADER@
+c++-bits-std_abs-h = @CXX_BITS_STD_ABS_H@
 all-warnings = @all_warnings@
 enable-werror = @enable_werror@
 
index 422482f3557c2842401eb5d6b4abcbf9dada45ba..ceb53949baaee26bb2124f40f64a95d0fab85434 100755 (executable)
--- a/configure
+++ b/configure
@@ -634,6 +634,7 @@ BISON
 INSTALL_INFO
 PERL
 BASH_SHELL
+CXX_BITS_STD_ABS_H
 CXX_CMATH_HEADER
 CXX_CSTDLIB_HEADER
 CXX_SYSINCLUDES
@@ -5336,14 +5337,16 @@ fi
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+  CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
 fi
 
 
 
+
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.
 # LD_LIBRARY_PATH contains the current directory if one of the following
index 7f430425aecdc01ee337d27d86e46d807f6f6862..d74bd4490c1b2089dee3918b7d807eb990352805 100644 (file)
@@ -1187,13 +1187,15 @@ AC_SUBST(CXX_SYSINCLUDES)
 # copy of those headers in Makerules.
 if test -n "$CXX"; then
   find_cxx_header () {
-    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "/$1:/{s/:\$//;p}"
+    echo "#include <$1>" | $CXX -M -MP -x c++ - | sed -n "\,$1:,{s/:\$//;p}"
   }
   CXX_CSTDLIB_HEADER="$(find_cxx_header cstdlib)"
   CXX_CMATH_HEADER="$(find_cxx_header cmath)"
+  CXX_BITS_STD_ABS_H="$(find_cxx_header bits/std_abs.h)"
 fi
 AC_SUBST(CXX_CSTDLIB_HEADER)
 AC_SUBST(CXX_CMATH_HEADER)
+AC_SUBST(CXX_BITS_STD_ABS_H)
 
 # Test if LD_LIBRARY_PATH contains the notation for the current directory
 # since this would lead to problems installing/building glibc.