From 2c76a6f7f85365cefb5200b2b3408fd6bd421b3d Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 12 May 2021 17:55:42 +0200
Subject: [PATCH] all: add //go:build lines to assembly files

Don't add them to files in vendor and cmd/vendor though. These will be
pulled in by updating the respective dependencies.

For #41184

Change-Id: Icc57458c9b3033c347124323f33084c85b224c70
Reviewed-on: https://go-review.googlesource.com/c/go/+/319389
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
---
 src/cmd/compile/internal/ssa/flags_amd64_test.s | 2 --
 src/cmd/compile/internal/ssa/flags_arm64_test.s | 2 --
 src/cmd/dist/vfp_arm.s                          | 3 ++-
 src/cmd/dist/vfp_default.s                      | 3 ++-
 src/crypto/cipher/xor_ppc64x.s                  | 1 +
 src/crypto/md5/md5block_ppc64x.s                | 1 +
 src/crypto/x509/internal/macos/corefoundation.s | 1 +
 src/crypto/x509/internal/macos/security.s       | 1 +
 src/internal/bytealg/compare_mips64x.s          | 1 +
 src/internal/bytealg/compare_mipsx.s            | 1 +
 src/internal/bytealg/compare_ppc64x.s           | 1 +
 src/internal/bytealg/count_ppc64x.s             | 1 +
 src/internal/bytealg/equal_mips64x.s            | 1 +
 src/internal/bytealg/equal_mipsx.s              | 1 +
 src/internal/bytealg/equal_ppc64x.s             | 1 +
 src/internal/bytealg/index_ppc64x.s             | 1 +
 src/internal/bytealg/indexbyte_mips64x.s        | 1 +
 src/internal/bytealg/indexbyte_mipsx.s          | 1 +
 src/internal/bytealg/indexbyte_ppc64x.s         | 1 +
 src/internal/cpu/cpu_x86.s                      | 1 +
 src/math/big/arith_386.s                        | 1 +
 src/math/big/arith_amd64.s                      | 1 +
 src/math/big/arith_arm.s                        | 1 +
 src/math/big/arith_arm64.s                      | 1 +
 src/math/big/arith_mips64x.s                    | 4 +++-
 src/math/big/arith_mipsx.s                      | 4 +++-
 src/math/big/arith_ppc64x.s                     | 4 +++-
 src/math/big/arith_riscv64.s                    | 1 +
 src/math/big/arith_s390x.s                      | 3 ++-
 src/math/big/arith_wasm.s                       | 1 +
 src/math/floor_ppc64x.s                         | 1 +
 src/math/modf_ppc64x.s                          | 1 +
 src/math/sqrt_mipsx.s                           | 1 +
 src/math/sqrt_ppc64x.s                          | 1 +
 src/math/sqrt_riscv64.s                         | 2 --
 src/reflect/asm_mips64x.s                       | 1 +
 src/reflect/asm_mipsx.s                         | 1 +
 src/reflect/asm_ppc64x.s                        | 1 +
 src/runtime/asm_mips64x.s                       | 1 +
 src/runtime/asm_mipsx.s                         | 1 +
 src/runtime/asm_ppc64x.s                        | 1 +
 src/runtime/atomic_mips64x.s                    | 1 +
 src/runtime/atomic_mipsx.s                      | 1 +
 src/runtime/atomic_ppc64x.s                     | 1 +
 src/runtime/cgo/asm_mips64x.s                   | 1 +
 src/runtime/cgo/asm_mipsx.s                     | 1 +
 src/runtime/cgo/asm_ppc64x.s                    | 1 +
 src/runtime/cgo/asm_riscv64.s                   | 2 --
 src/runtime/duff_mips64x.s                      | 1 +
 src/runtime/duff_ppc64x.s                       | 1 +
 src/runtime/internal/atomic/atomic_mips64x.s    | 1 +
 src/runtime/internal/atomic/atomic_mipsx.s      | 1 +
 src/runtime/internal/atomic/atomic_ppc64x.s     | 2 +-
 src/runtime/internal/atomic/sys_nonlinux_arm.s  | 3 ++-
 src/runtime/libfuzzer_amd64.s                   | 1 +
 src/runtime/libfuzzer_arm64.s                   | 1 +
 src/runtime/memclr_386.s                        | 1 +
 src/runtime/memclr_amd64.s                      | 1 +
 src/runtime/memclr_mips64x.s                    | 1 +
 src/runtime/memclr_mipsx.s                      | 1 +
 src/runtime/memclr_ppc64x.s                     | 1 +
 src/runtime/memmove_386.s                       | 1 +
 src/runtime/memmove_amd64.s                     | 1 +
 src/runtime/memmove_mips64x.s                   | 1 +
 src/runtime/memmove_mipsx.s                     | 1 +
 src/runtime/memmove_ppc64x.s                    | 1 +
 src/runtime/mkduff.go                           | 2 ++
 src/runtime/mkpreempt.go                        | 1 +
 src/runtime/msan_amd64.s                        | 1 +
 src/runtime/msan_arm64.s                        | 1 +
 src/runtime/preempt_mips64x.s                   | 1 +
 src/runtime/preempt_mipsx.s                     | 1 +
 src/runtime/preempt_ppc64x.s                    | 1 +
 src/runtime/race_amd64.s                        | 1 +
 src/runtime/race_arm64.s                        | 1 +
 src/runtime/race_ppc64le.s                      | 1 +
 src/runtime/rt0_linux_mips64x.s                 | 1 +
 src/runtime/rt0_linux_mipsx.s                   | 1 +
 src/runtime/sys_aix_ppc64.s                     | 3 ---
 src/runtime/sys_linux_mips64x.s                 | 1 +
 src/runtime/sys_linux_mipsx.s                   | 1 +
 src/runtime/sys_linux_ppc64x.s                  | 1 +
 src/runtime/tls_arm.s                           | 1 +
 src/runtime/tls_mips64x.s                       | 1 +
 src/runtime/tls_mipsx.s                         | 1 +
 src/runtime/tls_ppc64x.s                        | 1 +
 src/runtime/wincallback.go                      | 2 ++
 src/runtime/zcallback_windows.s                 | 2 ++
 src/sync/atomic/asm.s                           | 1 +
 src/sync/atomic/race.s                          | 1 +
 90 files changed, 98 insertions(+), 19 deletions(-)

diff --git a/src/cmd/compile/internal/ssa/flags_amd64_test.s b/src/cmd/compile/internal/ssa/flags_amd64_test.s
index 8bd87019af7..7402f6badb1 100644
--- a/src/cmd/compile/internal/ssa/flags_amd64_test.s
+++ b/src/cmd/compile/internal/ssa/flags_amd64_test.s
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build amd64
-
 #include "textflag.h"
 
 TEXT ·asmAddFlags(SB),NOSPLIT,$0-24
diff --git a/src/cmd/compile/internal/ssa/flags_arm64_test.s b/src/cmd/compile/internal/ssa/flags_arm64_test.s
index f201bcc9943..639d7e3aedc 100644
--- a/src/cmd/compile/internal/ssa/flags_arm64_test.s
+++ b/src/cmd/compile/internal/ssa/flags_arm64_test.s
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build arm64
-
 #include "textflag.h"
 
 TEXT ·asmAddFlags(SB),NOSPLIT,$0-24
diff --git a/src/cmd/dist/vfp_arm.s b/src/cmd/dist/vfp_arm.s
index d571f8b82a2..525ee9b3661 100644
--- a/src/cmd/dist/vfp_arm.s
+++ b/src/cmd/dist/vfp_arm.s
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build gc,arm
+//go:build gc
+// +build gc
 
 #include "textflag.h"
 
diff --git a/src/cmd/dist/vfp_default.s b/src/cmd/dist/vfp_default.s
index 84829beeff3..0c1e16b0aa0 100644
--- a/src/cmd/dist/vfp_default.s
+++ b/src/cmd/dist/vfp_default.s
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !arm,gc
+//go:build gc && !arm
+// +build gc,!arm
 
 #include "textflag.h"
 
diff --git a/src/crypto/cipher/xor_ppc64x.s b/src/crypto/cipher/xor_ppc64x.s
index 4cef31d0ee3..2ba6d9639c4 100644
--- a/src/crypto/cipher/xor_ppc64x.s
+++ b/src/crypto/cipher/xor_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/crypto/md5/md5block_ppc64x.s b/src/crypto/md5/md5block_ppc64x.s
index e1f859e3376..8c28ec2473c 100644
--- a/src/crypto/md5/md5block_ppc64x.s
+++ b/src/crypto/md5/md5block_ppc64x.s
@@ -10,6 +10,7 @@
 // Licence: I hereby disclaim the copyright on this code and place it
 // in the public domain.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/crypto/x509/internal/macos/corefoundation.s b/src/crypto/x509/internal/macos/corefoundation.s
index a9efaa299d8..cda2336c9d1 100644
--- a/src/crypto/x509/internal/macos/corefoundation.s
+++ b/src/crypto/x509/internal/macos/corefoundation.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build darwin && !ios
 // +build darwin,!ios
 
 #include "textflag.h"
diff --git a/src/crypto/x509/internal/macos/security.s b/src/crypto/x509/internal/macos/security.s
index 09ce5c6c769..0038f25b277 100644
--- a/src/crypto/x509/internal/macos/security.s
+++ b/src/crypto/x509/internal/macos/security.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build darwin && !ios
 // +build darwin,!ios
 
 #include "textflag.h"
diff --git a/src/internal/bytealg/compare_mips64x.s b/src/internal/bytealg/compare_mips64x.s
index 4f05fceaca5..b472e510bce 100644
--- a/src/internal/bytealg/compare_mips64x.s
+++ b/src/internal/bytealg/compare_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/compare_mipsx.s b/src/internal/bytealg/compare_mipsx.s
index 9ac5ba56877..dcc4916e567 100644
--- a/src/internal/bytealg/compare_mipsx.s
+++ b/src/internal/bytealg/compare_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/compare_ppc64x.s b/src/internal/bytealg/compare_ppc64x.s
index 7819da31cd0..83444fa8260 100644
--- a/src/internal/bytealg/compare_ppc64x.s
+++ b/src/internal/bytealg/compare_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/count_ppc64x.s b/src/internal/bytealg/count_ppc64x.s
index a64d7d792d0..94163cbd8a3 100644
--- a/src/internal/bytealg/count_ppc64x.s
+++ b/src/internal/bytealg/count_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64le || ppc64
 // +build ppc64le ppc64
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/equal_mips64x.s b/src/internal/bytealg/equal_mips64x.s
index 641e3ff06ca..c2f7d3997ed 100644
--- a/src/internal/bytealg/equal_mips64x.s
+++ b/src/internal/bytealg/equal_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/equal_mipsx.s b/src/internal/bytealg/equal_mipsx.s
index 1cabc70178b..11e5549e45a 100644
--- a/src/internal/bytealg/equal_mipsx.s
+++ b/src/internal/bytealg/equal_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/equal_ppc64x.s b/src/internal/bytealg/equal_ppc64x.s
index 18171eaedc9..5f0fea521b2 100644
--- a/src/internal/bytealg/equal_ppc64x.s
+++ b/src/internal/bytealg/equal_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/index_ppc64x.s b/src/internal/bytealg/index_ppc64x.s
index b7a1e2d7a22..3ed94421256 100644
--- a/src/internal/bytealg/index_ppc64x.s
+++ b/src/internal/bytealg/index_ppc64x.s
@@ -21,6 +21,7 @@
 // work is still needed for a big endian
 // implementation on power9.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/indexbyte_mips64x.s b/src/internal/bytealg/indexbyte_mips64x.s
index 6ebf0dee24b..0f377f5a4c9 100644
--- a/src/internal/bytealg/indexbyte_mips64x.s
+++ b/src/internal/bytealg/indexbyte_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/indexbyte_mipsx.s b/src/internal/bytealg/indexbyte_mipsx.s
index e44440b5f9e..bed015bbd6b 100644
--- a/src/internal/bytealg/indexbyte_mipsx.s
+++ b/src/internal/bytealg/indexbyte_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/internal/bytealg/indexbyte_ppc64x.s b/src/internal/bytealg/indexbyte_ppc64x.s
index 6e14e80af13..8e13c5a56e3 100644
--- a/src/internal/bytealg/indexbyte_ppc64x.s
+++ b/src/internal/bytealg/indexbyte_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/internal/cpu/cpu_x86.s b/src/internal/cpu/cpu_x86.s
index 93c712d784c..0df5da1cc74 100644
--- a/src/internal/cpu/cpu_x86.s
+++ b/src/internal/cpu/cpu_x86.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build 386 || amd64
 // +build 386 amd64
 
 #include "textflag.h"
diff --git a/src/math/big/arith_386.s b/src/math/big/arith_386.s
index d0ea949fe66..acf2b06665a 100644
--- a/src/math/big/arith_386.s
+++ b/src/math/big/arith_386.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go
 // +build !math_big_pure_go
 
 #include "textflag.h"
diff --git a/src/math/big/arith_amd64.s b/src/math/big/arith_amd64.s
index 61043ca2d97..59be952200f 100644
--- a/src/math/big/arith_amd64.s
+++ b/src/math/big/arith_amd64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go
 // +build !math_big_pure_go
 
 #include "textflag.h"
diff --git a/src/math/big/arith_arm.s b/src/math/big/arith_arm.s
index cbf7445e7ab..f2872d80a1a 100644
--- a/src/math/big/arith_arm.s
+++ b/src/math/big/arith_arm.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go
 // +build !math_big_pure_go
 
 #include "textflag.h"
diff --git a/src/math/big/arith_arm64.s b/src/math/big/arith_arm64.s
index 22357d088e4..7bfe08e7b7c 100644
--- a/src/math/big/arith_arm64.s
+++ b/src/math/big/arith_arm64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go
 // +build !math_big_pure_go
 
 #include "textflag.h"
diff --git a/src/math/big/arith_mips64x.s b/src/math/big/arith_mips64x.s
index 804b9fe06ed..4b5c502440f 100644
--- a/src/math/big/arith_mips64x.s
+++ b/src/math/big/arith_mips64x.s
@@ -2,7 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !math_big_pure_go,mips64 !math_big_pure_go,mips64le
+//go:build !math_big_pure_go && (mips64 || mips64le)
+// +build !math_big_pure_go
+// +build mips64 mips64le
 
 #include "textflag.h"
 
diff --git a/src/math/big/arith_mipsx.s b/src/math/big/arith_mipsx.s
index efdecb80f32..e72e6d6377e 100644
--- a/src/math/big/arith_mipsx.s
+++ b/src/math/big/arith_mipsx.s
@@ -2,7 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !math_big_pure_go,mips !math_big_pure_go,mipsle
+//go:build !math_big_pure_go && (mips || mipsle)
+// +build !math_big_pure_go
+// +build mips mipsle
 
 #include "textflag.h"
 
diff --git a/src/math/big/arith_ppc64x.s b/src/math/big/arith_ppc64x.s
index b299ccc2fb8..68c62864946 100644
--- a/src/math/big/arith_ppc64x.s
+++ b/src/math/big/arith_ppc64x.s
@@ -2,7 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !math_big_pure_go,ppc64 !math_big_pure_go,ppc64le
+//go:build !math_big_pure_go && (ppc64 || ppc64le)
+// +build !math_big_pure_go
+// +build ppc64 ppc64le
 
 #include "textflag.h"
 
diff --git a/src/math/big/arith_riscv64.s b/src/math/big/arith_riscv64.s
index a2f7666c7b9..2e950ddd0f3 100644
--- a/src/math/big/arith_riscv64.s
+++ b/src/math/big/arith_riscv64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go && riscv64
 // +build !math_big_pure_go,riscv64
 
 #include "textflag.h"
diff --git a/src/math/big/arith_s390x.s b/src/math/big/arith_s390x.s
index e96480699af..ad822f76b39 100644
--- a/src/math/big/arith_s390x.s
+++ b/src/math/big/arith_s390x.s
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !math_big_pure_go,s390x
+//go:build !math_big_pure_go
+// +build !math_big_pure_go
 
 #include "textflag.h"
 
diff --git a/src/math/big/arith_wasm.s b/src/math/big/arith_wasm.s
index add10644690..e8605f1e153 100644
--- a/src/math/big/arith_wasm.s
+++ b/src/math/big/arith_wasm.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !math_big_pure_go
 // +build !math_big_pure_go
 
 #include "textflag.h"
diff --git a/src/math/floor_ppc64x.s b/src/math/floor_ppc64x.s
index 29b92a62c34..584c27e28f6 100644
--- a/src/math/floor_ppc64x.s
+++ b/src/math/floor_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/math/modf_ppc64x.s b/src/math/modf_ppc64x.s
index caa435eef91..1303067661c 100644
--- a/src/math/modf_ppc64x.s
+++ b/src/math/modf_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/math/sqrt_mipsx.s b/src/math/sqrt_mipsx.s
index c619c19ec22..291d4af39cf 100644
--- a/src/math/sqrt_mipsx.s
+++ b/src/math/sqrt_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/math/sqrt_ppc64x.s b/src/math/sqrt_ppc64x.s
index 174b63e35a5..c929da2159a 100644
--- a/src/math/sqrt_ppc64x.s
+++ b/src/math/sqrt_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/math/sqrt_riscv64.s b/src/math/sqrt_riscv64.s
index f223510c424..0dbdbc99ed6 100644
--- a/src/math/sqrt_riscv64.s
+++ b/src/math/sqrt_riscv64.s
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build riscv64
-
 #include "textflag.h"
 
 // func archSqrt(x float64) float64
diff --git a/src/reflect/asm_mips64x.s b/src/reflect/asm_mips64x.s
index ae661262cb4..8d01c5fb7ed 100644
--- a/src/reflect/asm_mips64x.s
+++ b/src/reflect/asm_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/reflect/asm_mipsx.s b/src/reflect/asm_mipsx.s
index 47fef844a19..6ea82331084 100644
--- a/src/reflect/asm_mipsx.s
+++ b/src/reflect/asm_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/reflect/asm_ppc64x.s b/src/reflect/asm_ppc64x.s
index 010811c31a5..d955e4110f8 100644
--- a/src/reflect/asm_ppc64x.s
+++ b/src/reflect/asm_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/asm_mips64x.s b/src/runtime/asm_mips64x.s
index c3b57e472a2..d4d22801055 100644
--- a/src/runtime/asm_mips64x.s
+++ b/src/runtime/asm_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/runtime/asm_mipsx.s b/src/runtime/asm_mipsx.s
index 1d828b03cfb..ea7edf20cf9 100644
--- a/src/runtime/asm_mipsx.s
+++ b/src/runtime/asm_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/runtime/asm_ppc64x.s b/src/runtime/asm_ppc64x.s
index 2c39b38912f..942cc14f17d 100644
--- a/src/runtime/asm_ppc64x.s
+++ b/src/runtime/asm_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/runtime/atomic_mips64x.s b/src/runtime/atomic_mips64x.s
index 6f42412502b..e2118e6a20b 100644
--- a/src/runtime/atomic_mips64x.s
+++ b/src/runtime/atomic_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/runtime/atomic_mipsx.s b/src/runtime/atomic_mipsx.s
index ed078a2d8a6..1eacd273b44 100644
--- a/src/runtime/atomic_mipsx.s
+++ b/src/runtime/atomic_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/runtime/atomic_ppc64x.s b/src/runtime/atomic_ppc64x.s
index 57f672f3301..b63de2dbd31 100644
--- a/src/runtime/atomic_ppc64x.s
+++ b/src/runtime/atomic_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/cgo/asm_mips64x.s b/src/runtime/cgo/asm_mips64x.s
index e51cdf3d127..ba948071fa9 100644
--- a/src/runtime/cgo/asm_mips64x.s
+++ b/src/runtime/cgo/asm_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/runtime/cgo/asm_mipsx.s b/src/runtime/cgo/asm_mipsx.s
index 1127c8beb48..fd5d78ef97a 100644
--- a/src/runtime/cgo/asm_mipsx.s
+++ b/src/runtime/cgo/asm_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/runtime/cgo/asm_ppc64x.s b/src/runtime/cgo/asm_ppc64x.s
index f4efc1e67d6..9dec8d04ce1 100644
--- a/src/runtime/cgo/asm_ppc64x.s
+++ b/src/runtime/cgo/asm_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/cgo/asm_riscv64.s b/src/runtime/cgo/asm_riscv64.s
index b4ddbb020f0..fcd1d36ca84 100644
--- a/src/runtime/cgo/asm_riscv64.s
+++ b/src/runtime/cgo/asm_riscv64.s
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build riscv64
-
 #include "textflag.h"
 
 // Called by C code generated by cmd/cgo.
diff --git a/src/runtime/duff_mips64x.s b/src/runtime/duff_mips64x.s
index c4e04ccc9da..a897d7fd9bf 100644
--- a/src/runtime/duff_mips64x.s
+++ b/src/runtime/duff_mips64x.s
@@ -2,6 +2,7 @@
 // Run go generate from src/runtime to update.
 // See mkduff.go for comments.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/runtime/duff_ppc64x.s b/src/runtime/duff_ppc64x.s
index d6b89ba9401..d4e3b409d24 100644
--- a/src/runtime/duff_ppc64x.s
+++ b/src/runtime/duff_ppc64x.s
@@ -2,6 +2,7 @@
 // Run go generate from src/runtime to update.
 // See mkduff.go for comments.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/internal/atomic/atomic_mips64x.s b/src/runtime/internal/atomic/atomic_mips64x.s
index 2751c6f8082..fba668f94a8 100644
--- a/src/runtime/internal/atomic/atomic_mips64x.s
+++ b/src/runtime/internal/atomic/atomic_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/runtime/internal/atomic/atomic_mipsx.s b/src/runtime/internal/atomic/atomic_mipsx.s
index 3f613214507..c0835d66ed8 100644
--- a/src/runtime/internal/atomic/atomic_mipsx.s
+++ b/src/runtime/internal/atomic/atomic_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/runtime/internal/atomic/atomic_ppc64x.s b/src/runtime/internal/atomic/atomic_ppc64x.s
index 37c8515d37e..dca26cb334a 100644
--- a/src/runtime/internal/atomic/atomic_ppc64x.s
+++ b/src/runtime/internal/atomic/atomic_ppc64x.s
@@ -2,11 +2,11 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
 
-
 // For more details about how various memory models are
 // enforced on POWER, the following paper provides more
 // details about how they enforce C/C++ like models. This
diff --git a/src/runtime/internal/atomic/sys_nonlinux_arm.s b/src/runtime/internal/atomic/sys_nonlinux_arm.s
index 57568b2238d..04036ca9702 100644
--- a/src/runtime/internal/atomic/sys_nonlinux_arm.s
+++ b/src/runtime/internal/atomic/sys_nonlinux_arm.s
@@ -2,7 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !linux,arm
+//go:build !linux
+// +build !linux
 
 #include "textflag.h"
 
diff --git a/src/runtime/libfuzzer_amd64.s b/src/runtime/libfuzzer_amd64.s
index 890fde341bc..13645fc7af8 100644
--- a/src/runtime/libfuzzer_amd64.s
+++ b/src/runtime/libfuzzer_amd64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build libfuzzer
 // +build libfuzzer
 
 #include "go_asm.h"
diff --git a/src/runtime/libfuzzer_arm64.s b/src/runtime/libfuzzer_arm64.s
index 121673e0922..4ad8242804e 100644
--- a/src/runtime/libfuzzer_arm64.s
+++ b/src/runtime/libfuzzer_arm64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build libfuzzer
 // +build libfuzzer
 
 #include "go_asm.h"
diff --git a/src/runtime/memclr_386.s b/src/runtime/memclr_386.s
index d2ef17f7cee..046c3441198 100644
--- a/src/runtime/memclr_386.s
+++ b/src/runtime/memclr_386.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !plan9
 // +build !plan9
 
 #include "go_asm.h"
diff --git a/src/runtime/memclr_amd64.s b/src/runtime/memclr_amd64.s
index 5d2bebb901b..a10f57bd8cb 100644
--- a/src/runtime/memclr_amd64.s
+++ b/src/runtime/memclr_amd64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !plan9
 // +build !plan9
 
 #include "go_asm.h"
diff --git a/src/runtime/memclr_mips64x.s b/src/runtime/memclr_mips64x.s
index d7a3251e204..bc037013fe7 100644
--- a/src/runtime/memclr_mips64x.s
+++ b/src/runtime/memclr_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/runtime/memclr_mipsx.s b/src/runtime/memclr_mipsx.s
index eb2a8a7219c..3d21c3c414c 100644
--- a/src/runtime/memclr_mipsx.s
+++ b/src/runtime/memclr_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/runtime/memclr_ppc64x.s b/src/runtime/memclr_ppc64x.s
index 75126208942..65639322b2a 100644
--- a/src/runtime/memclr_ppc64x.s
+++ b/src/runtime/memclr_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/memmove_386.s b/src/runtime/memmove_386.s
index d99546c6336..1a43a1f724d 100644
--- a/src/runtime/memmove_386.s
+++ b/src/runtime/memmove_386.s
@@ -23,6 +23,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
+//go:build !plan9
 // +build !plan9
 
 #include "go_asm.h"
diff --git a/src/runtime/memmove_amd64.s b/src/runtime/memmove_amd64.s
index f1e34035962..24c6529f584 100644
--- a/src/runtime/memmove_amd64.s
+++ b/src/runtime/memmove_amd64.s
@@ -23,6 +23,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
+//go:build !plan9
 // +build !plan9
 
 #include "go_asm.h"
diff --git a/src/runtime/memmove_mips64x.s b/src/runtime/memmove_mips64x.s
index 8a1b88afba7..fef3c6be827 100644
--- a/src/runtime/memmove_mips64x.s
+++ b/src/runtime/memmove_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "textflag.h"
diff --git a/src/runtime/memmove_mipsx.s b/src/runtime/memmove_mipsx.s
index 6c86558f8d2..cd02fc25c4b 100644
--- a/src/runtime/memmove_mipsx.s
+++ b/src/runtime/memmove_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "textflag.h"
diff --git a/src/runtime/memmove_ppc64x.s b/src/runtime/memmove_ppc64x.s
index dbd835506f6..fd16ad8129b 100644
--- a/src/runtime/memmove_ppc64x.s
+++ b/src/runtime/memmove_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "textflag.h"
diff --git a/src/runtime/mkduff.go b/src/runtime/mkduff.go
index 8632fe08a3d..da191cc594c 100644
--- a/src/runtime/mkduff.go
+++ b/src/runtime/mkduff.go
@@ -179,6 +179,7 @@ func copyARM64(w io.Writer) {
 
 func tagsPPC64x(w io.Writer) {
 	fmt.Fprintln(w)
+	fmt.Fprintln(w, "//go:build ppc64 || ppc64le")
 	fmt.Fprintln(w, "// +build ppc64 ppc64le")
 	fmt.Fprintln(w)
 }
@@ -202,6 +203,7 @@ func copyPPC64x(w io.Writer) {
 
 func tagsMIPS64x(w io.Writer) {
 	fmt.Fprintln(w)
+	fmt.Fprintln(w, "//go:build mips64 || mips64le")
 	fmt.Fprintln(w, "// +build mips64 mips64le")
 	fmt.Fprintln(w)
 }
diff --git a/src/runtime/mkpreempt.go b/src/runtime/mkpreempt.go
index 3a9e6cc4780..6c980540f57 100644
--- a/src/runtime/mkpreempt.go
+++ b/src/runtime/mkpreempt.go
@@ -123,6 +123,7 @@ func header(arch string) {
 	fmt.Fprintf(out, "// Code generated by mkpreempt.go; DO NOT EDIT.\n\n")
 	if beLe[arch] {
 		base := arch[:len(arch)-1]
+		fmt.Fprintf(out, "//go:build %s || %sle\n", base, base)
 		fmt.Fprintf(out, "// +build %s %sle\n\n", base, base)
 	}
 	fmt.Fprintf(out, "#include \"go_asm.h\"\n")
diff --git a/src/runtime/msan_amd64.s b/src/runtime/msan_amd64.s
index 669e9ca73f8..1bb57a3b7e8 100644
--- a/src/runtime/msan_amd64.s
+++ b/src/runtime/msan_amd64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build msan
 // +build msan
 
 #include "go_asm.h"
diff --git a/src/runtime/msan_arm64.s b/src/runtime/msan_arm64.s
index f19906cfc83..93ade8dd897 100644
--- a/src/runtime/msan_arm64.s
+++ b/src/runtime/msan_arm64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build msan
 // +build msan
 
 #include "go_asm.h"
diff --git a/src/runtime/preempt_mips64x.s b/src/runtime/preempt_mips64x.s
index 0d0c157c36c..b755425bc5d 100644
--- a/src/runtime/preempt_mips64x.s
+++ b/src/runtime/preempt_mips64x.s
@@ -1,5 +1,6 @@
 // Code generated by mkpreempt.go; DO NOT EDIT.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/runtime/preempt_mipsx.s b/src/runtime/preempt_mipsx.s
index 86d3a918d33..c1bff608596 100644
--- a/src/runtime/preempt_mipsx.s
+++ b/src/runtime/preempt_mipsx.s
@@ -1,5 +1,6 @@
 // Code generated by mkpreempt.go; DO NOT EDIT.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/runtime/preempt_ppc64x.s b/src/runtime/preempt_ppc64x.s
index 90634386dbf..70bd91982bf 100644
--- a/src/runtime/preempt_ppc64x.s
+++ b/src/runtime/preempt_ppc64x.s
@@ -1,5 +1,6 @@
 // Code generated by mkpreempt.go; DO NOT EDIT.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/runtime/race_amd64.s b/src/runtime/race_amd64.s
index 58a919efe8d..8d4813eaddd 100644
--- a/src/runtime/race_amd64.s
+++ b/src/runtime/race_amd64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build race
 // +build race
 
 #include "go_asm.h"
diff --git a/src/runtime/race_arm64.s b/src/runtime/race_arm64.s
index 82e3caadc8f..c6d5b91edc0 100644
--- a/src/runtime/race_arm64.s
+++ b/src/runtime/race_arm64.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build race
 // +build race
 
 #include "go_asm.h"
diff --git a/src/runtime/race_ppc64le.s b/src/runtime/race_ppc64le.s
index 069e4d86dd4..963e57099c9 100644
--- a/src/runtime/race_ppc64le.s
+++ b/src/runtime/race_ppc64le.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build race
 // +build race
 
 #include "go_asm.h"
diff --git a/src/runtime/rt0_linux_mips64x.s b/src/runtime/rt0_linux_mips64x.s
index 55506755df2..fabd8570b57 100644
--- a/src/runtime/rt0_linux_mips64x.s
+++ b/src/runtime/rt0_linux_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips64 || mips64le)
 // +build linux
 // +build mips64 mips64le
 
diff --git a/src/runtime/rt0_linux_mipsx.s b/src/runtime/rt0_linux_mipsx.s
index 74b8f50b73f..9f5842b51a2 100644
--- a/src/runtime/rt0_linux_mipsx.s
+++ b/src/runtime/rt0_linux_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips || mipsle)
 // +build linux
 // +build mips mipsle
 
diff --git a/src/runtime/sys_aix_ppc64.s b/src/runtime/sys_aix_ppc64.s
index a56d043f425..c171c191c0e 100644
--- a/src/runtime/sys_aix_ppc64.s
+++ b/src/runtime/sys_aix_ppc64.s
@@ -2,9 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build aix
-// +build ppc64 ppc64le
-
 //
 // System calls and other sys.stuff for ppc64, Aix
 //
diff --git a/src/runtime/sys_linux_mips64x.s b/src/runtime/sys_linux_mips64x.s
index 0206cb88bd4..e18d2914456 100644
--- a/src/runtime/sys_linux_mips64x.s
+++ b/src/runtime/sys_linux_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips64 || mips64le)
 // +build linux
 // +build mips64 mips64le
 
diff --git a/src/runtime/sys_linux_mipsx.s b/src/runtime/sys_linux_mipsx.s
index d5317d39570..b3970be9cf8 100644
--- a/src/runtime/sys_linux_mipsx.s
+++ b/src/runtime/sys_linux_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (mips || mipsle)
 // +build linux
 // +build mips mipsle
 
diff --git a/src/runtime/sys_linux_ppc64x.s b/src/runtime/sys_linux_ppc64x.s
index 46387288d53..05b5916db41 100644
--- a/src/runtime/sys_linux_ppc64x.s
+++ b/src/runtime/sys_linux_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build linux && (ppc64 || ppc64le)
 // +build linux
 // +build ppc64 ppc64le
 
diff --git a/src/runtime/tls_arm.s b/src/runtime/tls_arm.s
index e42de8deb4f..879caac9e16 100644
--- a/src/runtime/tls_arm.s
+++ b/src/runtime/tls_arm.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !windows
 // +build !windows
 
 #include "go_asm.h"
diff --git a/src/runtime/tls_mips64x.s b/src/runtime/tls_mips64x.s
index 888c0efec6a..779d64ba31a 100644
--- a/src/runtime/tls_mips64x.s
+++ b/src/runtime/tls_mips64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips64 || mips64le
 // +build mips64 mips64le
 
 #include "go_asm.h"
diff --git a/src/runtime/tls_mipsx.s b/src/runtime/tls_mipsx.s
index d2ffcd954c9..ada8d06a9e7 100644
--- a/src/runtime/tls_mipsx.s
+++ b/src/runtime/tls_mipsx.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build mips || mipsle
 // +build mips mipsle
 
 #include "go_asm.h"
diff --git a/src/runtime/tls_ppc64x.s b/src/runtime/tls_ppc64x.s
index 25d796fcc6e..7e935d0eb29 100644
--- a/src/runtime/tls_ppc64x.s
+++ b/src/runtime/tls_ppc64x.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build ppc64 || ppc64le
 // +build ppc64 ppc64le
 
 #include "go_asm.h"
diff --git a/src/runtime/wincallback.go b/src/runtime/wincallback.go
index 8411c98412d..a7a787d8f6d 100644
--- a/src/runtime/wincallback.go
+++ b/src/runtime/wincallback.go
@@ -22,7 +22,9 @@ func genasm386Amd64() {
 
 	buf.WriteString(`// Code generated by wincallback.go using 'go generate'. DO NOT EDIT.
 
+//go:build 386 || amd64
 // +build 386 amd64
+
 // runtime·callbackasm is called by external code to
 // execute Go implemented callback function. It is not
 // called from the start, instead runtime·compilecallback
diff --git a/src/runtime/zcallback_windows.s b/src/runtime/zcallback_windows.s
index 37ffb38aca5..e451c2b9d05 100644
--- a/src/runtime/zcallback_windows.s
+++ b/src/runtime/zcallback_windows.s
@@ -1,6 +1,8 @@
 // Code generated by wincallback.go using 'go generate'. DO NOT EDIT.
 
+//go:build 386 || amd64
 // +build 386 amd64
+
 // runtime·callbackasm is called by external code to
 // execute Go implemented callback function. It is not
 // called from the start, instead runtime·compilecallback
diff --git a/src/sync/atomic/asm.s b/src/sync/atomic/asm.s
index f86726f3a1a..7b8c9b9430e 100644
--- a/src/sync/atomic/asm.s
+++ b/src/sync/atomic/asm.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build !race
 // +build !race
 
 #include "textflag.h"
diff --git a/src/sync/atomic/race.s b/src/sync/atomic/race.s
index fd6ca22700c..0866487cc71 100644
--- a/src/sync/atomic/race.s
+++ b/src/sync/atomic/race.s
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+//go:build race
 // +build race
 
 // This file is here only to allow external functions.
-- 
GitLab