From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 82653 invoked by alias); 15 Feb 2017 11:32:46 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 82638 invoked by uid 89); 15 Feb 2017 11:32:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=U*thomas.preudhomme, Preud'homme, thomas.preudhomme@arm.com, preud'homme X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 15 Feb 2017 11:32:35 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DC6DF2B for ; Wed, 15 Feb 2017 03:32:34 -0800 (PST) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8CE793F2E5 for ; Wed, 15 Feb 2017 03:32:34 -0800 (PST) To: newlib@sourceware.org From: Thomas Preudhomme Subject: [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps Message-ID: Date: Wed, 15 Feb 2017 11:32:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3E26F6989548E90CC5A48BC8" X-IsSubscribed: yes X-SW-Source: 2017/txt/msg00146.txt.bz2 This is a multi-part message in MIME format. --------------3E26F6989548E90CC5A48BC8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 841 Hi, it turns out that the changes in af272aca591fe1dc0f1be64ae5bda147ea98a047 only works when using gcc/g++ with -E or -save-temps, otherwise newlib's newlib.h gets used even if -specs=nano.specs is specified [1]. This is because the driver only use cpp_options spec for the external cpp tool, not for the integrated one. [1] Guess the options I used to test the change... This patch uses instead cpp_unique_options which is used in all cases: it is used directly when the integrated preprocessor is used, and indirectly by expansion of cpp_options otherwise. Tested by running the following C program when building it with gcc or g++ with and without -specs=nano.specs and/or -save-temps: #include int main (void) { printf ("%x\n", sizeof (struct _reent)); return 0; } Is this ok for master? Best regards, Thomas --------------3E26F6989548E90CC5A48BC8 Content-Type: text/x-patch; name="fix_nano_specs.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="fix_nano_specs.patch" Content-length: 1377 >From 36d3da3126cf70a500b4ef54710569e414f7a7ea Mon Sep 17 00:00:00 2001 From: Thomas Preud'homme Date: Wed, 15 Feb 2017 10:51:54 +0000 Subject: [PATCH] Fix elf-nano.specs to work without -save-temps The changes in af272aca591fe1dc0f1be64ae5bda147ea98a047 only works when using gcc/g++ with -E or -save-temps, otherwise newlib's newlib.h gets used even if -specs=nano.specs is specified. This is because the driver only use cpp_options spec for the external cpp tool, not for the integrated one. This patch uses instead cpp_unique_options which is used in all cases: it is used directly when the integrated preprocessor is used, and indirectly by expansion of cpp_options otherwise. --- libgloss/arm/elf-nano.specs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libgloss/arm/elf-nano.specs b/libgloss/arm/elf-nano.specs index 324107e..82594bd 100644 --- a/libgloss/arm/elf-nano.specs +++ b/libgloss/arm/elf-nano.specs @@ -1,9 +1,9 @@ %rename link nano_link %rename link_gcc_c_sequence nano_link_gcc_c_sequence -%rename cpp_options nano_cpp_options +%rename cpp_unique_options nano_cpp_unique_options -*cpp_options: --isystem =/include/newlib-nano %(nano_cpp_options) +*cpp_unique_options: +-isystem =/include/newlib-nano %(nano_cpp_unique_options) *nano_libc: -lc_nano -- 1.9.1 --------------3E26F6989548E90CC5A48BC8--