aboutsummaryrefslogtreecommitdiffstats
path: root/sys/windows
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/windows
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/windows')
-rw-r--r--sys/windows/gen/amd64.go8
-rw-r--r--sys/windows/gen/empty.go3
-rw-r--r--sys/windows/init.go7
3 files changed, 10 insertions, 8 deletions
diff --git a/sys/windows/gen/amd64.go b/sys/windows/gen/amd64.go
index 47cf0eae3..445fc3d01 100644
--- a/sys/windows/gen/amd64.go
+++ b/sys/windows/gen/amd64.go
@@ -1,10 +1,14 @@
// AUTOGENERATED FILE
+// +build !syz_target syz_target,syz_os_windows,syz_arch_amd64
package gen
import . "github.com/google/syzkaller/prog"
+import . "github.com/google/syzkaller/sys/windows"
-var Target_amd64 = &Target{OS: "windows", Arch: "amd64", Revision: revision_amd64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_amd64, Resources: resources_amd64, Structs: structDescs_amd64, Consts: consts_amd64}
+func init() {
+ RegisterTarget(&Target{OS: "windows", Arch: "amd64", Revision: revision_amd64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_amd64, Resources: resources_amd64, Structs: structDescs_amd64, Consts: consts_amd64}, InitTarget)
+}
var resources_amd64 = []*ResourceDesc{
{Name: "HANDLE", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "intptr", TypeSize: 8}}}, Kind: []string{"HANDLE"}, Values: []uint64{18446744073709551615}},
@@ -14611,4 +14615,4 @@ var consts_amd64 = []ConstValue{
{Name: "WRITE_OWNER", Value: 524288},
}
-const revision_amd64 = "e9562f6b9973e9e9a9522fd8ec12b4e913f13b4c"
+const revision_amd64 = "f2b48fb82a68b0cb24b2ab9638add66deb9542dd"
diff --git a/sys/windows/gen/empty.go b/sys/windows/gen/empty.go
new file mode 100644
index 000000000..5baff07bf
--- /dev/null
+++ b/sys/windows/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/windows/init.go b/sys/windows/init.go
index f27f89cb0..2c165cea7 100644
--- a/sys/windows/init.go
+++ b/sys/windows/init.go
@@ -5,14 +5,9 @@ package windows
import (
"github.com/google/syzkaller/prog"
- "github.com/google/syzkaller/sys/windows/gen"
)
-func init() {
- prog.RegisterTarget(gen.Target_amd64, initTarget)
-}
-
-func initTarget(target *prog.Target) {
+func InitTarget(target *prog.Target) {
arch := &arch{
virtualAllocSyscall: target.SyscallMap["VirtualAlloc"],
MEM_COMMIT: target.ConstMap["MEM_COMMIT"],