aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-12-29 09:32:21 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2008-12-29 09:32:21 +0100
commitd41d8140d20c35dc151157621f4200452f07da29 (patch)
tree95371f82b78423655768e43a1e0c334615bfd483
parent19bb3aa5c5b80330b86ac07b0590573af43d83cc (diff)
downloadgcc-d41d8140d20c35dc151157621f4200452f07da29.zip
gcc-d41d8140d20c35dc151157621f4200452f07da29.tar.gz
gcc-d41d8140d20c35dc151157621f4200452f07da29.tar.bz2
re PR driver/38381 (-b option seems to be broken)
PR driver/38381 * gcc.c (process_command): Accept also -b with configuration name in the next argument. * doc/invoke.texi (-b): Document that no hyphen is required if configuration name is in the next argument after -b. From-SVN: r142947
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/doc/invoke.texi3
-rw-r--r--gcc/gcc.c14
3 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 21310d9..1b9d89f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-29 Jakub Jelinek <jakub@redhat.com>
+
+ PR driver/38381
+ * gcc.c (process_command): Accept also -b with configuration name
+ in the next argument.
+ * doc/invoke.texi (-b): Document that no hyphen is required if
+ configuration name is in the next argument after -b.
+
2008-12-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/38641
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 66d28c7..1bd99a7 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -8601,7 +8601,8 @@ example, if a cross-compiler was configured with @samp{configure
arm-elf}, meaning to compile for an arm processor with elf binaries,
then you would specify @option{-b arm-elf} to run that cross compiler.
Because there are other options beginning with @option{-b}, the
-configuration must contain a hyphen.
+configuration must contain a hyphen, or @option{-b} alone should be one
+argument followed by the configuration in the next argument.
@item -V @var{version}
@opindex V
diff --git a/gcc/gcc.c b/gcc/gcc.c
index 5481d0d..8e1938b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3371,8 +3371,10 @@ process_command (int argc, const char **argv)
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') && (NULL != strchr(argv[1] + 2,'-')))))
+ && (argv[1][1] == 'V'
+ || (argv[1][1] == 'b'
+ && (argv[1][2] == '\0'
+ || NULL != strchr (argv[1] + 2, '-')))))
{
const char *new_version = DEFAULT_TARGET_VERSION;
const char *new_machine = DEFAULT_TARGET_MACHINE;
@@ -3382,8 +3384,10 @@ process_command (int argc, const char **argv)
int baselen;
while (argc > 1 && argv[1][0] == '-'
- && (argv[1][1] == 'V' ||
- ((argv[1][1] == 'b') && ( NULL != strchr(argv[1] + 2,'-')))))
+ && (argv[1][1] == 'V'
+ || (argv[1][1] == 'b'
+ && (argv[1][2] == '\0'
+ || NULL != strchr (argv[1] + 2, '-')))))
{
char opt = argv[1][1];
const char *arg;
@@ -3842,7 +3846,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
switch (c)
{
case 'b':
- if (NULL == strchr(argv[i] + 2, '-'))
+ if (p[1] && NULL == strchr (argv[i] + 2, '-'))
goto normal_switch;
/* Fall through. */