mirror of
https://github.com/golang/go
synced 2024-11-18 12:54:44 -07:00
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() {
|
||||
incpaths := []string{"/"}
|
||||
|
||||
// importer for default gccgo
|
||||
var inst gccgoimporter.GccgoInstallation
|
||||
inst.InitFromDriver("gccgo")
|
||||
register("gccgo", inst.GetImporter(nil))
|
||||
register("gccgo", inst.GetImporter(incpaths))
|
||||
|
||||
// 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.
|
||||
@ -72,6 +74,7 @@ func findExportFile(searchpaths []string, pkgpath string) (string, error) {
|
||||
pkgdir + "lib" + name + ".a",
|
||||
pkgfullpath + ".o",
|
||||
} {
|
||||
println("trying", filepath)
|
||||
fi, err := os.Stat(filepath)
|
||||
if err == nil && !fi.IsDir() {
|
||||
return filepath, nil
|
||||
|
Loading…
Reference in New Issue
Block a user