From patchwork Thu Sep 7 17:26:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 22704 Received: (qmail 26930 invoked by alias); 7 Sep 2017 17:29:26 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 26910 invoked by uid 89); 7 Sep 2017 17:29:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=t, T X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-qk0-f181.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=bYU9iyJqCSQcPT5Gr0BNLQ4GWCDGIf+/H/iwCzsbrGw=; b=BMN0S7QcLcs47b0R4LTBe2HkR551SDRqi+zfdQNQaXb9aoOyhVhg0taUzSQX4wuwO7 eJfwtH3v3YGpR1rrBZbUiDugXoWxDc482on/8qXBwz0LM3sUH/7aGJPPzHHaXvKLcOyN 1bqvHQ6iyoXgclahR718ZvtVf5xUBIyjujOG/gasTgLLXUhCoGN2Lho2b/+YQp03BFQt UJK5w4nGK1TlqVegQlppsXKf8Raa+36tB8bsbuoymuUTzcJGMMgpo1RaoOIkdkpz+n3y Lsv/5KDF86upQCTLGVJ8yjwHxJgOYLWCf2+KyRdNHyGA6pGRzzUmdMBqA1qCsIPR3M7W GIWQ== X-Gm-Message-State: AHPjjUi9EqNGu+llbYsU22eSuHjzAXp37fjvH7qnLcYZgwEIAmvm20SY nOZVAMlFiUoQkuobcvhD12su90lE/w== X-Google-Smtp-Source: ADKCNb5EHpv5P+LCr0yENPw3hCiMvTWsc96qhM/qlV4+9UVaeAT5rTx/dIfLqPYBe3twVcec3GVxdPcOq2veVCT8An8= X-Received: by 10.55.23.13 with SMTP id i13mr64015qkh.237.1504805210184; Thu, 07 Sep 2017 10:26:50 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20170613113813.GA7656@gmail.com> <230d2cab-8085-bb7e-68cc-38de409397a7@redhat.com> From: "H.J. Lu" Date: Thu, 7 Sep 2017 10:26:49 -0700 Message-ID: Subject: Re: [PATCH] Make copy of from GCC 7 [BZ #21573] To: Florian Weimer , Libc-stable Mailing List Cc: Andreas Schwab , GNU C Library On Tue, Jun 13, 2017 at 1:21 PM, H.J. Lu wrote: > On Tue, Jun 13, 2017 at 1:13 PM, Florian Weimer 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 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? From a746c011f8b6bb7ffae39258d7e3b24e8b5cde40 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 13 Jun 2017 09:28:14 -0700 Subject: [PATCH] Make copy of from GCC 7 [BZ #21573] 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 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 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