This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Your %b patch
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Eric Christopher <echristo at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 08 Jul 2005 00:44:44 -0700
- Subject: Your %b patch
Eric --
Zack asked me to review this patch:
http://gcc.gnu.org/ml/gcc-patches/2005-06/msg00166.html
for you, since he didn't get a chance before he left.
It's really rather wrong that "-Wl" results in adding things to
"infiles". In theory, "infiles" should contain input files, not
command-line options that we happen to need to pass to the linker. So,
the current handling of "-Wl" seems to me to be an ugly hack.
I suppose that the reason it works the way it does is that we want to
intersperse the "-Wl" arguments in and among the other ones, so this is
an easy way of doing it.
The "language" field in "struct infile" is supposed to be one of three
things, judging by the code:
1) The name of a real programming language.
2) A string that starts with "*", indicating that the file should be
passed to the linker.
3) NULL, indicating that nobody has figured out what it is yet.
So, I think you should just be using the same idiom as elsewhwere:
if (!infiles[i].language || infiles[i].language[0] != '*')
instead of "lookup_compiler".
OK, with that change.
Please also update the comment for "infile::language" to indicate the
special "*" convention, and adjust the comment for your new code.
Thanks,
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304