Commit e7d406d5 by Mike Stump

tlink.c (scan_linker_output): Parse linker messages from darwin9's linker better.

	* tlink.c (scan_linker_output): Parse linker messages from
	darwin9's linker better.

From-SVN: r122286
parent c4f46fde
...@@ -607,7 +607,7 @@ scan_linker_output (const char *fname) ...@@ -607,7 +607,7 @@ scan_linker_output (const char *fname)
{ {
FILE *stream = fopen (fname, "r"); FILE *stream = fopen (fname, "r");
char *line; char *line;
int skip_next_line = 0; int skip_next_in_line = 0;
while ((line = tfgets (stream)) != NULL) while ((line = tfgets (stream)) != NULL)
{ {
...@@ -616,11 +616,11 @@ scan_linker_output (const char *fname) ...@@ -616,11 +616,11 @@ scan_linker_output (const char *fname)
int end; int end;
int ok = 0; int ok = 0;
if (skip_next_line) /* On darwin9, we might have to skip " in " lines as well. */
{ if (skip_next_in_line
skip_next_line = 0; && strstr (p, " in "))
continue; continue;
} skip_next_in_line = 0;
while (*p && ISSPACE ((unsigned char) *p)) while (*p && ISSPACE ((unsigned char) *p))
++p; ++p;
...@@ -662,17 +662,19 @@ scan_linker_output (const char *fname) ...@@ -662,17 +662,19 @@ scan_linker_output (const char *fname)
demangled *dem = 0; demangled *dem = 0;
q = 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) if (strcmp (oldq, "referenced from:") == 0)
{ {
/* We have to remember that we found a symbol to tweak. */ /* We have to remember that we found a symbol to tweak. */
ok = 1; 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; oldq = p;
/* Since the format is multiline, we have to skip the next line. */ /* Since the format is multiline, we have to skip
skip_next_line = 1; following lines with " in ". */
skip_next_in_line = 1;
} }
/* First try `GNU style'. */ /* First try `GNU style'. */
......
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