]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix vet complaints for linux/arm
authorRuss Cox <rsc@golang.org>
Wed, 8 May 2019 17:43:44 +0000 (13:43 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 9 May 2019 21:13:21 +0000 (21:13 +0000)
Working toward making the tree vet-safe instead of having
so many exceptions in cmd/vet/all/whitelist.

This CL makes "GOOS=linux GOARCH=arm go vet -unsafeptr=false runtime" happy,
while keeping "GO_BUILDER_NAME=misc-vetall go tool dist test" happy too.

For #31916.

Change-Id: Ifae75b832320b5356ac8773cf85055bfb2bd7214
Reviewed-on: https://go-review.googlesource.com/c/go/+/176101
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/vet/all/whitelist/android_arm.txt [deleted file]
src/cmd/vet/all/whitelist/arm.txt [deleted file]
src/cmd/vet/all/whitelist/linux_arm.txt [deleted file]
src/runtime/stubs_arm.go
src/runtime/sys_linux_arm.s

diff --git a/src/cmd/vet/all/whitelist/android_arm.txt b/src/cmd/vet/all/whitelist/android_arm.txt
deleted file mode 100644 (file)
index dda4fb5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-// android/arm-specific vet whitelist. See readme.txt for details.
-
-runtime/sys_linux_arm.s: [arm] clone: 12(R13) should be stk+4(FP)
-runtime/sys_linux_arm.s: [arm] clone: 8(R13) should be flags+0(FP)
diff --git a/src/cmd/vet/all/whitelist/arm.txt b/src/cmd/vet/all/whitelist/arm.txt
deleted file mode 100644 (file)
index 307f17b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-// arm-specific vet whitelist. See readme.txt for details.
-
-// Intentionally missing declarations.
-runtime/asm_arm.s: [arm] emptyfunc: function emptyfunc missing Go declaration
-runtime/asm_arm.s: [arm] usplitR0: function usplitR0 missing Go declaration
-runtime/tls_arm.s: [arm] load_g: function load_g missing Go declaration
-runtime/tls_arm.s: [arm] _initcgo: function _initcgo missing Go declaration
diff --git a/src/cmd/vet/all/whitelist/linux_arm.txt b/src/cmd/vet/all/whitelist/linux_arm.txt
deleted file mode 100644 (file)
index a911700..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-// linux/arm-specific vet whitelist. See readme.txt for details.
-
-// These SP references occur after a stack-altering call. They're fine.
-runtime/sys_linux_arm.s: [arm] clone: 12(R13) should be stk+4(FP)
-runtime/sys_linux_arm.s: [arm] clone: 8(R13) should be flags+0(FP)
index 28ab6b16e8b7416353eefbe49be6fce58b58fa5b..c13bf16de2f420c4a4094440acc4df01c0c03e98 100644 (file)
@@ -4,10 +4,17 @@
 
 package runtime
 
-// Stubs to pacify vet. Not safe to call from Go.
-// Calls to these functions are inserted by the compiler or assembler.
+// Called from compiler-generated code; declared for go vet.
 func udiv()
 func _div()
 func _divu()
 func _mod()
 func _modu()
+
+// Called from assembly only; declared for go vet.
+func usplitR0()
+func load_g()
+func save_g()
+func emptyfunc()
+func _initcgo()
+func read_tls_fallback()
index 637123be45f8b4d34e67250b53b8f16597d2e6dc..9c7398451c143ff64e9b8fc7ef8dcd74bd47ab64 100644 (file)
@@ -345,7 +345,6 @@ TEXT runtime·clone(SB),NOSPLIT,$0
        MOVW    $0, R5
 
        // Copy mp, gp, fn off parent stack for use by child.
-       // TODO(kaib): figure out which registers are clobbered by clone and avoid stack copying
        MOVW    $-16(R1), R1
        MOVW    mp+8(FP), R6
        MOVW    R6, 0(R1)
@@ -366,6 +365,7 @@ TEXT runtime·clone(SB),NOSPLIT,$0
        RET
 
        // Paranoia: check that SP is as we expect. Use R13 to avoid linker 'fixup'
+       NOP     R13     // tell vet SP/R13 changed - stop checking offsets
        MOVW    12(R13), R0
        MOVW    $1234, R1
        CMP     R0, R1