From 5b55c60163f4c99301c4c8fe2504a195620d828a Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 13 Jun 2017 04:30:26 -0700
Subject: [PATCH] Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]
<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]
* configure.ac (find_cxx_header): Use "\,$1," with sed.
(CXX_CSTDLIB_HEADER): Also make a copy of <bits/std_abs.h>.
* configure: Regenerated.
---
configure | 5 ++++-
configure.ac | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
@@ -5336,9 +5336,12 @@ 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)"
+ # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
+ # including /usr/include/stdlib.h.
+ CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"
CXX_CMATH_HEADER="$(find_cxx_header cmath)"
fi
@@ -1187,9 +1187,12 @@ 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)"
+ # Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
+ # including /usr/include/stdlib.h.
+ CXX_CSTDLIB_HEADER="$CXX_CSTDLIB_HEADER $(find_cxx_header bits/std_abs.h)"
CXX_CMATH_HEADER="$(find_cxx_header cmath)"
fi
AC_SUBST(CXX_CSTDLIB_HEADER)
--
2.9.4