* Re: [PATCH] Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]
[not found] ` <CAMe9rOpfGr_BNFB3k5Dw3h_a=jnBrQL_e44y_+Zc8gzw16a+9A@mail.gmail.com>
@ 2017-01-01 0:00 ` H.J. Lu
2017-01-01 0:00 ` H.J. Lu
0 siblings, 1 reply; 2+ messages in thread
From: H.J. Lu @ 2017-01-01 0:00 UTC (permalink / raw)
To: Florian Weimer, Libc-stable Mailing List; +Cc: Andreas Schwab, GNU C Library
[-- Attachment #1: Type: text/plain, Size: 882 bytes --]
On Tue, Jun 13, 2017 at 1:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer <fweimer@redhat.com> wrote:
>> On 06/13/2017 01:54 PM, H.J. Lu wrote:
>>> - 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)"
>>
>> I think the attached patch is needed to suppress the error message if
>> the header does not exist. (Regenerated configure file not shown in the
>> patch.)
>>
>
> LGTM.
>
Here is a patch to backport these 2 patches to 2.25 branch. Any
comments?
--
H.J.
[-- Attachment #2: 0001-Make-copy-of-bits-std_abs.h-from-GCC-7-BZ-21573.patch --]
[-- Type: text/x-patch, Size: 4059 bytes --]
From a746c011f8b6bb7ffae39258d7e3b24e8b5cde40 Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 13 Jun 2017 09:28:14 -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.
* configure.ac (find_cxx_header): Suppress compiler error message.
* configure: Regenerated.
[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.
(cherry picked from commit a65ea28d1833d3502c5070472e43bda04410e6b5 and
commit c2528fef3b05bcffb1ac27c6c09cc3ff24b7f03f)
---
Makerules | 8 ++++++++
config.make.in | 1 +
configure | 6 +++++-
configure.ac | 5 ++++-
4 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/Makerules b/Makerules
index 7403305d30..43343f03ee 100644
--- a/Makerules
+++ b/Makerules
@@ -127,6 +127,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)
diff --git a/config.make.in b/config.make.in
index 5836b32a72..709527da4f 100644
--- a/config.make.in
+++ b/config.make.in
@@ -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@
diff --git a/configure b/configure
index eecd0ace74..ee637a7caf 100755
--- 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
@@ -5318,14 +5319,17 @@ 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++ - 2>/dev/null \
+ | 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
diff --git a/configure.ac b/configure.ac
index 4a77411b71..d288ff43cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1176,13 +1176,16 @@ 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++ - 2>/dev/null \
+ | 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.
--
2.13.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573]
2017-01-01 0:00 ` [PATCH] Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573] H.J. Lu
@ 2017-01-01 0:00 ` H.J. Lu
0 siblings, 0 replies; 2+ messages in thread
From: H.J. Lu @ 2017-01-01 0:00 UTC (permalink / raw)
To: Florian Weimer, Libc-stable Mailing List; +Cc: Andreas Schwab, GNU C Library
On Thu, Sep 7, 2017 at 10:26 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Jun 13, 2017 at 1:21 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer <fweimer@redhat.com> wrote:
>>> On 06/13/2017 01:54 PM, H.J. Lu wrote:
>>>> - 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)"
>>>
>>> I think the attached patch is needed to suppress the error message if
>>> the header does not exist. (Regenerated configure file not shown in the
>>> patch.)
>>>
>>
>> LGTM.
>>
>
> Here is a patch to backport these 2 patches to 2.25 branch. Any
> comments?
>
I am checking it into 2.25 branch.
--
H.J.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-09-11 15:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20170613113813.GA7656@gmail.com>
[not found] ` <mvm4lvkktdq.fsf@suse.de>
[not found] ` <CAMe9rOp-VNbKJJhvBwT12OJ0Qcu2_DMhKEH855GOpA9CsZcZ3w@mail.gmail.com>
[not found] ` <mvmzidcjekn.fsf@suse.de>
[not found] ` <CAMe9rOoXF7-40n-n7z8JdNeyc6CBPYk1AeK73KT_pmBvDdxAcQ@mail.gmail.com>
[not found] ` <230d2cab-8085-bb7e-68cc-38de409397a7@redhat.com>
[not found] ` <CAMe9rOpfGr_BNFB3k5Dw3h_a=jnBrQL_e44y_+Zc8gzw16a+9A@mail.gmail.com>
2017-01-01 0:00 ` [PATCH] Make copy of <bits/std_abs.h> from GCC 7 [BZ #21573] H.J. Lu
2017-01-01 0:00 ` H.J. Lu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).