OLD | NEW |
1 // Derived from Inferno utils/6l/obj.c and utils/6l/span.c | 1 // Derived from Inferno utils/6l/obj.c and utils/6l/span.c |
2 // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c | 2 // http://code.google.com/p/inferno-os/source/browse/utils/6l/obj.c |
3 // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c | 3 // http://code.google.com/p/inferno-os/source/browse/utils/6l/span.c |
4 // | 4 // |
5 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. | 5 // Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved. |
6 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) | 6 // Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net) |
7 // Portions Copyright © 1997-1999 Vita Nuova Limited | 7 // Portions Copyright © 1997-1999 Vita Nuova Limited |
8 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) | 8 // Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuov
a.com) |
9 // Portions Copyright © 2004,2006 Bruce Ellis | 9 // Portions Copyright © 2004,2006 Bruce Ellis |
10 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) | 10 // Portions Copyright © 2005-2007 C H Forsyth (forsyth@terzarima.net) |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 cgostrsym = "go.string.\"runtime/cgo\""; | 219 cgostrsym = "go.string.\"runtime/cgo\""; |
220 if(linkrlookup(ctxt, cgostrsym, 0) == nil) | 220 if(linkrlookup(ctxt, cgostrsym, 0) == nil) |
221 addstrdata(cgostrsym, "runtime/cgo"); | 221 addstrdata(cgostrsym, "runtime/cgo"); |
222 } | 222 } |
223 | 223 |
224 if(linkmode == LinkAuto) { | 224 if(linkmode == LinkAuto) { |
225 if(iscgo && externalobj) | 225 if(iscgo && externalobj) |
226 linkmode = LinkExternal; | 226 linkmode = LinkExternal; |
227 else | 227 else |
228 linkmode = LinkInternal; | 228 linkmode = LinkInternal; |
| 229 |
| 230 // Force external linking for android. |
| 231 if(strcmp(goos, "android") == 0) |
| 232 linkmode = LinkExternal; |
229 } | 233 } |
230 | 234 |
231 if(linkmode == LinkInternal) { | 235 if(linkmode == LinkInternal) { |
232 // Drop all the cgo_import_static declarations. | 236 // Drop all the cgo_import_static declarations. |
233 // Turns out we won't be needing them. | 237 // Turns out we won't be needing them. |
234 for(s = ctxt->allsym; s != S; s = s->allsym) | 238 for(s = ctxt->allsym; s != S; s = s->allsym) |
235 if(s->type == SHOSTOBJ) { | 239 if(s->type == SHOSTOBJ) { |
236 // If a symbol was marked both | 240 // If a symbol was marked both |
237 // cgo_import_static and cgo_import_dynamic, | 241 // cgo_import_static and cgo_import_dynamic, |
238 // then we want to make it cgo_import_dynamic | 242 // then we want to make it cgo_import_dynamic |
(...skipping 1304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1543 vseprint(buf, buf+sizeof(buf), fmt, arg); | 1547 vseprint(buf, buf+sizeof(buf), fmt, arg); |
1544 va_end(arg); | 1548 va_end(arg); |
1545 print("%s%s%s\n", tn, sep, buf); | 1549 print("%s%s%s\n", tn, sep, buf); |
1546 | 1550 |
1547 nerrors++; | 1551 nerrors++; |
1548 if(nerrors > 20) { | 1552 if(nerrors > 20) { |
1549 print("too many errors\n"); | 1553 print("too many errors\n"); |
1550 errorexit(); | 1554 errorexit(); |
1551 } | 1555 } |
1552 } | 1556 } |
OLD | NEW |