This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
One last darwin9 tlink.c patch
- From: mrs at apple dot com (Mike Stump)
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Feb 2007 22:36:29 -0800 (PST)
- Subject: One last darwin9 tlink.c patch
Ah, so close, then I find out that there can be multiple reference
lines and they have symbol names on them that we don't want to tweak,
as in:
"B<int>::foo()", referenced from:
vtable for D<int> in repo3.o
construction vtable for B<int>-in-D<int> in repo3.o
"typeinfo for D<int>", referenced from:
vtable for D<int> in repo3.o
vtable for D<int> in repo3.o
This patch avoids scanning the " in " lines that comes after the
referenced from: lines for symbols to tweak.
This will be a regression on darwin9 unless fixed, so, I'm checking
this into 4.2 as well.
2007-02-23 Mike Stump <mrs@apple.com>
* tlink.c (scan_linker_output): Parse linker messages from
darwin9's linker better.
Doing diffs in tlink.c.~1~:
--- tlink.c.~1~ 2007-02-23 16:48:26.000000000 -0800
+++ tlink.c 2007-02-23 22:13:43.000000000 -0800
@@ -607,7 +607,7 @@ scan_linker_output (const char *fname)
{
FILE *stream = fopen (fname, "r");
char *line;
- int skip_next_line = 0;
+ int skip_next_in_line = 0;
while ((line = tfgets (stream)) != NULL)
{
@@ -616,11 +616,11 @@ scan_linker_output (const char *fname)
int end;
int ok = 0;
- if (skip_next_line)
- {
- skip_next_line = 0;
+ /* On darwin9, we might have to skip " in " lines as well. */
+ if (skip_next_in_line
+ && strstr (p, " in "))
continue;
- }
+ skip_next_in_line = 0;
while (*p && ISSPACE ((unsigned char) *p))
++p;
@@ -662,17 +662,19 @@ scan_linker_output (const char *fname)
demangled *dem = 0;
q = 0;
- /* On darwin9, we look for "foo" referenced from:\n.*\n */
+ /* On darwin9, we look for "foo" referenced from:\n\(.* in .*\n\)* */
if (strcmp (oldq, "referenced from:") == 0)
{
/* We have to remember that we found a symbol to tweak. */
ok = 1;
- /* We actually want to start from the first word on the line. */
+ /* We actually want to start from the first word on the
+ line. */
oldq = p;
- /* Since the format is multiline, we have to skip the next line. */
- skip_next_line = 1;
+ /* Since the format is multiline, we have to skip
+ following lines with " in ". */
+ skip_next_in_line = 1;
}
/* First try `GNU style'. */
--------------