From 95793bce7d3eaa26fe814335010d7514e9da46fa Mon Sep 17 00:00:00 2001 From: Alexey Kardashevskiy Date: Tue, 6 Jul 2021 14:01:49 +1000 Subject: pkg: update generated files to go 1.17 "make generate" produces this diff when go 1.17 (go1.17-c95464f0ea3f==upstream) is used. Seems compatible with >=1.16. https://github.com/golang/go/commit/4d2d89ff42ca documents the syntax. https://github.com/golang/go/commit/eeadce2d8713 enforces "ignore" for unsatisfiable tags hence the pkg/csource/gen.go change. Signed-off-by: Alexey Kardashevskiy --- executor/gen.go | 1 + pkg/build/linux_nolinux.go | 1 + pkg/build/linux_test.go | 1 + pkg/cover/report_test.go | 1 + pkg/csource/gen.go | 3 ++- pkg/csource/race_test.go | 1 + pkg/host/host_akaros.go | 1 + pkg/host/host_fuchsia.go | 1 + pkg/host/syscalls_linux_test.go | 1 + pkg/ifuzz/powerpc/generated/insns.go | 1 + pkg/ifuzz/x86/generated/insns.go | 1 + pkg/ifuzz/x86/xed.go | 1 + pkg/kd/kd_test.go | 1 + pkg/osutil/osutil_akaros.go | 1 + pkg/osutil/osutil_bsd.go | 1 + pkg/osutil/osutil_fuchsia.go | 1 + pkg/osutil/osutil_unix.go | 1 + prog/big_endian.go | 1 + prog/little_endian.go | 1 + prog/norace_test.go | 1 + prog/race_test.go | 1 + sys/linux/init_alg_test.go | 1 + tools/syz-imagegen/imagegen.go | 1 + tools/syz-linter/linter.go | 2 +- tools/syz-trace2syz/parser/lex.go | 1 + tools/syz-trace2syz/parser/parser.go | 1 + tools/syz-trace2syz/parser/parser_test.go | 1 + tools/syz-trace2syz/parser/strace.go | 1 + tools/syz-trace2syz/proggen/fuzz.go | 1 + tools/syz-trace2syz/proggen/generate_unions.go | 1 + tools/syz-trace2syz/proggen/proggen.go | 1 + tools/syz-trace2syz/proggen/proggen_test.go | 1 + tools/syz-trace2syz/trace2syz.go | 1 + vm/adb/adb.go | 1 + vm/gce/tar_go1.10.go | 1 + vm/gce/tar_go1.9.go | 1 + vm/odroid/odroid.go | 1 + 37 files changed, 38 insertions(+), 2 deletions(-) diff --git a/executor/gen.go b/executor/gen.go index a4932913f..66f3880b2 100644 --- a/executor/gen.go +++ b/executor/gen.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build amd64 && !freebsd && !darwin && !openbsd && !netbsd // +build amd64,!freebsd,!darwin,!openbsd,!netbsd //go:generate bash -c "gcc kvm_gen.cc kvm.S -o kvm_gen && ./kvm_gen > kvm.S.h && rm ./kvm_gen" diff --git a/pkg/build/linux_nolinux.go b/pkg/build/linux_nolinux.go index 1bffbeaae..7353bb275 100644 --- a/pkg/build/linux_nolinux.go +++ b/pkg/build/linux_nolinux.go @@ -1,6 +1,7 @@ // Copyright 2021 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !linux // +build !linux package build diff --git a/pkg/build/linux_test.go b/pkg/build/linux_test.go index 1088641e6..0babee967 100644 --- a/pkg/build/linux_test.go +++ b/pkg/build/linux_test.go @@ -1,6 +1,7 @@ // Copyright 2019 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build linux // +build linux package build diff --git a/pkg/cover/report_test.go b/pkg/cover/report_test.go index 3461fcf58..1f3db475d 100644 --- a/pkg/cover/report_test.go +++ b/pkg/cover/report_test.go @@ -3,6 +3,7 @@ // It may or may not work on other OSes. // If you test on another OS and it works, enable it. +//go:build linux // +build linux package cover diff --git a/pkg/csource/gen.go b/pkg/csource/gen.go index c92c4b581..196aaf554 100644 --- a/pkg/csource/gen.go +++ b/pkg/csource/gen.go @@ -1,7 +1,8 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. -// +build +//go:build ignore +// +build ignore package main diff --git a/pkg/csource/race_test.go b/pkg/csource/race_test.go index 6e497e552..c41cef5d3 100644 --- a/pkg/csource/race_test.go +++ b/pkg/csource/race_test.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build race // +build race package csource diff --git a/pkg/host/host_akaros.go b/pkg/host/host_akaros.go index 1eb7c360c..23668683a 100644 --- a/pkg/host/host_akaros.go +++ b/pkg/host/host_akaros.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build akaros // +build akaros package host diff --git a/pkg/host/host_fuchsia.go b/pkg/host/host_fuchsia.go index 4ef73370c..bbfb41d1d 100644 --- a/pkg/host/host_fuchsia.go +++ b/pkg/host/host_fuchsia.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build fuchsia // +build fuchsia package host diff --git a/pkg/host/syscalls_linux_test.go b/pkg/host/syscalls_linux_test.go index 70adfbae9..5fc87377c 100644 --- a/pkg/host/syscalls_linux_test.go +++ b/pkg/host/syscalls_linux_test.go @@ -1,6 +1,7 @@ // Copyright 2015 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build linux // +build linux package host diff --git a/pkg/ifuzz/powerpc/generated/insns.go b/pkg/ifuzz/powerpc/generated/insns.go index ba85eaae0..32ffde285 100644 --- a/pkg/ifuzz/powerpc/generated/insns.go +++ b/pkg/ifuzz/powerpc/generated/insns.go @@ -1,5 +1,6 @@ // Code generated by ./powerisa30_to_syz. DO NOT EDIT. +//go:build !codeanalysis // +build !codeanalysis package generated diff --git a/pkg/ifuzz/x86/generated/insns.go b/pkg/ifuzz/x86/generated/insns.go index e66b34d72..3a7153a09 100644 --- a/pkg/ifuzz/x86/generated/insns.go +++ b/pkg/ifuzz/x86/generated/insns.go @@ -1,5 +1,6 @@ // Code generated by pkg/ifuzz/gen. DO NOT EDIT. +//go:build !codeanalysis // +build !codeanalysis package generated diff --git a/pkg/ifuzz/x86/xed.go b/pkg/ifuzz/x86/xed.go index 769ea8b68..6adf45314 100644 --- a/pkg/ifuzz/x86/xed.go +++ b/pkg/ifuzz/x86/xed.go @@ -7,6 +7,7 @@ // -I $INTELXED/build/obj" CGO_LDFLAGS="$INTELXED/build/obj/libxed.a" \ // go test -v -tags xed +//go:build xed // +build xed package x86 diff --git a/pkg/kd/kd_test.go b/pkg/kd/kd_test.go index 9ffeaf315..5c55ffd29 100644 --- a/pkg/kd/kd_test.go +++ b/pkg/kd/kd_test.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !s390x // +build !s390x package kd diff --git a/pkg/osutil/osutil_akaros.go b/pkg/osutil/osutil_akaros.go index d1001a37e..210a208e8 100644 --- a/pkg/osutil/osutil_akaros.go +++ b/pkg/osutil/osutil_akaros.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build akaros // +build akaros package osutil diff --git a/pkg/osutil/osutil_bsd.go b/pkg/osutil/osutil_bsd.go index 68bcfa415..221f86054 100644 --- a/pkg/osutil/osutil_bsd.go +++ b/pkg/osutil/osutil_bsd.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build freebsd || netbsd || openbsd // +build freebsd netbsd openbsd package osutil diff --git a/pkg/osutil/osutil_fuchsia.go b/pkg/osutil/osutil_fuchsia.go index 31d5ca419..da596d47a 100644 --- a/pkg/osutil/osutil_fuchsia.go +++ b/pkg/osutil/osutil_fuchsia.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build fuchsia // +build fuchsia package osutil diff --git a/pkg/osutil/osutil_unix.go b/pkg/osutil/osutil_unix.go index 3ab025e1a..0ab5dfd05 100644 --- a/pkg/osutil/osutil_unix.go +++ b/pkg/osutil/osutil_unix.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build freebsd || netbsd || openbsd || linux || darwin // +build freebsd netbsd openbsd linux darwin package osutil diff --git a/prog/big_endian.go b/prog/big_endian.go index 1f9ebfffe..5add364f1 100644 --- a/prog/big_endian.go +++ b/prog/big_endian.go @@ -1,6 +1,7 @@ // Copyright 2020 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build s390x // +build s390x package prog diff --git a/prog/little_endian.go b/prog/little_endian.go index 12acd9b5f..9ebe8925c 100644 --- a/prog/little_endian.go +++ b/prog/little_endian.go @@ -1,6 +1,7 @@ // Copyright 2020 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build amd64 || 386 || arm64 || arm || mips64le || ppc64le || riscv64 // +build amd64 386 arm64 arm mips64le ppc64le riscv64 package prog diff --git a/prog/norace_test.go b/prog/norace_test.go index 528d64877..02b461925 100644 --- a/prog/norace_test.go +++ b/prog/norace_test.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !race // +build !race package prog diff --git a/prog/race_test.go b/prog/race_test.go index 5d4787717..0c41a94f2 100644 --- a/prog/race_test.go +++ b/prog/race_test.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build race // +build race package prog diff --git a/sys/linux/init_alg_test.go b/sys/linux/init_alg_test.go index c9ca5f40a..a8810da84 100644 --- a/sys/linux/init_alg_test.go +++ b/sys/linux/init_alg_test.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build linux // +build linux package linux diff --git a/tools/syz-imagegen/imagegen.go b/tools/syz-imagegen/imagegen.go index c2c1eb663..216e7fc3e 100644 --- a/tools/syz-imagegen/imagegen.go +++ b/tools/syz-imagegen/imagegen.go @@ -2,6 +2,7 @@ // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. // As we use syscall package: +//go:build linux // +build linux // syz-imagegen generates sys/linux/test/syz_mount_image_* test files. diff --git a/tools/syz-linter/linter.go b/tools/syz-linter/linter.go index 457d57935..3afc84ca4 100644 --- a/tools/syz-linter/linter.go +++ b/tools/syz-linter/linter.go @@ -145,7 +145,7 @@ var ( noPeriodComment = regexp.MustCompile(`^// [A-Z][a-z].+[a-z]$`) lowerCaseComment = regexp.MustCompile(`^// [a-z]+ `) onelineExceptions = regexp.MustCompile(`// want \"|http:|https:`) - specialComment = regexp.MustCompile(`//go:generate|// nolint:`) + specialComment = regexp.MustCompile(`//go:generate|//go:build|// nolint:`) ) // checkStringLenCompare checks for string len comparisons with 0. diff --git a/tools/syz-trace2syz/parser/lex.go b/tools/syz-trace2syz/parser/lex.go index ddffeda04..e200463c1 100644 --- a/tools/syz-trace2syz/parser/lex.go +++ b/tools/syz-trace2syz/parser/lex.go @@ -2,6 +2,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package parser diff --git a/tools/syz-trace2syz/parser/parser.go b/tools/syz-trace2syz/parser/parser.go index a246acdc1..d7df4536b 100644 --- a/tools/syz-trace2syz/parser/parser.go +++ b/tools/syz-trace2syz/parser/parser.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package parser diff --git a/tools/syz-trace2syz/parser/parser_test.go b/tools/syz-trace2syz/parser/parser_test.go index c689c8bd9..c08712d3a 100644 --- a/tools/syz-trace2syz/parser/parser_test.go +++ b/tools/syz-trace2syz/parser/parser_test.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package parser diff --git a/tools/syz-trace2syz/parser/strace.go b/tools/syz-trace2syz/parser/strace.go index 25a2bb284..47ace7fba 100644 --- a/tools/syz-trace2syz/parser/strace.go +++ b/tools/syz-trace2syz/parser/strace.go @@ -4,6 +4,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package parser diff --git a/tools/syz-trace2syz/proggen/fuzz.go b/tools/syz-trace2syz/proggen/fuzz.go index da4fae7bb..656e8adbe 100644 --- a/tools/syz-trace2syz/proggen/fuzz.go +++ b/tools/syz-trace2syz/proggen/fuzz.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package proggen diff --git a/tools/syz-trace2syz/proggen/generate_unions.go b/tools/syz-trace2syz/proggen/generate_unions.go index d4f50a570..d3caa7bf0 100644 --- a/tools/syz-trace2syz/proggen/generate_unions.go +++ b/tools/syz-trace2syz/proggen/generate_unions.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package proggen diff --git a/tools/syz-trace2syz/proggen/proggen.go b/tools/syz-trace2syz/proggen/proggen.go index 697c09893..866dfbba0 100644 --- a/tools/syz-trace2syz/proggen/proggen.go +++ b/tools/syz-trace2syz/proggen/proggen.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package proggen diff --git a/tools/syz-trace2syz/proggen/proggen_test.go b/tools/syz-trace2syz/proggen/proggen_test.go index 5f0531971..06703df0e 100644 --- a/tools/syz-trace2syz/proggen/proggen_test.go +++ b/tools/syz-trace2syz/proggen/proggen_test.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis package proggen diff --git a/tools/syz-trace2syz/trace2syz.go b/tools/syz-trace2syz/trace2syz.go index 89081d57c..b30cc471c 100644 --- a/tools/syz-trace2syz/trace2syz.go +++ b/tools/syz-trace2syz/trace2syz.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !codeanalysis // +build !codeanalysis // syz-trace2syz converts strace traces to syzkaller programs. diff --git a/vm/adb/adb.go b/vm/adb/adb.go index 94aad1ac6..dc415cced 100644 --- a/vm/adb/adb.go +++ b/vm/adb/adb.go @@ -1,6 +1,7 @@ // Copyright 2015 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !ppc64le // +build !ppc64le package adb diff --git a/vm/gce/tar_go1.10.go b/vm/gce/tar_go1.10.go index 88a5d1fda..713f71d36 100644 --- a/vm/gce/tar_go1.10.go +++ b/vm/gce/tar_go1.10.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build go1.10 // +build go1.10 package gce diff --git a/vm/gce/tar_go1.9.go b/vm/gce/tar_go1.9.go index a26ecbdd5..7ca207100 100644 --- a/vm/gce/tar_go1.9.go +++ b/vm/gce/tar_go1.9.go @@ -1,6 +1,7 @@ // Copyright 2018 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build !go1.10 // +build !go1.10 package gce diff --git a/vm/odroid/odroid.go b/vm/odroid/odroid.go index 83d468439..63a4454ea 100644 --- a/vm/odroid/odroid.go +++ b/vm/odroid/odroid.go @@ -1,6 +1,7 @@ // Copyright 2017 syzkaller project authors. All rights reserved. // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. +//go:build odroid // +build odroid package odroid -- cgit mrf-deployment