Skip to content

Commit

Permalink
cmd/go: fix handling of gccgo standard library.
Browse files Browse the repository at this point in the history
The previous logic was mainly non-working. It only needs to
ensure that the go tool doesn't try to build the standard
library with gccgo.

R=golang-dev, rsc
CC=golang-dev, remy
https://golang.org/cl/5580051
  • Loading branch information
remyoudompheng committed Jan 31, 2012
1 parent 3c6bebf commit d717208
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/cmd/go/build.go
Expand Up @@ -349,6 +349,12 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
// Fake packages - nothing to build.
return a
}
// gccgo standard library is "fake" too.
if _, ok := buildToolchain.(gccgoToolchain); ok {

This comment has been minimized.

Copy link
@h4ck3rm1k3

h4ck3rm1k3 Mar 26, 2015

this prevents gccgo from compiling the source,
see #10258

// the target name is needed for cgo.
a.target = p.target
return a
}
}

if !p.Stale && !buildA && p.target != "" {
Expand Down
8 changes: 0 additions & 8 deletions src/cmd/go/pkg.go
Expand Up @@ -295,14 +295,6 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
dir = filepath.Join(filepath.Dir(dir), "gccgo", filepath.Base(dir))
}
p.target = buildToolchain.pkgpath(dir, p)

// NB. Currently we have gccgo install the standard libraries
// in the "usual" location, where the Go toolchain puts them.
if p.Standard {
if _, ok := buildToolchain.(gccgoToolchain); ok {
p.target = goToolchain{}.pkgpath(dir, p)
}
}
}

var built time.Time
Expand Down

0 comments on commit d717208

Please sign in to comment.