public inbox for newlib@sourceware.org
 help / color / mirror / Atom feed
* [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps
@ 2017-02-15 11:32 Thomas Preudhomme
  2017-02-15 15:32 ` Corinna Vinschen
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Preudhomme @ 2017-02-15 11:32 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 841 bytes --]

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 <stdio.h>

int
main (void)
{
   printf ("%x\n", sizeof (struct _reent));
   return 0;
}


Is this ok for master?

Best regards,

Thomas

[-- Attachment #2: fix_nano_specs.patch --]
[-- Type: text/x-patch, Size: 1376 bytes --]

From 36d3da3126cf70a500b4ef54710569e414f7a7ea Mon Sep 17 00:00:00 2001
From: Thomas Preud'homme <thomas.preudhomme@arm.com>
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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps
  2017-02-15 11:32 [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps Thomas Preudhomme
@ 2017-02-15 15:32 ` Corinna Vinschen
  2017-02-15 15:50   ` Thomas Preudhomme
  0 siblings, 1 reply; 3+ messages in thread
From: Corinna Vinschen @ 2017-02-15 15:32 UTC (permalink / raw)
  To: newlib

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

On Feb 15 11:32, Thomas Preudhomme wrote:
> 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:

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps
  2017-02-15 15:32 ` Corinna Vinschen
@ 2017-02-15 15:50   ` Thomas Preudhomme
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Preudhomme @ 2017-02-15 15:50 UTC (permalink / raw)
  To: newlib

Thanks!

On 15/02/17 15:32, Corinna Vinschen wrote:
> On Feb 15 11:32, Thomas Preudhomme wrote:
>> 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:
>
> Pushed.
>
>
> Thanks,
> Corinna
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-15 15:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-15 11:32 [PATCH, newlib/ARM] Fix elf-nano.specs to work without -save-temps Thomas Preudhomme
2017-02-15 15:32 ` Corinna Vinschen
2017-02-15 15:50   ` Thomas Preudhomme

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).