From: Peter O'Gorman <peter@pogma.com>
To: James E Wilson <wilson@specifix.com>
Cc: Jack Howarth <howarth@bromo.msbb.uc.edu>,
gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org,
Geoff Keating <geoffk@apple.com>
Subject: Re: -b vs -bundle
Date: Thu, 04 Aug 2005 12:44:00 -0000 [thread overview]
Message-ID: <42F20D0D.6070200@pogma.com> (raw)
In-Reply-To: <42F199F5.5040504@specifix.com>
[-- Attachment #1: Type: text/plain, Size: 2182 bytes --]
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James E Wilson wrote:
| Jack Howarth wrote:
|
|> In compiling xplor-nih under the gcc/g++ of 4.1 branch instead
|> of Apple's gcc/g++ 4.0 compilers from Xcode 2.1, I noticed that the
|> gnu gcc compiler doesn't gracefully handle the -bundle flag. On Apple's
|> compiler I can have a Makefile entry like...
|
|
| This is PR 21366.
|
| You can always work around this by using -Wl,-bundle, which is the FSF
| solution to handling linker flags. Or don't put -bundle first on the
| command line.
This is based very much on the work done previously by Geoff and Devang.
If this is okay, could the approver please commit, I do not have write access.
"Tested" as follows:
imac% ./xgcc -v
Using built-in specs.
Target: powerpc-apple-darwin8.2.0
Configured with: ../configure --enable-languages=c
Thread model: posix
gcc version 4.1.0 20050804 (experimental)
imac% ./xgcc -V4.0
xgcc: couldn't run './powerpc-apple-darwin8.2.0-gcc-4.0': No such file or
directory
imac% ./xgcc -V4.0 -bhello
xgcc: couldn't run './powerpc-apple-darwin8.2.0-gcc-4.0': No such file or
directory
imac% ./xgcc -V4.0 -bhello-there
xgcc: couldn't run './hello-there-gcc-4.0': No such file or directory
imac% ./xgcc -bhello-there
xgcc: couldn't run './hello-there-gcc-4.1.0': No such file or directory
imac% ./xgcc -bhello-there -V4.0
xgcc: couldn't run './hello-there-gcc-4.0': No such file or directory
imac% ./xgcc -bhello -V4.0
xgcc: '-V' must come at the start of the command line
imac% ./xgcc -V4.0 -bob
xgcc: couldn't run './powerpc-apple-darwin8.2.0-gcc-4.0': No such file or
directory
imac% ./xgcc -bob
xgcc: unrecognized option '-bob'
xgcc: no input files
imac% ./xgcc -bob-most
xgcc: couldn't run './ob-most-gcc-4.1.0': No such file or directory
imac% ./xgcc why -bob-most
xgcc: '-b' must come at the start of the command line
Thanks,
Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)
iQCVAwUBQvINDbiDAg3OZTLPAQIkEQP+JNU3mHlOX5ZB0XXXltg7q+N8a9KX8N+o
TOsB3F2iJVjpWKEDWA1waJrmFeWSkdeozgRlcfU4QwAqGe5TiHlqFBSRGS2YPAwa
ag6NWDXdTP+FNyNGSwYud44CBH2+BakdoyPuR95VKP5bLoqu7KDVgKfJmRXyqM+o
R6aj4pthQRc=
=C9Iw
-----END PGP SIGNATURE-----
[-- Attachment #2: dash-b-arg-needs-a-dash.patch --]
[-- Type: text/plain, Size: 1682 bytes --]
2005-08-04 Peter O'Gorman <peter@pogma.com>
PR 21366
* gcc.c (process_command): Check the argument to -b has a dash.
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 4 Aug 2005 12:35:05 -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 copnfiguration 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;
next prev parent reply other threads:[~2005-08-04 12:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-31 19:06 Jack Howarth
2005-08-01 20:28 ` Geoff Keating
2005-08-04 4:30 ` James E Wilson
2005-08-04 12:44 ` Peter O'Gorman [this message]
2005-08-05 3:14 ` James E Wilson
2005-08-05 3:57 ` Peter O'Gorman
2005-08-07 2:42 ` James E Wilson
2005-08-01 20:47 Jack Howarth
2005-08-01 20:52 ` Geoff Keating
2005-08-01 21:27 Jack Howarth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42F20D0D.6070200@pogma.com \
--to=peter@pogma.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=geoffk@apple.com \
--cc=howarth@bromo.msbb.uc.edu \
--cc=wilson@specifix.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).