Commit 0830f64b authored by Ian Lance Taylor's avatar Ian Lance Taylor

liblink: don't search for an import file with an absolute path

This restores the old behaviour, and makes it possible to
continue to use 6g and 6l directly, rather than the go tool,
with dot imports.

R=rsc
CC=golang-dev
https://golang.org/cl/43710043
parent f48120ef
......@@ -61,11 +61,15 @@ addlib(Link *ctxt, char *src, char *obj, char *pathname)
if(p != nil)
*p = '.';
// try dot, -L "libdir", and then goroot.
for(i=0; i<ctxt->nlibdir; i++) {
snprint(pname, sizeof pname, "%s/%s", ctxt->libdir[i], name);
if(access(pname, AEXIST) >= 0)
break;
if((!ctxt->windows && name[0] == '/') || (ctxt->windows && name[1] == ':'))
snprint(pname, sizeof pname, "%s", name);
else {
// try dot, -L "libdir", and then goroot.
for(i=0; i<ctxt->nlibdir; i++) {
snprint(pname, sizeof pname, "%s/%s", ctxt->libdir[i], name);
if(access(pname, AEXIST) >= 0)
break;
}
}
cleanname(pname);
......
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