summaryrefslogtreecommitdiffstats
path: root/gcc/gcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r--gcc/gcc.c25
1 files changed, 4 insertions, 21 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 301abfc6212..1aa02528d87 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -819,30 +819,10 @@ struct user_specs
static struct user_specs *user_specs_head, *user_specs_tail;
-/* This defines which switch letters take arguments. */
-
-#define DEFAULT_SWITCH_TAKES_ARG(CHAR) \
- ((CHAR) == 'D' || (CHAR) == 'U' || (CHAR) == 'o' \
- || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
- || (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
- || (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'B' || (CHAR) == 'b')
-
#ifndef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
#endif
-/* This defines which multi-letter switches take arguments. */
-
-#define DEFAULT_WORD_SWITCH_TAKES_ARG(STR) \
- (!strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \
- || !strcmp (STR, "Tbss") || !strcmp (STR, "include") \
- || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
- || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
- || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
- || !strcmp (STR, "isystem") || !strcmp (STR, "-param") \
- || !strcmp (STR, "specs") \
- || !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ"))
-
#ifndef WORD_SWITCH_TAKES_ARG
#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
#endif
@@ -3162,8 +3142,11 @@ process_command (argc, argv)
/* If there is a -V or -b option (or both), process it now, before
trying to interpret the rest of the command line. */
+ /* Use heuristic that all configuration names must have at least one dash '-'.
+ This allows to pass options that start with -b. */
if (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' || argv[1][1] == 'b'))
+ && (argv[1][1] == 'V'
+ || (argv[1][1] == 'b' && strchr (argv[1] + 2, '-') != NULL)))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
OpenPOWER on IntegriCloud