go.tools/cmd/godex: permit absolute paths for gccgo-generated package (export) files
TBR=adonovan TBR=adonovan R=adonovan CC=golang-codereviews https://golang.org/cl/82030043
This commit is contained in:
parent
7e60d06cfc
commit
723686bb4b
|
@ -21,13 +21,15 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
incpaths := []string{"/"}
|
||||||
|
|
||||||
// importer for default gccgo
|
// importer for default gccgo
|
||||||
var inst gccgoimporter.GccgoInstallation
|
var inst gccgoimporter.GccgoInstallation
|
||||||
inst.InitFromDriver("gccgo")
|
inst.InitFromDriver("gccgo")
|
||||||
register("gccgo", inst.GetImporter(nil))
|
register("gccgo", inst.GetImporter(incpaths))
|
||||||
|
|
||||||
// importer for gccgo using condensed export format (experimental)
|
// importer for gccgo using condensed export format (experimental)
|
||||||
register("gccgo-new", getNewImporter(append(inst.SearchPaths(), ".")))
|
register("gccgo-new", getNewImporter(append(append(incpaths, inst.SearchPaths()...), ".")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// This function is an adjusted variant of gccgoimporter.GccgoInstallation.GetImporter.
|
// This function is an adjusted variant of gccgoimporter.GccgoInstallation.GetImporter.
|
||||||
|
@ -72,6 +74,7 @@ func findExportFile(searchpaths []string, pkgpath string) (string, error) {
|
||||||
pkgdir + "lib" + name + ".a",
|
pkgdir + "lib" + name + ".a",
|
||||||
pkgfullpath + ".o",
|
pkgfullpath + ".o",
|
||||||
} {
|
} {
|
||||||
|
println("trying", filepath)
|
||||||
fi, err := os.Stat(filepath)
|
fi, err := os.Stat(filepath)
|
||||||
if err == nil && !fi.IsDir() {
|
if err == nil && !fi.IsDir() {
|
||||||
return filepath, nil
|
return filepath, nil
|
||||||
|
|
Loading…
Reference in New Issue