]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: use gccgo as bootstrap compiler
authorDave Cheney <dave@cheney.net>
Mon, 13 Apr 2015 11:50:47 +0000 (21:50 +1000)
committerDave Cheney <dave@cheney.net>
Mon, 13 Apr 2015 19:10:16 +0000 (19:10 +0000)
Fixes #10092

This change makes it possible to use gccgo 5 as the GOROOT_BOOTSTRAP
compiler.

Change-Id: Ie3a312781ac1a09ea77f95b5a78c9488d437e0aa
Reviewed-on: https://go-review.googlesource.com/8809
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/dist/cpuid_amd64.s
src/cmd/dist/cpuid_default.s
src/cmd/dist/util.go
src/cmd/dist/util_gc.go [new file with mode: 0644]
src/cmd/dist/util_gccgo.go [new file with mode: 0644]

index dbb1085e896308b3e5c83a739b595154246869f6..b6cdfed65f599141b039f195e2bc93589682b97e 100644 (file)
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build !gccgo
+
 TEXT ·cpuid(SB),$0-12
        MOVL ax+8(FP), AX
        CPUID
index e5bfd183d91acb84feb68fed0b2a6d76ff72dc15..165b4a98b031cef5270424e50fb2938f193924ac 100644 (file)
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !386,!amd64
+// +build !386,!amd64,!gccgo
 
 #include "textflag.h"
 
index 0bbdbad0e848cf919fa399aace4d7a0504be43c6..cae5d699d4cdf200edf7095f3c69085fda46cb1c 100644 (file)
@@ -480,18 +480,6 @@ func xsamefile(f1, f2 string) bool {
        return os.SameFile(fi1, fi2)
 }
 
-func cpuid(info *[4]uint32, ax uint32)
-
-func cansse2() bool {
-       if gohostarch != "386" && gohostarch != "amd64" {
-               return false
-       }
-
-       var info [4]uint32
-       cpuid(&info, 1)
-       return info[3]&(1<<26) != 0 // SSE2
-}
-
 func xgetgoarm() string {
        if goos == "nacl" {
                // NaCl guarantees VFPv3 and is always cross-compiled.
diff --git a/src/cmd/dist/util_gc.go b/src/cmd/dist/util_gc.go
new file mode 100644 (file)
index 0000000..9f6cfd0
--- /dev/null
@@ -0,0 +1,19 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build !gccgo
+
+package main
+
+func cpuid(info *[4]uint32, ax uint32)
+
+func cansse2() bool {
+       if gohostarch != "386" && gohostarch != "amd64" {
+               return false
+       }
+
+       var info [4]uint32
+       cpuid(&info, 1)
+       return info[3]&(1<<26) != 0 // SSE2
+}
diff --git a/src/cmd/dist/util_gccgo.go b/src/cmd/dist/util_gccgo.go
new file mode 100644 (file)
index 0000000..f680e7b
--- /dev/null
@@ -0,0 +1,9 @@
+// Copyright 2015 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build gccgo
+
+package main
+
+func cansse2() bool { return false }