mirror of
https://github.com/golang/go
synced 2024-11-23 15:20:03 -07:00
internal/goroot: for -compiler=gccgo, only look for .gox files
Fixes #34358 Change-Id: I3022ac88e1ad595dc72c0063852b8d4a1ec3f0ba Reviewed-on: https://go-review.googlesource.com/c/go/+/196120 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
parent
5253a6dc72
commit
bcf6f9fd4c
15
src/cmd/go/testdata/script/mod_m.txt
vendored
Normal file
15
src/cmd/go/testdata/script/mod_m.txt
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# It's absurd, but builds with -compiler=gccgo used to fail to build module m.
|
||||
# golang.org/issue/34358
|
||||
|
||||
cd m
|
||||
go build
|
||||
exists m$GOEXE
|
||||
rm m$GOEXE
|
||||
[exec:gccgo] go build -compiler=gccgo
|
||||
[exec:gccgo] exists m$GOEXE
|
||||
|
||||
-- m/go.mod --
|
||||
module m
|
||||
-- m/main.go --
|
||||
package main
|
||||
func main() {}
|
@ -121,18 +121,9 @@ func (gd *gccgoDirs) isStandard(path string) bool {
|
||||
}
|
||||
|
||||
for _, dir := range gd.dirs {
|
||||
full := filepath.Join(dir, path)
|
||||
pkgdir, pkg := filepath.Split(full)
|
||||
for _, p := range [...]string{
|
||||
full,
|
||||
full + ".gox",
|
||||
pkgdir + "lib" + pkg + ".so",
|
||||
pkgdir + "lib" + pkg + ".a",
|
||||
full + ".o",
|
||||
} {
|
||||
if fi, err := os.Stat(p); err == nil && !fi.IsDir() {
|
||||
return true
|
||||
}
|
||||
full := filepath.Join(dir, path) + ".gox"
|
||||
if fi, err := os.Stat(full); err == nil && !fi.IsDir() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user