}} %{fmudflap|fmudflapth: --wrap=main}"
#endif
#ifndef MFLIB_SPEC
-#define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}"
+#define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}"
#endif
/* config.h can define LIBGCC_SPEC to override how and when libgcc.a is
#ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector:}"
#else
-#define LINK_SSP_SPEC "%{fstack-protector:-lssp_nonshared -lssp }"
+#define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp}"
#endif
#endif
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
%{fprofile-arcs|fprofile-generate|coverage:-lgcov}\
- %{!nostdlib:%{!nodefaultlibs:%(link_ssp)%(link_gcc_c_sequence)}}\
+ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
{".m", "#Objective-C", 0, 0, 0}, {".mi", "#Objective-C", 0, 0, 0},
{".mm", "#Objective-C++", 0, 0, 0}, {".M", "#Objective-C++", 0, 0, 0},
{".mii", "#Objective-C++", 0, 0, 0},
- {".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0},
- {".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0},
+ {".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0},
+ {".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0},
{".c++", "#C++", 0, 0, 0}, {".C", "#C++", 0, 0, 0},
{".CPP", "#C++", 0, 0, 0}, {".ii", "#C++", 0, 0, 0},
{".ads", "#Ada", 0, 0, 0}, {".adb", "#Ada", 0, 0, 0},
- {".f", "#Fortran", 0, 0, 0}, {".for", "#Fortran", 0, 0, 0},
+ {".f", "#Fortran", 0, 0, 0}, {".for", "#Fortran", 0, 0, 0},
{".F", "#Fortran", 0, 0, 0}, {".FOR", "#Fortran", 0, 0, 0},
{".FPP", "#Fortran", 0, 0, 0},
{".f90", "#Fortran 95", 0, 0, 0}, {".f95", "#Fortran 95", 0, 0, 0},
- {".fpp", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0},
+ {".fpp", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0},
{".FOR", "#Fortran", 0, 0, 0}, {".FPP", "#Fortran", 0, 0, 0},
{".r", "#Ratfor", 0, 0, 0},
{".p", "#Pascal", 0, 0, 0}, {".pas", "#Pascal", 0, 0, 0},
{"--static", "-static", 0},
{"--std", "-std=", "aj"},
{"--symbolic", "-symbolic", 0},
- {"--sysroot", "--sysroot=", "aj"},
+ {"--sysroot", "--sysroot=", "aj"},
{"--time", "-time", 0},
{"--trace-includes", "-H", 0},
{"--traditional", "-traditional", 0},
#ifndef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif
-
+
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
#undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX
}
/* If there is a -V or -b option (or both), process it now, before
- trying to interpret the rest of the command line. */
+ trying to interpret the rest of the command line.
+ Use heuristic that all configuration names must have at least
+ one dash '-'. This allows us to pass options starting with -b. */
if (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' || argv[1][1] == 'b'))
+ && (argv[1][1] == 'V' ||
+ ((argv[1][1] == 'b') && (NULL != strchr(argv[1] + 2,'-')))))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
int baselen;
while (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' || argv[1][1] == 'b'))
+ && (argv[1][1] == 'V' ||
+ ((argv[1][1] == 'b') && ( NULL != strchr(argv[1] + 2,'-')))))
{
char opt = argv[1][1];
const char *arg;
{
gcc_exec_prefix = make_relative_prefix (argv[0], standard_bindir_prefix,
standard_exec_prefix);
- gcc_libexec_prefix = make_relative_prefix (argv[0],
+ gcc_libexec_prefix = make_relative_prefix (argv[0],
standard_bindir_prefix,
standard_libexec_prefix);
if (gcc_exec_prefix)
switch (c)
{
case 'b':
+ if (NULL == strchr(argv[i] + 2, '-')) break;
case 'V':
fatal ("'-%c' must come at the start of the command line", c);
break;
bool files_differ = strcmp (input_realname, temp_realname);
free (input_realname);
free (temp_realname);
- if (files_differ)
+ if (files_differ)
#endif
{
temp_filename = save_string (temp_filename,
while (*p++ != '}');
return p;
-
+
invalid:
fatal ("braced spec '%s' is invalid at '%c'", orig, *p);
-
+
#undef SKIP_WHITE
}
for (i = 0; (int) i < n_infiles; i++)
{
const char *name = infiles[i].name;
- struct compiler *compiler = lookup_compiler (name,
- strlen (name),
+ struct compiler *compiler = lookup_compiler (name,
+ strlen (name),
infiles[i].language);
-
+
if (compiler && !(compiler->combinable))
combine_inputs = false;
-
+
if (lang_n_infiles > 0 && compiler != input_file_compiler
&& infiles[i].language && infiles[i].language[0] != '*')
infiles[i].incompiler = compiler;
infiles[i].compiled = false;
infiles[i].preprocessed = false;
}
-
+
if (combine_flag && save_temps_flag)
{
bool save_combine_inputs = combine_inputs;
for (i = 0; (int) i < n_infiles; i++)
{
int this_file_error = 0;
-
+
input_file_number = i;
set_input (infiles[i].name);
if (infiles[i].incompiler
/* Reset the input file name to the first compile/object file name, for use
with %b in LINK_SPEC. We use the first input file that we can find
- a compiler to compile it instead of using infiles.language since for
+ a compiler to compile it instead of using infiles.language since for
languages other than C we use aliases that we then lookup later. */
if (n_infiles > 0)
{
invalid_select:
fatal ("multilib select '%s' is invalid", multilib_select);
}
-
+
++p;
}
/* Must have exactly two arguments. */
if (argc != 2)
abort ();
-
+
for (i = 0; i < n_infiles; i++)
{
if (outfiles[i] && !strcmp (outfiles[i], argv[0]))
return NULL;
}
-/* Given two version numbers, compares the two numbers.
+/* Given two version numbers, compares the two numbers.
A version number must match the regular expression
([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*
*/
{
int rresult;
regex_t r;
-
+
if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$",
REG_EXTENDED | REG_NOSUB) != 0)
abort ();
and nothing if it doesn't.
The supported <comparison-op> values are:
-
+
>= true if switch is a later (or same) version than arg1
!> opposite of >=
< true if switch is an earlier version than arg1
case '<' << 8 | '>':
result = comp1 < 0 || comp2 >= 0;
break;
-
+
default:
abort ();
}