Mike Stump - improve darwin9 -frepo support (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Due to changes in the output format of ld on darwin9, we need just a few slight modifications to tlink.c:

Approved off-line by Geoff. Tested repo.C on 9A366 with one last ld patch to add "" around the undefined symbols to make parsing easier.

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 2006-11-16 23:24:48.000000000 -0800 +++ tlink.c 2007-02-23 15:44:15.000000000 -0800 @@ -607,12 +607,17 @@ scan_linker_output (const char *fname) { FILE *stream = fopen (fname, "r"); char *line; + int skip_next_line = 0; while ((line = tfgets (stream)) != NULL) { char *p = line, *q; symbol *sym; int end; + int ok = 0; + + if (skip_next_line) + continue; while (*p && ISSPACE ((unsigned char) *p)) ++p; @@ -654,6 +659,19 @@ scan_linker_output (const char *fname) demangled dem = 0; q = 0; + / On darwin9, we look for "foo" referenced from:\n.*\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. / + oldq = p; + + / Since the format is multiline, we have to skip the next line. / + skip_next_line = 1; + } + / First try GNU style'. */ p = strchr (oldq, ''); if (p) @@ -681,7 +699,8 @@ scan_linker_output (const char fname) / We need to check for certain error keywords here, or we would mistakenly use GNU ld's "In function `foo':" message. */ - if (q && (strstr (oldq, "ndefined") + if (q && (ok + || strstr (oldq, "ndefined") || strstr (oldq, "nresolved") || strstr (oldq, "nsatisfied") || strstr (oldq, "ultiple")))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]