summaryrefslogtreecommitdiff
path: root/src/pkg/go/build/build.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/go/build/build.go')
-rw-r--r--src/pkg/go/build/build.go17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/pkg/go/build/build.go b/src/pkg/go/build/build.go
index 50d2fb4ae..412abea3a 100644
--- a/src/pkg/go/build/build.go
+++ b/src/pkg/go/build/build.go
@@ -292,10 +292,10 @@ func defaultContext() Context {
// say "+build go1.x", and code that should only be built before Go 1.x
// (perhaps it is the stub to use in that case) should say "+build !go1.x".
//
- // When we reach Go 1.3 the line will read
- // c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3"}
+ // When we reach Go 1.4 the line will read
+ // c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3", "go1.4"}
// and so on.
- c.ReleaseTags = []string{"go1.1", "go1.2"}
+ c.ReleaseTags = []string{"go1.1", "go1.2", "go1.3"}
switch os.Getenv("CGO_ENABLED") {
case "1":
@@ -303,8 +303,7 @@ func defaultContext() Context {
case "0":
c.CgoEnabled = false
default:
- // golang.org/issue/5141
- // cgo should be disabled for cross compilation builds
+ // cgo must be explicitly enabled for cross compilation builds
if runtime.GOARCH == c.GOARCH && runtime.GOOS == c.GOOS {
c.CgoEnabled = cgoEnabled[c.GOOS+"/"+c.GOARCH]
break
@@ -358,6 +357,7 @@ type Package struct {
IgnoredGoFiles []string // .go source files ignored for this build
CFiles []string // .c source files
CXXFiles []string // .cc, .cpp and .cxx source files
+ MFiles []string // .m (Objective-C) source files
HFiles []string // .h, .hh, .hpp and .hxx source files
SFiles []string // .s source files
SwigFiles []string // .swig files
@@ -622,6 +622,9 @@ Found:
case ".cc", ".cpp", ".cxx":
p.CXXFiles = append(p.CXXFiles, name)
continue
+ case ".m":
+ p.MFiles = append(p.MFiles, name)
+ continue
case ".h", ".hh", ".hpp", ".hxx":
p.HFiles = append(p.HFiles, name)
continue
@@ -789,7 +792,7 @@ func (ctxt *Context) matchFile(dir, name string, returnImports bool, allTags map
}
switch ext {
- case ".go", ".c", ".cc", ".cxx", ".cpp", ".s", ".h", ".hh", ".hpp", ".hxx", ".S", ".swig", ".swigcxx":
+ case ".go", ".c", ".cc", ".cxx", ".cpp", ".m", ".s", ".h", ".hh", ".hpp", ".hxx", ".S", ".swig", ".swigcxx":
// tentatively okay - read to make sure
case ".syso":
// binary, no reading
@@ -1207,7 +1210,7 @@ func ArchChar(goarch string) (string, error) {
switch goarch {
case "386":
return "8", nil
- case "amd64":
+ case "amd64", "amd64p32":
return "6", nil
case "arm":
return "5", nil