From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9795 invoked by alias); 5 Aug 2005 03:57:44 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 9745 invoked by uid 22791); 5 Aug 2005 03:57:37 -0000 Received: from relay02.pair.com (HELO relay02.pair.com) (209.68.5.16) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Fri, 05 Aug 2005 03:57:37 +0000 Received: (qmail 2643 invoked from network); 5 Aug 2005 03:57:35 -0000 Received: from unknown (HELO ?192.168.1.13?) (unknown) by unknown with SMTP; 5 Aug 2005 03:57:35 -0000 X-pair-Authenticated: 221.190.179.26 Message-ID: <42F2E312.104@pogma.com> Date: Fri, 05 Aug 2005 03:57:00 -0000 From: Peter O'Gorman User-Agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317) MIME-Version: 1.0 To: James E Wilson CC: Jack Howarth , gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org, Geoff Keating Subject: Re: -b vs -bundle References: <20050731190310.CC3701DC154@bromo.msbb.uc.edu> <42F199F5.5040504@specifix.com> <42F20D0D.6070200@pogma.com> <1123211669.31826.60.camel@aretha.corp.specifix.com> In-Reply-To: <1123211669.31826.60.camel@aretha.corp.specifix.com> Content-Type: multipart/mixed; boundary="------------070905040802050600070406" X-SW-Source: 2005-08/txt/msg00165.txt.bz2 This is a multi-part message in MIME format. --------------070905040802050600070406 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 227 James E Wilson wrote: > This revised patch does appear to fix the only complaint that Geoff had > with the original patch. I think it is OK with the typo fixed and the > addition of a doc change. OK, done. Thank you. Peter --------------070905040802050600070406 Content-Type: text/plain; x-mac-type="0"; x-mac-creator="0"; name="dash-b-arg-needs-a-dash-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="dash-b-arg-needs-a-dash-2.patch" Content-length: 3056 2005-08-?? Peter O'Gorman PR 21366 * gcc.c (process_command): Check the argument to -b has a dash. * doc/invoke.texi: Update -b and -V docs. Index: gcc/gcc.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/gcc.c,v retrieving revision 1.469 diff -u -3 -p -u -r1.469 gcc.c --- gcc/gcc.c 3 Aug 2005 23:35:06 -0000 1.469 +++ gcc/gcc.c 5 Aug 2005 03:54:08 -0000 @@ -3175,9 +3175,12 @@ process_command (int argc, const char ** } /* 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; @@ -3187,7 +3190,8 @@ process_command (int argc, const char ** 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; @@ -3608,6 +3612,7 @@ warranty; not even for MERCHANTABILITY o 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; Index: gcc/doc/invoke.texi =================================================================== RCS file: /cvs/gcc/gcc/gcc/doc/invoke.texi,v retrieving revision 1.664 diff -u -3 -p -u -r1.664 invoke.texi --- gcc/doc/invoke.texi 3 Aug 2005 16:35:10 -0000 1.664 +++ gcc/doc/invoke.texi 5 Aug 2005 03:54:14 -0000 @@ -6943,14 +6943,16 @@ The argument @var{machine} specifies the 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 -i386v}, meaning to compile for an 80386 running System V, then you -would specify @option{-b i386v} to run that cross compiler. +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. @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{2.0}, meaning to run GCC version 2.0. +@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 --------------070905040802050600070406--