diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2018-08-02 19:07:22 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2018-08-02 19:07:22 +0200 |
| commit | d9a893a554d6077f5cab4aa8a81f24213443232e (patch) | |
| tree | ad7c6ccd2373fe3fd36183f7d9be114e8503b7ac /sys/fuchsia | |
| parent | 5cbdd9f4445514cbacadc362c2891e40b7f36072 (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/fuchsia')
| -rw-r--r-- | sys/fuchsia/gen/amd64.go | 8 | ||||
| -rw-r--r-- | sys/fuchsia/gen/arm64.go | 8 | ||||
| -rw-r--r-- | sys/fuchsia/gen/empty.go | 3 | ||||
| -rw-r--r-- | sys/fuchsia/init.go | 8 |
4 files changed, 16 insertions, 11 deletions
diff --git a/sys/fuchsia/gen/amd64.go b/sys/fuchsia/gen/amd64.go index 63d7a8ff2..8e91dd584 100644 --- a/sys/fuchsia/gen/amd64.go +++ b/sys/fuchsia/gen/amd64.go @@ -1,10 +1,14 @@ // AUTOGENERATED FILE +// +build !syz_target syz_target,syz_os_fuchsia,syz_arch_amd64 package gen import . "github.com/google/syzkaller/prog" +import . "github.com/google/syzkaller/sys/fuchsia" -var Target_amd64 = &Target{OS: "fuchsia", 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: "fuchsia", 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: "fd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -1317,4 +1321,4 @@ var consts_amd64 = []ConstValue{ {Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1}, } -const revision_amd64 = "9540132f74bbe9bfb7e8f215844bdb3a88b9a665" +const revision_amd64 = "4cc56cb437136b65655dd3e0d9389be66131c7d1" diff --git a/sys/fuchsia/gen/arm64.go b/sys/fuchsia/gen/arm64.go index 326d53079..69bc14651 100644 --- a/sys/fuchsia/gen/arm64.go +++ b/sys/fuchsia/gen/arm64.go @@ -1,10 +1,14 @@ // AUTOGENERATED FILE +// +build !syz_target syz_target,syz_os_fuchsia,syz_arch_arm64 package gen import . "github.com/google/syzkaller/prog" +import . "github.com/google/syzkaller/sys/fuchsia" -var Target_arm64 = &Target{OS: "fuchsia", Arch: "arm64", Revision: revision_arm64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_arm64, Resources: resources_arm64, Structs: structDescs_arm64, Consts: consts_arm64} +func init() { + RegisterTarget(&Target{OS: "fuchsia", Arch: "arm64", Revision: revision_arm64, PtrSize: 8, PageSize: 4096, NumPages: 4096, DataOffset: 536870912, Syscalls: syscalls_arm64, Resources: resources_arm64, Structs: structDescs_arm64, Consts: consts_arm64}, InitTarget) +} var resources_arm64 = []*ResourceDesc{ {Name: "fd", Type: &IntType{IntTypeCommon: IntTypeCommon{TypeCommon: TypeCommon{TypeName: "int32", TypeSize: 4}}}, Kind: []string{"fd"}, Values: []uint64{18446744073709551615, 18446744073709551516}}, @@ -1317,4 +1321,4 @@ var consts_arm64 = []ConstValue{ {Name: "ZX_WAIT_ASYNC_REPEATING", Value: 1}, } -const revision_arm64 = "ebb425942f2bbfd2db293e4a2a0a417f6aaafb1c" +const revision_arm64 = "42ba25aa193b27b48c8f8ade1c9186cb89c7ca61" diff --git a/sys/fuchsia/gen/empty.go b/sys/fuchsia/gen/empty.go new file mode 100644 index 000000000..5baff07bf --- /dev/null +++ b/sys/fuchsia/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/fuchsia/init.go b/sys/fuchsia/init.go index 3f02e151d..eefba3950 100644 --- a/sys/fuchsia/init.go +++ b/sys/fuchsia/init.go @@ -5,15 +5,9 @@ package fuchsia import ( "github.com/google/syzkaller/prog" - "github.com/google/syzkaller/sys/fuchsia/gen" "github.com/google/syzkaller/sys/targets" ) -func init() { - prog.RegisterTarget(gen.Target_amd64, initTarget) - prog.RegisterTarget(gen.Target_arm64, initTarget) -} - -func initTarget(target *prog.Target) { +func InitTarget(target *prog.Target) { target.MakeMmap = targets.MakeSyzMmap(target) } |
