From patchwork Tue Jul 5 14:29:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 13659 Received: (qmail 100310 invoked by alias); 5 Jul 2016 14:29:41 -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 100274 invoked by uid 89); 5 Jul 2016 14:29:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_50, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=8897, 8898, 1096, T X-HELO: mail-qk0-f172.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=HvCC3ZKIRVlB3oKYJVGDsBr5w1E54xHBp61J5yv5CA4=; b=ecWw5/6Ww5XiSi6Ti/TuiePgjWRgURHBfe/+CLbsI9nFlvSQA+9s91bXFaHZRemZ/h DLTUYMMF4MnVRMiiF3ll2CvopOtMjVmpt5cR6qPlitf+wep8PYOKSnS/CP9ej6ERe5Ee 7+OZEHy6cyBUKjWkpV6UZKw6dvE4WixufKjkcNg1GeWpjX5rOUgiJZyJM8QcDrSjZHUF NAsnch7S7XTklFU+NXpK/mmAlFzk//VJqriHOacQDQrqRuSIoEl/CPuyA0rHBpW/z5X9 c3rK+9wSnHhNmXVi57M4QE93Ojjum7Pu0NV+K3AGQmexs9YqSbU/LkJslNafsm2oW1Ki +7Tg== X-Gm-Message-State: ALyK8tIUggrjWDE1BBv80pCYaYz1ocLx6JrYW2D4XFzfRUAOKd2ZUa56YnQf3LI+XEVJObFyBA7/hA9/kzEGsg== X-Received: by 10.55.144.69 with SMTP id s66mr22569745qkd.6.1467728972959; Tue, 05 Jul 2016 07:29:32 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20160705011145.GV4685@vapier.lan> References: <20160630165739.GA2465@intel.com> <20160705011145.GV4685@vapier.lan> From: "H.J. Lu" Date: Tue, 5 Jul 2016 07:29:32 -0700 Message-ID: Subject: Re: [PATCH] [BZ #20314] Make copies of cstdlib/cmath and use them To: GNU C Library On Mon, Jul 4, 2016 at 6:11 PM, Mike Frysinger wrote: > On 30 Jun 2016 09:57, H.J. Lu wrote: >> + | grep cstdlib: | sed -e "s/:$$//") > > | sed -n "/cstdlib:/{s/:$$//;p}") > -mike Here is the updated patch. OK for master? From 5763e9ea9e24fcae56c0aeef6bb745938c492511 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Thu, 30 Jun 2016 06:56:19 -0700 Subject: [PATCH] Make copies of cstdlib/cmath and use them If C++ headers or are used, GCC 6 will include /usr/include/stdlib.h or /usr/include/math.h from "#include_next" (instead of stdlib/stdlib.h or math/math.h in the glibc source directory), and this turns up as a make dependency. An implicit rule will kick in and make will try to install stdlib/stdlib.h or math/math.h as /usr/include/stdlib.h or /usr/include/math.h because the target is out of date. We make a copy of and in the glibc build directory so that stdlib/stdlib.h and math/math.h will be used instead of /usr/include/stdlib.h and /usr/include/math.h. [BZ #20314] * Makeconfig (CXXFLAGS): Prepend -I$(common-objpfx). * Makerules (before-compile): Add $(common-objpfx)cstdlib and $(common-objpfx)cmath. ($(common-objpfx)cstdlib): New target. ($(common-objpfx)cmath): Likewise. --- Makeconfig | 3 ++- Makerules | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/Makeconfig b/Makeconfig index 901e253..03fd89c 100644 --- a/Makeconfig +++ b/Makeconfig @@ -889,7 +889,8 @@ override CFLAGS = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \ $(CFLAGS-$(@F)) $(tls-model) \ $(foreach lib,$(libof-$(basename $(@F))) \ $(libof-$( or are used, GCC 6 will include +# /usr/include/stdlib.h or /usr/include/math.h from "#include_next" +# (instead of stdlib/stdlib.h or math/math.h in the glibc source +# directory), and this turns up as a make dependency. An implicit +# rule will kick in and make will try to install stdlib/stdlib.h or +# math/math.h as /usr/include/stdlib.h or /usr/include/math.h because +# the target is out of date. We make a copy of and +# in the glibc build directory so that stdlib/stdlib.h and math/math.h +# will be used instead of /usr/include/stdlib.h and /usr/include/math.h. +before-compile := $(common-objpfx)cstdlib $(common-objpfx)cmath \ + $(before-compile) +cstdlib=$(shell echo "\#include " | $(CXX) -M -MP -x c++ - \ + | sed -n "/cstdlib:/{s/:$$//;p}") +$(common-objpfx)cstdlib: $(cstdlib) + $(INSTALL_DATA) $< $@T + $(move-if-change) $@T $@ +cmath=$(shell echo "\#include " | $(CXX) -M -MP -x c++ - \ + | sed -n "/cmath:/{s/:$$//;p}") +$(common-objpfx)cmath: $(cmath) + $(INSTALL_DATA) $< $@T + $(move-if-change) $@T $@ +endif + before-compile := $(common-objpfx)libc-abis.h $(before-compile) $(common-objpfx)libc-abis.h: $(common-objpfx)libc-abis.stamp; @: $(common-objpfx)libc-abis.stamp: $(..)scripts/gen-libc-abis \ -- 2.7.4