aboutsummaryrefslogtreecommitdiffstats
path: root/sys/test
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-08-02 19:07:22 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-08-02 19:07:22 +0200
commitd9a893a554d6077f5cab4aa8a81f24213443232e (patch)
treead7c6ccd2373fe3fd36183f7d9be114e8503b7ac /sys/test
parent5cbdd9f4445514cbacadc362c2891e40b7f36072 (diff)
Makefile: don't compile all targets into target binaries
Currently target binaries contain support for all OS/arch combinations. However, obviously a fuchsia target binary won't test windows. For target binaries we need support only for a single target (with the exception of 386/arm target in amd64/arm64 binaries). So compile in only _the_ target into target binaries. This reduces akaros/amd64 fuzzer binary from 33 to 7 MB and execprog from 28 to 2 MB.
Diffstat (limited to 'sys/test')
-rw-r--r--sys/test/gen/32_fork_shmem.go8
-rw-r--r--sys/test/gen/32_shmem.go8
-rw-r--r--sys/test/gen/64.go8
-rw-r--r--sys/test/gen/64_fork.go8
-rw-r--r--sys/test/gen/empty.go3
-rw-r--r--sys/test/init.go10
6 files changed, 28 insertions, 17 deletions
diff --git a/sys/test/gen/32_fork_shmem.go b/sys/test/gen/32_fork_shmem.go
index e9c5d42ee..b61c234c1 100644
--- a/sys/test/gen/32_fork_shmem.go
+++ b/sys/test/gen/32_fork_shmem.go
@@ -1,10 +1,14 @@
// AUTOGENERATED FILE
+// +build !syz_target syz_target,syz_os_test,syz_arch_32_fork_shmem
package gen
import . "github.com/google/syzkaller/prog"
+import . "github.com/google/syzkaller/sys/test"
-var Target_32_fork_shmem = &Target{OS: "test", Arch: "32_fork_shmem", Revision: revision_32_fork_shmem, PtrSize: 4, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_32_fork_shmem, Resources: resources_32_fork_shmem, Structs: structDescs_32_fork_shmem, Consts: consts_32_fork_shmem}
+func init() {
+ RegisterTarget(&Target{OS: "test", Arch: "32_fork_shmem", Revision: revision_32_fork_shmem, PtrSize: 4, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_32_fork_shmem, Resources: resources_32_fork_shmem, Structs: structDescs_32_fork_shmem, Consts: consts_32_fork_shmem}, InitTarget)
+}
var resources_32_fork_shmem = []*ResourceDesc(nil)
@@ -24,4 +28,4 @@ var consts_32_fork_shmem = []ConstValue{
{Name: "ONLY_32BITS_CONST", Value: 1},
}
-const revision_32_fork_shmem = "f3f80dea03f2b372f892da4a49e6af7f47106120"
+const revision_32_fork_shmem = "18f983f4760ca5ac41eaf7c18bd9f487f6dde42b"
diff --git a/sys/test/gen/32_shmem.go b/sys/test/gen/32_shmem.go
index 39e2b9400..02db6010e 100644
--- a/sys/test/gen/32_shmem.go
+++ b/sys/test/gen/32_shmem.go
@@ -1,10 +1,14 @@
// AUTOGENERATED FILE
+// +build !syz_target syz_target,syz_os_test,syz_arch_32_shmem
package gen
import . "github.com/google/syzkaller/prog"
+import . "github.com/google/syzkaller/sys/test"
-var Target_32_shmem = &Target{OS: "test", Arch: "32_shmem", Revision: revision_32_shmem, PtrSize: 4, PageSize: 8192, NumPages: 2048, DataOffset: 536870912, Syscalls: syscalls_32_shmem, Resources: resources_32_shmem, Structs: structDescs_32_shmem, Consts: consts_32_shmem}
+func init() {
+ RegisterTarget(&Target{OS: "test", Arch: "32_shmem", Revision: revision_32_shmem, PtrSize: 4, PageSize: 8192, NumPages: 2048, DataOffset: 536870912, Syscalls: syscalls_32_shmem, Resources: resources_32_shmem, Structs: structDescs_32_shmem, Consts: consts_32_shmem}, InitTarget)
+}
var resources_32_shmem = []*ResourceDesc(nil)
@@ -24,4 +28,4 @@ var consts_32_shmem = []ConstValue{
{Name: "ONLY_32BITS_CONST", Value: 1},
}
-const revision_32_shmem = "9819b8a5a8ea14bf3a71d86bb2012bafd6ab25b6"
+const revision_32_shmem = "9d4e8ff9d9c38d5fe7cdc046adcde8be29782e6b"
diff --git a/sys/test/gen/64.go b/sys/test/gen/64.go
index d1057117f..b594499c8 100644
--- a/sys/test/gen/64.go
+++ b/sys/test/gen/64.go
@@ -1,10 +1,14 @@
// AUTOGENERATED FILE
+// +build !syz_target syz_target,syz_os_test,syz_arch_64
package gen
import . "github.com/google/syzkaller/prog"
+import . "github.com/google/syzkaller/sys/test"
-var Target_64 = &Target{OS: "test", Arch: "64", Revision: revision_64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_64, Resources: resources_64, Structs: structDescs_64, Consts: consts_64}
+func init() {
+ RegisterTarget(&Target{OS: "test", Arch: "64", Revision: revision_64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_64, Resources: resources_64, Structs: structDescs_64, Consts: consts_64}, InitTarget)
+}
var resources_64 = []*ResourceDesc{
{Name: "anyres32", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"anyres32"}, Values: []uint64{0}},
@@ -875,4 +879,4 @@ var consts_64 = []ConstValue{
{Name: "SYS_unsupported"},
}
-const revision_64 = "96964f599c9870f5d27e4d6054b0d16011652c81"
+const revision_64 = "981444b6842c8896801fdf67dc75c454cad9e594"
diff --git a/sys/test/gen/64_fork.go b/sys/test/gen/64_fork.go
index 533715055..ca62e9ce0 100644
--- a/sys/test/gen/64_fork.go
+++ b/sys/test/gen/64_fork.go
@@ -1,10 +1,14 @@
// AUTOGENERATED FILE
+// +build !syz_target syz_target,syz_os_test,syz_arch_64_fork
package gen
import . "github.com/google/syzkaller/prog"
+import . "github.com/google/syzkaller/sys/test"
-var Target_64_fork = &Target{OS: "test", Arch: "64_fork", Revision: revision_64_fork, PtrSize: 8, PageSize: 8192, NumPages: 2048, DataOffset: 536870912, Syscalls: syscalls_64_fork, Resources: resources_64_fork, Structs: structDescs_64_fork, Consts: consts_64_fork}
+func init() {
+ RegisterTarget(&Target{OS: "test", Arch: "64_fork", Revision: revision_64_fork, PtrSize: 8, PageSize: 8192, NumPages: 2048, DataOffset: 536870912, Syscalls: syscalls_64_fork, Resources: resources_64_fork, Structs: structDescs_64_fork, Consts: consts_64_fork}, InitTarget)
+}
var resources_64_fork = []*ResourceDesc(nil)
@@ -23,4 +27,4 @@ var consts_64_fork = []ConstValue{
{Name: "IPPROTO_UDP", Value: 17},
}
-const revision_64_fork = "96f1f19d85a4d091cba7b036633c3b48ccfe4439"
+const revision_64_fork = "1c9fe1f1a1f6f871fc5c088ca80174655322aca4"
diff --git a/sys/test/gen/empty.go b/sys/test/gen/empty.go
new file mode 100644
index 000000000..5baff07bf
--- /dev/null
+++ b/sys/test/gen/empty.go
@@ -0,0 +1,3 @@
+// AUTOGENERATED FILE
+// This file is needed if OS is completely excluded by build tags.
+package gen
diff --git a/sys/test/init.go b/sys/test/init.go
index 8e67fd754..815c99a98 100644
--- a/sys/test/init.go
+++ b/sys/test/init.go
@@ -6,16 +6,8 @@ package test
import (
"github.com/google/syzkaller/prog"
"github.com/google/syzkaller/sys/targets"
- "github.com/google/syzkaller/sys/test/gen"
)
-func init() {
- prog.RegisterTarget(gen.Target_64, initTarget)
- prog.RegisterTarget(gen.Target_64_fork, initTarget)
- prog.RegisterTarget(gen.Target_32_shmem, initTarget)
- prog.RegisterTarget(gen.Target_32_fork_shmem, initTarget)
-}
-
-func initTarget(target *prog.Target) {
+func InitTarget(target *prog.Target) {
target.MakeMmap = targets.MakeSyzMmap(target)
}