re PR driver/42485 (-V switch broken)

2010-04-08  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	PR 42485
	* doc/invoke.texi (-b,-V): Delete.
	* doc/tm.texi: Do not mention -b.
	* gcc.c (display_help): Delete -b and -V.
	(process_command): Delete -b and -V.
	* gcc.h (DEFAULT_SWITCH_TAKES_ARG): Delete -b and -V.

From-SVN: r158134
parent 40ac4f73
2010-04-08 Manuel López-Ibáñez <manu@gcc.gnu.org>
PR 42485
* doc/invoke.texi (-b,-V): Delete.
* doc/tm.texi: Do not mention -b.
* gcc.c (display_help): Delete -b and -V.
(process_command): Delete -b and -V.
* gcc.h (DEFAULT_SWITCH_TAKES_ARG): Delete -b and -V.
2010-04-08 Christian Borntraeger <borntraeger@de.ibm.com> 2010-04-08 Christian Borntraeger <borntraeger@de.ibm.com>
Wolfgang Gellerich <gellerich@de.ibm.com> Wolfgang Gellerich <gellerich@de.ibm.com>
......
...@@ -428,11 +428,6 @@ Objective-C and Objective-C++ Dialects}. ...@@ -428,11 +428,6 @@ Objective-C and Objective-C++ Dialects}.
@gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir} @gccoptlist{-B@var{prefix} -I@var{dir} -iquote@var{dir} -L@var{dir}
-specs=@var{file} -I- --sysroot=@var{dir}} -specs=@var{file} -I- --sysroot=@var{dir}}
@item Target Options
@c I wrote this xref this way to avoid overfull hbox. -- rms
@xref{Target Options}.
@gccoptlist{-V @var{version} -b @var{machine}}
@item Machine Dependent Options @item Machine Dependent Options
@xref{Submodel Options,,Hardware Models and Configurations}. @xref{Submodel Options,,Hardware Models and Configurations}.
@c This list is ordered alphanumerically by subsection name. @c This list is ordered alphanumerically by subsection name.
...@@ -9556,33 +9551,7 @@ proper position among the other output files. ...@@ -9556,33 +9551,7 @@ proper position among the other output files.
The usual way to run GCC is to run the executable called @file{gcc}, or The usual way to run GCC is to run the executable called @file{gcc}, or
@file{<machine>-gcc} when cross-compiling, or @file{<machine>-gcc} when cross-compiling, or
@file{<machine>-gcc-<version>} to run a version other than the one that @file{<machine>-gcc-<version>} to run a version other than the one that
was installed last. Sometimes this is inconvenient, so GCC provides was installed last.
options that will switch to another cross-compiler or version.
@table @gcctabopt
@item -b @var{machine}
@opindex b
The argument @var{machine} specifies the target machine for compilation.
The value to use for @var{machine} is the same as was specified as the
machine type when configuring GCC as a cross-compiler. For
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, or @option{-b} alone should be one
argument followed by the configuration in the next argument.
@item -V @var{version}
@opindex V
The argument @var{version} specifies which version of GCC to run.
This is useful when multiple versions are installed. For example,
@var{version} might be @samp{4.0}, meaning to run GCC version 4.0.
@end table
The @option{-V} and @option{-b} options work by running the
@file{<machine>-gcc-<version>} executable, so there's no real reason to
use them if you can just run that directly.
@node Submodel Options @node Submodel Options
@section Hardware Models and Configurations @section Hardware Models and Configurations
...@@ -9591,11 +9560,7 @@ use them if you can just run that directly. ...@@ -9591,11 +9560,7 @@ use them if you can just run that directly.
@cindex hardware models and configurations, specifying @cindex hardware models and configurations, specifying
@cindex machine dependent options @cindex machine dependent options
Earlier we discussed the standard option @option{-b} which chooses among Each target machine types can have its own
different installed compilers for completely different target
machines, such as VAX vs.@: 68000 vs.@: 80386.
In addition, each of these target machine types can have its own
special options, starting with @samp{-m}, to choose among various special options, starting with @samp{-m}, to choose among various
hardware models or configurations---for example, 68010 vs 68020, hardware models or configurations---for example, 68010 vs 68020,
floating coprocessor or none. A single installed version of the floating coprocessor or none. A single installed version of the
......
...@@ -465,7 +465,7 @@ indicates an absolute file name. ...@@ -465,7 +465,7 @@ indicates an absolute file name.
@defmac MD_EXEC_PREFIX @defmac MD_EXEC_PREFIX
If defined, this macro is an additional prefix to try after If defined, this macro is an additional prefix to try after
@code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched @code{STANDARD_EXEC_PREFIX}. @code{MD_EXEC_PREFIX} is not searched
when the @option{-b} option is used, or the compiler is built as a cross when the compiler is built as a cross
compiler. If you define @code{MD_EXEC_PREFIX}, then be sure to add it compiler. If you define @code{MD_EXEC_PREFIX}, then be sure to add it
to the list of directories used to find the assembler in @file{configure.in}. to the list of directories used to find the assembler in @file{configure.in}.
@end defmac @end defmac
...@@ -497,14 +497,13 @@ is built as a cross compiler. ...@@ -497,14 +497,13 @@ is built as a cross compiler.
@defmac MD_STARTFILE_PREFIX @defmac MD_STARTFILE_PREFIX
If defined, this macro supplies an additional prefix to try after the If defined, this macro supplies an additional prefix to try after the
standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the standard prefixes. @code{MD_EXEC_PREFIX} is not searched when the
@option{-b} option is used, or when the compiler is built as a cross compiler is built as a cross compiler.
compiler.
@end defmac @end defmac
@defmac MD_STARTFILE_PREFIX_1 @defmac MD_STARTFILE_PREFIX_1
If defined, this macro supplies yet another prefix to try after the If defined, this macro supplies yet another prefix to try after the
standard prefixes. It is not searched when the @option{-b} option is standard prefixes. It is not searched when the compiler is built as a
used, or when the compiler is built as a cross compiler. cross compiler.
@end defmac @end defmac
@defmac INIT_ENVIRONMENT @defmac INIT_ENVIRONMENT
......
...@@ -262,11 +262,11 @@ static int use_pipes; ...@@ -262,11 +262,11 @@ static int use_pipes;
static const char *compiler_version; static const char *compiler_version;
/* The target version specified with -V */ /* The target version. */
static const char *const spec_version = DEFAULT_TARGET_VERSION; static const char *const spec_version = DEFAULT_TARGET_VERSION;
/* The target machine specified with -b. */ /* The target machine. */
static const char *spec_machine = DEFAULT_TARGET_MACHINE; static const char *spec_machine = DEFAULT_TARGET_MACHINE;
...@@ -3420,8 +3420,6 @@ display_help (void) ...@@ -3420,8 +3420,6 @@ display_help (void)
--sysroot=<directory> Use <directory> as the root directory for headers\n\ --sysroot=<directory> Use <directory> as the root directory for headers\n\
and libraries\n"), stdout); and libraries\n"), stdout);
fputs (_(" -B <directory> Add <directory> to the compiler's search paths\n"), stdout); fputs (_(" -B <directory> Add <directory> to the compiler's search paths\n"), stdout);
fputs (_(" -b <machine> Run gcc for target <machine>, if installed\n"), stdout);
fputs (_(" -V <version> Run gcc version number <version>, if installed\n"), stdout);
fputs (_(" -v Display the programs invoked by the compiler\n"), stdout); fputs (_(" -v Display the programs invoked by the compiler\n"), stdout);
fputs (_(" -### Like -v but options quoted and commands not executed\n"), stdout); fputs (_(" -### Like -v but options quoted and commands not executed\n"), stdout);
fputs (_(" -E Preprocess only; do not compile, assemble or link\n"), stdout); fputs (_(" -E Preprocess only; do not compile, assemble or link\n"), stdout);
...@@ -3526,81 +3524,6 @@ process_command (int argc, const char **argv) ...@@ -3526,81 +3524,6 @@ process_command (int argc, const char **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 us to pass options starting with -b. */
if (argc > 1 && argv[1][0] == '-'
&& (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;
const char *progname = argv[0];
char **new_argv;
char *new_argv0;
int baselen;
int status = 0;
int err = 0;
const char *errmsg;
while (argc > 1 && argv[1][0] == '-'
&& (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;
if (argv[1][2] != '\0')
{
arg = argv[1] + 2;
argc -= 1;
argv += 1;
}
else if (argc > 2)
{
arg = argv[2];
argc -= 2;
argv += 2;
}
else
fatal ("'-%c' option must have argument", opt);
if (opt == 'V')
new_version = arg;
else
new_machine = arg;
}
for (baselen = strlen (progname); baselen > 0; baselen--)
if (IS_DIR_SEPARATOR (progname[baselen-1]))
break;
new_argv0 = XDUPVAR (char, progname, baselen,
baselen + concat_length (new_version, new_machine,
"-gcc-", NULL) + 1);
strcpy (new_argv0 + baselen, new_machine);
strcat (new_argv0, "-gcc-");
strcat (new_argv0, new_version);
new_argv = XDUPVEC (char *, argv, argc + 1);
new_argv[0] = new_argv0;
errmsg = pex_one (PEX_SEARCH, new_argv0, new_argv, progname, NULL,
NULL, &status, &err);
if (errmsg)
{
if (err == 0)
fatal ("couldn't run '%s': %s", new_argv0, errmsg);
else
fatal ("couldn't run '%s': %s: %s", new_argv0, errmsg,
xstrerror (err));
}
exit (status);
}
/* Convert new-style -- options to old-style. */ /* Convert new-style -- options to old-style. */
translate_options (&argc, translate_options (&argc,
CONST_CAST2 (const char *const **, const char ***, CONST_CAST2 (const char *const **, const char ***,
...@@ -4094,15 +4017,6 @@ process_command (int argc, const char **argv) ...@@ -4094,15 +4017,6 @@ process_command (int argc, const char **argv)
switch (c) switch (c)
{ {
case 'b':
if (p[1] && NULL == strchr (argv[i] + 2, '-'))
goto normal_switch;
/* Fall through. */
case 'V':
fatal ("'-%c' must come at the start of the command line", c);
break;
case 'B': case 'B':
{ {
const char *value; const char *value;
......
...@@ -38,7 +38,7 @@ struct spec_function ...@@ -38,7 +38,7 @@ struct spec_function
|| (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \ || (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
|| (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \ || (CHAR) == 'I' || (CHAR) == 'J' || (CHAR) == 'm' \
|| (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \ || (CHAR) == 'x' || (CHAR) == 'L' || (CHAR) == 'A' \
|| (CHAR) == 'V' || (CHAR) == 'B' || (CHAR) == 'b') || (CHAR) == 'B' )
/* This defines which multi-letter switches take arguments. */ /* This defines which multi-letter switches take arguments. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment