From 2599016338e60ee13e85066a56a729eeee1d1c6a Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Wed, 6 Nov 2013 08:52:57 +0000 Subject: [PATCH] gcc.c (do_spec_1): Do not insert a space after a %* substitution unless... * gcc.c (do_spec_1): Do not insert a space after a %* substitution unless it is the last part of a spec substring. * doc/invoke.texi (Spec Files): Document space insertion behaviour of %*. From-SVN: r204446 --- gcc/ChangeLog | 7 +++++++ gcc/doc/invoke.texi | 42 +++++++++++++++++++++++++++++++++++------- gcc/gcc.c | 19 ++++++++++++++++--- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24d25df4d06..f5409b76151 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-11-06 Nick Clifton + + * gcc.c (do_spec_1): Do not insert a space after a %* substitution + unless it is the last part of a spec substring. + * doc/invoke.texi (Spec Files): Document space insertion + behaviour of %*. + 2013-11-06 Christian Bruel * gcc/config/sh/sh-mem.cc (sh_expand_cmpnstr, sh_expand_cmpstr): diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 863e518b96f..b933b2a58c0 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -10874,6 +10874,22 @@ appears somewhere in @code{X}, then @code{X} is substituted once for each matching switch, with the @code{%*} replaced by the part of that switch matching the @code{*}. +If @code{%*} appears as the last part of a spec sequence then a space +will be added after the end of the last substitution. If there is more +text in the sequence however then a space will not be generated. This +allows the @code{%*} substitution to be used as part of a larger +string. For example, a spec string like this: + +@smallexample +%@{mcu=*:--script=%*/memory.ld@} +@end smallexample + +when matching an option like @code{-mcu=newchip} will produce: + +@smallexample +--script=newchip/memory.ld +@end smallexample + @item %@{.@code{S}:@code{X}@} Substitutes @code{X}, if processing a file with suffix @code{S}. @@ -17791,10 +17807,6 @@ These options are defined for the MSP430: @table @gcctabopt -@item -msim -@opindex msim -Link the simulator runtime libraries. - @item -masm-hex @opindex masm-hex Force assembly output to always use hex constants. Normally such @@ -17803,9 +17815,25 @@ testsuite and/or aesthetic purposes. @item -mmcu= @opindex mmcu= -Select the MCU to target. Note that there are two ``generic'' MCUs, -@code{msp430} and @code{msp430x}, which should be used most of the -time. This option is also passed to the assembler. +Select the MCU to target. If the MCU supports the MSP430X ISA or the +MSP430Xv2 ISA then gcc will make use of the extra instructions. A C +preprocessor symbol will be defined based upon the MCU name, converted +to upper case and pre- and post- fixed with @code{__}. + +In addition two scripts will be added to the linker command line: +@code{memory.ld} and @code{peripherals.ld}, with a search path based +upon the MCU name. + +Note that there are three ``generic'' MCUs: @code{msp430}, +@code{msp430x} and @code{msp430xv2}, which can be used if a specific +MCU is not being targeted. + +This option is also passed on to the assembler. + +@item -msim +@opindex msim +Link to the simulator runtime libraries and linker script. Overrides +any scripts that would be selected by the @option{-mmcu=} option. @item -mlarge @opindex mlarge diff --git a/gcc/gcc.c b/gcc/gcc.c index 22982497a3b..83607e55f9e 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -388,7 +388,8 @@ or with constant text in a single argument. %2 process CC1PLUS_SPEC as a spec. %* substitute the variable part of a matched option. (See below.) Note that each comma in the substituted string is replaced by - a single space. + a single space. A space is appended after the last substition + unless there is more text in current sequence. %