From c92bfac01e9e8319822f472fd11a51bf28762125 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Daniel=20Mart=C3=AD?= Date: Thu, 22 Oct 2020 19:32:47 +0100 Subject: [PATCH] cmd/go: support non-amd64 on script/toolexec.txt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit In https://golang.org/cl/263357, I wasn't thinking that the assembly file without a GOARCH suffix would be built for all architectures. Only build assembly for amd64, and update the stderr matching line. I manually verified that this works on 386; since the only Go file in that package is a stub, and no assembly files match GOARCH=386, no assembly is built at all. Change-Id: Ief3c6c9bdc223f342821b0ec27f00098fc25246a Reviewed-on: https://go-review.googlesource.com/c/go/+/264457 Trust: Daniel Martí Run-TryBot: Daniel Martí Reviewed-by: Bryan C. Mills TryBot-Result: Go Bot --- src/cmd/go/testdata/script/toolexec.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/testdata/script/toolexec.txt b/src/cmd/go/testdata/script/toolexec.txt index 021b7f1684..526234196b 100644 --- a/src/cmd/go/testdata/script/toolexec.txt +++ b/src/cmd/go/testdata/script/toolexec.txt @@ -11,7 +11,7 @@ go build ./cmd/mytool # Finally, note that asm and cgo are run twice. go build -toolexec=$PWD/mytool -stderr -count=2 '^asm'${GOEXE}' TOOLEXEC_IMPORTPATH=test/main/withasm$' +[amd64] stderr -count=2 '^asm'${GOEXE}' TOOLEXEC_IMPORTPATH=test/main/withasm$' stderr -count=1 '^compile'${GOEXE}' TOOLEXEC_IMPORTPATH=test/main/withasm$' [cgo] stderr -count=2 '^cgo'${GOEXE}' TOOLEXEC_IMPORTPATH=test/main/withcgo$' [cgo] stderr -count=1 '^compile'${GOEXE}' TOOLEXEC_IMPORTPATH=test/main/withcgo$' @@ -46,7 +46,9 @@ package withcgo // Stub file to ensure we build without cgo too. -- withasm/withasm.go -- package withasm --- withasm/withasm.s -- + +// Note that we don't need to declare the Add func at all. +-- withasm/withasm_amd64.s -- TEXT ·Add(SB),$0-24 MOVQ a+0(FP), AX ADDQ b+8(FP), AX -- 2.48.1