gcc.c: Document %{, in big comment at top.
* gcc.c: Document %{, in big comment at top. (input_suffix_matches): Remove special handling for .s and .S. (input_spec_matches): New. (handle_braces): Handle %{,. (validate_switches): ',' indicates a value which is not a switch. * config/alpha/osf.h (ASM_FINAL_SPEC): Use %{, rather than %{. to detect assembler input. * config/i386/sol2.h (CPP_SPEC): Likewise. * config/rs6000/sysv4.h (ASM_SPEC): Likewise. * config/rs6000/vxworks.h (ASM_SPEC): Likewise. * config/rs6000/lynx.h (ASM_SPEC): Likewise. * config/rs6000/linux64.h (ASM_SPEC_COMMON): Likewise. * config/i386/darwin.h (DARWIN_MINVERSION_SPEC): Objective-C plus -m64 causes deployment target to default to 10.5. * config/rs6000/darwin.h (DARWIN_MINVERSION_SPEC): Likewise. From-SVN: r122783
This commit is contained in:
parent
9b580a0b53
commit
48137d59c3
|
@ -1,3 +1,22 @@
|
||||||
|
2007-03-09 Geoffrey Keating <geoffk@apple.com>
|
||||||
|
|
||||||
|
* gcc.c: Document %{, in big comment at top.
|
||||||
|
(input_suffix_matches): Remove special handling for .s and
|
||||||
|
.S.
|
||||||
|
(input_spec_matches): New.
|
||||||
|
(handle_braces): Handle %{,.
|
||||||
|
(validate_switches): ',' indicates a value which is not a switch.
|
||||||
|
* config/alpha/osf.h (ASM_FINAL_SPEC): Use %{, rather than %{.
|
||||||
|
to detect assembler input.
|
||||||
|
* config/i386/sol2.h (CPP_SPEC): Likewise.
|
||||||
|
* config/rs6000/sysv4.h (ASM_SPEC): Likewise.
|
||||||
|
* config/rs6000/vxworks.h (ASM_SPEC): Likewise.
|
||||||
|
* config/rs6000/lynx.h (ASM_SPEC): Likewise.
|
||||||
|
* config/rs6000/linux64.h (ASM_SPEC_COMMON): Likewise.
|
||||||
|
* config/i386/darwin.h (DARWIN_MINVERSION_SPEC): Objective-C plus
|
||||||
|
-m64 causes deployment target to default to 10.5.
|
||||||
|
* config/rs6000/darwin.h (DARWIN_MINVERSION_SPEC): Likewise.
|
||||||
|
|
||||||
2007-03-09 Richard Henderson <rth@redhat.com>
|
2007-03-09 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
PR target/26090
|
PR target/26090
|
||||||
|
|
|
@ -121,7 +121,7 @@ Boston, MA 02110-1301, USA. */
|
||||||
%{K: -I %b.o~} \
|
%{K: -I %b.o~} \
|
||||||
%{!K: %{save-temps: -I %b.o~}} \
|
%{!K: %{save-temps: -I %b.o~}} \
|
||||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||||
%{.s:%i} %{!.s:%g.s}}}"
|
%{,assembler:%i;:%g.s}}}"
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define ASM_FINAL_SPEC "\
|
#define ASM_FINAL_SPEC "\
|
||||||
|
@ -130,7 +130,7 @@ Boston, MA 02110-1301, USA. */
|
||||||
%{K: -I %b.o~} \
|
%{K: -I %b.o~} \
|
||||||
%{!K: %{save-temps: -I %b.o~}} \
|
%{!K: %{save-temps: -I %b.o~}} \
|
||||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||||
%{.s:%i} %{!.s:%g.s}}}"
|
%{,assembler:%i;:%g.s}}}"
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,11 @@ Boston, MA 02110-1301, USA. */
|
||||||
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
|
#define DARWIN_SUBARCH_SPEC DARWIN_ARCH_SPEC
|
||||||
|
|
||||||
/* Determine a minimum version based on compiler options. */
|
/* Determine a minimum version based on compiler options. */
|
||||||
#define DARWIN_MINVERSION_SPEC "10.4"
|
#define DARWIN_MINVERSION_SPEC \
|
||||||
|
"%{!m64|fgnu-runtime:10.4; \
|
||||||
|
,objective-c|,objc-cpp-output:10.5; \
|
||||||
|
,objective-c++|,objective-c++-cpp-output:10.5; \
|
||||||
|
:10.4}
|
||||||
|
|
||||||
#undef SUBTARGET_EXTRA_SPECS
|
#undef SUBTARGET_EXTRA_SPECS
|
||||||
#define SUBTARGET_EXTRA_SPECS \
|
#define SUBTARGET_EXTRA_SPECS \
|
||||||
|
|
|
@ -51,7 +51,7 @@ Boston, MA 02110-1301, USA. */
|
||||||
|
|
||||||
/* Solaris 2/Intel as chokes on #line directives. */
|
/* Solaris 2/Intel as chokes on #line directives. */
|
||||||
#undef CPP_SPEC
|
#undef CPP_SPEC
|
||||||
#define CPP_SPEC "%{.S:-P} %(cpp_subtarget)"
|
#define CPP_SPEC "%{,assembler-with-cpp:-P} %(cpp_subtarget)"
|
||||||
|
|
||||||
/* FIXME: Removed -K PIC from generic Solaris 2 ASM_SPEC: the native assembler
|
/* FIXME: Removed -K PIC from generic Solaris 2 ASM_SPEC: the native assembler
|
||||||
gives many warnings: R_386_32 relocation is used for symbol ".text". */
|
gives many warnings: R_386_32 relocation is used for symbol ".text". */
|
||||||
|
|
|
@ -123,7 +123,10 @@
|
||||||
|
|
||||||
/* Determine a minimum version based on compiler options. */
|
/* Determine a minimum version based on compiler options. */
|
||||||
#define DARWIN_MINVERSION_SPEC \
|
#define DARWIN_MINVERSION_SPEC \
|
||||||
"%{m64:10.4; \
|
"%{m64:%{fgnu-runtime:10.4; \
|
||||||
|
,objective-c|,objc-cpp-output:10.5; \
|
||||||
|
,objective-c++|,objective-c++-cpp-output:10.5; \
|
||||||
|
:10.4}; \
|
||||||
shared-libgcc:10.3; \
|
shared-libgcc:10.3; \
|
||||||
:10.1}"
|
:10.1}"
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ extern int dot_symbols;
|
||||||
#define ASM_SPEC64 "-a64"
|
#define ASM_SPEC64 "-a64"
|
||||||
|
|
||||||
#define ASM_SPEC_COMMON "%(asm_cpu) \
|
#define ASM_SPEC_COMMON "%(asm_cpu) \
|
||||||
%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
|
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
|
||||||
%{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \
|
%{v:-V} %{Qy:} %{!Qn:-Qy} %{Wa,*:%*} \
|
||||||
%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
|
%{mlittle} %{mlittle-endian} %{mbig} %{mbig-endian}"
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,7 @@
|
||||||
#undef ASM_SPEC
|
#undef ASM_SPEC
|
||||||
#define ASM_SPEC \
|
#define ASM_SPEC \
|
||||||
"%(asm_cpu) \
|
"%(asm_cpu) \
|
||||||
%{.s: %{mregnames} %{mno-regnames}} \
|
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}}"
|
||||||
%{.S: %{mregnames} %{mno-regnames}}"
|
|
||||||
|
|
||||||
#undef STARTFILE_SPEC
|
#undef STARTFILE_SPEC
|
||||||
#undef ENDFILE_SPEC
|
#undef ENDFILE_SPEC
|
||||||
|
|
|
@ -578,7 +578,7 @@ extern int fixuplabelno;
|
||||||
/* Override svr4.h definition. */
|
/* Override svr4.h definition. */
|
||||||
#undef ASM_SPEC
|
#undef ASM_SPEC
|
||||||
#define ASM_SPEC "%(asm_cpu) \
|
#define ASM_SPEC "%(asm_cpu) \
|
||||||
%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
|
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
|
||||||
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
|
%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
|
||||||
%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
|
%{mrelocatable} %{mrelocatable-lib} %{fpic|fpie|fPIC|fPIE:-K PIC} \
|
||||||
%{memb|msdata|msdata=eabi: -memb} \
|
%{memb|msdata|msdata=eabi: -memb} \
|
||||||
|
|
|
@ -84,7 +84,7 @@ VXWORKS_ADDITIONAL_CPP_SPEC
|
||||||
|
|
||||||
#define ASM_SPEC \
|
#define ASM_SPEC \
|
||||||
"%(asm_cpu) \
|
"%(asm_cpu) \
|
||||||
%{.s: %{mregnames} %{mno-regnames}} %{.S: %{mregnames} %{mno-regnames}} \
|
%{,assembler|,assembler-with-cpp: %{mregnames} %{mno-regnames}} \
|
||||||
%{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
|
%{v:-v} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*} \
|
||||||
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
|
%{mrelocatable} %{mrelocatable-lib} %{fpic:-K PIC} %{fPIC:-K PIC} -mbig"
|
||||||
|
|
||||||
|
|
58
gcc/gcc.c
58
gcc/gcc.c
|
@ -516,15 +516,18 @@ or with constant text in a single argument.
|
||||||
part of that switch that matched the '*'.
|
part of that switch that matched the '*'.
|
||||||
%{.S:X} substitutes X, if processing a file with suffix S.
|
%{.S:X} substitutes X, if processing a file with suffix S.
|
||||||
%{!.S:X} substitutes X, if NOT processing a file with suffix S.
|
%{!.S:X} substitutes X, if NOT processing a file with suffix S.
|
||||||
|
%{,S:X} substitutes X, if processing a file which will use spec S.
|
||||||
|
%{!,S:X} substitutes X, if NOT processing a file which will use spec S.
|
||||||
|
|
||||||
%{S|T:X} substitutes X if either -S or -T was given to CC. This may be
|
%{S|T:X} substitutes X if either -S or -T was given to CC. This may be
|
||||||
combined with !, ., and * as above binding stronger than the OR.
|
combined with '!', '.', ',', and '*' as above binding stronger
|
||||||
|
than the OR.
|
||||||
If %* appears in X, all of the alternatives must be starred, and
|
If %* appears in X, all of the alternatives must be starred, and
|
||||||
only the first matching alternative is substituted.
|
only the first matching alternative is substituted.
|
||||||
%{S:X; if S was given to CC, substitutes X;
|
%{S:X; if S was given to CC, substitutes X;
|
||||||
T:Y; else if T was given to CC, substitutes Y;
|
T:Y; else if T was given to CC, substitutes Y;
|
||||||
:D} else substitutes D. There can be as many clauses as you need.
|
:D} else substitutes D. There can be as many clauses as you need.
|
||||||
This may be combined with ., !, |, and * as above.
|
This may be combined with '.', '!', ',', '|', and '*' as above.
|
||||||
|
|
||||||
%(Spec) processes a specification defined in a specs file as *Spec:
|
%(Spec) processes a specification defined in a specs file as *Spec:
|
||||||
%[Spec] as above, but put __ around -D arguments
|
%[Spec] as above, but put __ around -D arguments
|
||||||
|
@ -5529,27 +5532,24 @@ handle_spec_function (const char *p)
|
||||||
static inline bool
|
static inline bool
|
||||||
input_suffix_matches (const char *atom, const char *end_atom)
|
input_suffix_matches (const char *atom, const char *end_atom)
|
||||||
{
|
{
|
||||||
/* We special case the semantics of {.s:...} and {.S:...} and their
|
|
||||||
negative variants. Instead of testing the input filename suffix,
|
|
||||||
we test whether the input source file is an assembler file or an
|
|
||||||
assembler-with-cpp file respectively. This allows us to correctly
|
|
||||||
handle the -x command line option. */
|
|
||||||
|
|
||||||
if (atom + 1 == end_atom
|
|
||||||
&& input_file_compiler
|
|
||||||
&& input_file_compiler->suffix)
|
|
||||||
{
|
|
||||||
if (*atom == 's')
|
|
||||||
return !strcmp (input_file_compiler->suffix, "@assembler");
|
|
||||||
if (*atom == 'S')
|
|
||||||
return !strcmp (input_file_compiler->suffix, "@assembler-with-cpp");
|
|
||||||
}
|
|
||||||
|
|
||||||
return (input_suffix
|
return (input_suffix
|
||||||
&& !strncmp (input_suffix, atom, end_atom - atom)
|
&& !strncmp (input_suffix, atom, end_atom - atom)
|
||||||
&& input_suffix[end_atom - atom] == '\0');
|
&& input_suffix[end_atom - atom] == '\0');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Subroutine of handle_braces. Returns true if the current
|
||||||
|
input file's spec name matches the atom bracketed by ATOM and END_ATOM. */
|
||||||
|
static bool
|
||||||
|
input_spec_matches (const char *atom, const char *end_atom)
|
||||||
|
{
|
||||||
|
return (input_file_compiler
|
||||||
|
&& input_file_compiler->suffix
|
||||||
|
&& input_file_compiler->suffix[0] != '\0'
|
||||||
|
&& !strncmp (input_file_compiler->suffix + 1, atom,
|
||||||
|
end_atom - atom)
|
||||||
|
&& input_file_compiler->suffix[end_atom - atom + 1] == '\0');
|
||||||
|
}
|
||||||
|
|
||||||
/* Subroutine of handle_braces. Returns true if a switch
|
/* Subroutine of handle_braces. Returns true if a switch
|
||||||
matching the atom bracketed by ATOM and END_ATOM appeared on the
|
matching the atom bracketed by ATOM and END_ATOM appeared on the
|
||||||
command line. */
|
command line. */
|
||||||
|
@ -5613,6 +5613,7 @@ handle_braces (const char *p)
|
||||||
const char *orig = p;
|
const char *orig = p;
|
||||||
|
|
||||||
bool a_is_suffix;
|
bool a_is_suffix;
|
||||||
|
bool a_is_spectype;
|
||||||
bool a_is_starred;
|
bool a_is_starred;
|
||||||
bool a_is_negated;
|
bool a_is_negated;
|
||||||
bool a_matched;
|
bool a_matched;
|
||||||
|
@ -5633,8 +5634,12 @@ handle_braces (const char *p)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
/* Scan one "atom" (S in the description above of %{}, possibly
|
/* Scan one "atom" (S in the description above of %{}, possibly
|
||||||
with !, ., or * modifiers). */
|
with '!', '.', '@', ',', or '*' modifiers). */
|
||||||
a_matched = a_is_suffix = a_is_starred = a_is_negated = false;
|
a_matched = false;
|
||||||
|
a_is_suffix = false;
|
||||||
|
a_is_starred = false;
|
||||||
|
a_is_negated = false;
|
||||||
|
a_is_spectype = false;
|
||||||
|
|
||||||
SKIP_WHITE();
|
SKIP_WHITE();
|
||||||
if (*p == '!')
|
if (*p == '!')
|
||||||
|
@ -5643,6 +5648,8 @@ handle_braces (const char *p)
|
||||||
SKIP_WHITE();
|
SKIP_WHITE();
|
||||||
if (*p == '.')
|
if (*p == '.')
|
||||||
p++, a_is_suffix = true;
|
p++, a_is_suffix = true;
|
||||||
|
else if (*p == ',')
|
||||||
|
p++, a_is_spectype = true;
|
||||||
|
|
||||||
atom = p;
|
atom = p;
|
||||||
while (ISIDNUM(*p) || *p == '-' || *p == '+' || *p == '='
|
while (ISIDNUM(*p) || *p == '-' || *p == '+' || *p == '='
|
||||||
|
@ -5660,7 +5667,7 @@ handle_braces (const char *p)
|
||||||
/* Substitute the switch(es) indicated by the current atom. */
|
/* Substitute the switch(es) indicated by the current atom. */
|
||||||
ordered_set = true;
|
ordered_set = true;
|
||||||
if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
|
if (disjunct_set || n_way_choice || a_is_negated || a_is_suffix
|
||||||
|| atom == end_atom)
|
|| a_is_spectype || atom == end_atom)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
mark_matching_switches (atom, end_atom, a_is_starred);
|
mark_matching_switches (atom, end_atom, a_is_starred);
|
||||||
|
@ -5679,7 +5686,8 @@ handle_braces (const char *p)
|
||||||
if (atom == end_atom)
|
if (atom == end_atom)
|
||||||
{
|
{
|
||||||
if (!n_way_choice || disj_matched || *p == '|'
|
if (!n_way_choice || disj_matched || *p == '|'
|
||||||
|| a_is_negated || a_is_suffix || a_is_starred)
|
|| a_is_negated || a_is_suffix || a_is_spectype
|
||||||
|
|| a_is_starred)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
/* An empty term may appear as the last choice of an
|
/* An empty term may appear as the last choice of an
|
||||||
|
@ -5690,7 +5698,7 @@ handle_braces (const char *p)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (a_is_suffix && a_is_starred)
|
if ((a_is_suffix || a_is_spectype) && a_is_starred)
|
||||||
goto invalid;
|
goto invalid;
|
||||||
|
|
||||||
if (!a_is_starred)
|
if (!a_is_starred)
|
||||||
|
@ -5702,6 +5710,8 @@ handle_braces (const char *p)
|
||||||
{
|
{
|
||||||
if (a_is_suffix)
|
if (a_is_suffix)
|
||||||
a_matched = input_suffix_matches (atom, end_atom);
|
a_matched = input_suffix_matches (atom, end_atom);
|
||||||
|
else if (a_is_spectype)
|
||||||
|
a_matched = input_spec_matches (atom, end_atom);
|
||||||
else
|
else
|
||||||
a_matched = switch_matches (atom, end_atom, a_is_starred);
|
a_matched = switch_matches (atom, end_atom, a_is_starred);
|
||||||
|
|
||||||
|
@ -6940,7 +6950,7 @@ next_member:
|
||||||
p++;
|
p++;
|
||||||
|
|
||||||
SKIP_WHITE ();
|
SKIP_WHITE ();
|
||||||
if (*p == '.')
|
if (*p == '.' || *p == ',')
|
||||||
suffix = true, p++;
|
suffix = true, p++;
|
||||||
|
|
||||||
atom = p;
|
atom = p;
|
||||||
|
|
Loading…
Reference in New Issue