From: Dave Cheney Date: Mon, 13 Apr 2015 11:50:47 +0000 (+1000) Subject: cmd/dist: use gccgo as bootstrap compiler X-Git-Tag: go1.5beta1~1137 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=67805eaa950c5318bfe02943cc175da6729919a9;p=gostls13.git cmd/dist: use gccgo as bootstrap compiler 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 Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/dist/cpuid_amd64.s b/src/cmd/dist/cpuid_amd64.s index dbb1085e89..b6cdfed65f 100644 --- a/src/cmd/dist/cpuid_amd64.s +++ b/src/cmd/dist/cpuid_amd64.s @@ -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 diff --git a/src/cmd/dist/cpuid_default.s b/src/cmd/dist/cpuid_default.s index e5bfd183d9..165b4a98b0 100644 --- a/src/cmd/dist/cpuid_default.s +++ b/src/cmd/dist/cpuid_default.s @@ -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" diff --git a/src/cmd/dist/util.go b/src/cmd/dist/util.go index 0bbdbad0e8..cae5d699d4 100644 --- a/src/cmd/dist/util.go +++ b/src/cmd/dist/util.go @@ -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 index 0000000000..9f6cfd01b7 --- /dev/null +++ b/src/cmd/dist/util_gc.go @@ -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 index 0000000000..f680e7b649 --- /dev/null +++ b/src/cmd/dist/util_gccgo.go @@ -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 }