aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorPatrick Meyer <meyerpatrick@google.com>2021-05-08 20:39:02 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-05-20 13:29:54 +0200
commit0f87d2b200b5025fb813cd728e71d9a386595f8a (patch)
tree06f706bd8b5cf82c137f1d52a6f89c9333ae8960 /sys
parenta343ba6b077a3efe7feb57783dcbb7496d2c3572 (diff)
sys/targets: add darwin/amd64 target
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/sys/targets/targets.go b/sys/targets/targets.go
index dd3977795..475f9ed6b 100644
--- a/sys/targets/targets.go
+++ b/sys/targets/targets.go
@@ -116,6 +116,7 @@ type Timeouts struct {
const (
Akaros = "akaros"
FreeBSD = "freebsd"
+ Darwin = "darwin"
Fuchsia = "fuchsia"
Linux = "linux"
NetBSD = "netbsd"
@@ -331,6 +332,17 @@ var List = map[string]map[string]*Target{
},
},
},
+ Darwin: {
+ AMD64: {
+ PtrSize: 8,
+ PageSize: 4 << 10,
+ DataOffset: 512 << 24,
+ LittleEndian: true,
+ CCompiler: "clang",
+ CFlags: []string{"-m64"},
+ NeedSyscallDefine: dontNeedSyscallDefine,
+ },
+ },
NetBSD: {
AMD64: {
PtrSize: 8,
@@ -448,6 +460,28 @@ var oses = map[string]osCommon{
CPP: "g++",
cflags: []string{"-static", "-lc++"},
},
+ Darwin: {
+ SyscallNumbers: true,
+ Int64SyscallArgs: true,
+ SyscallPrefix: "SYS_",
+ // Note: Seems like darwin really doesn't like MAP_FIXED. Every once in
+ // a while the mmap will fail, causing syz-manager to restart the VM. I
+ // tried mmaping in a loop on linux and darwin. On linux the mmap
+ // always works. On darwin it returns an error in bursts. It used to be
+ // pretty frequent, but now it's so seldom I just ignore it. Beware.
+ ExecutorUsesShmem: true,
+ // FIXME(HerrSpace): ForkServer is b0rked in a peculiar way. I did some
+ // printf debugging in parseOutput in ipc.go. It usually works for a
+ // few executions. Eventually the reported ncmd stops making sense and
+ // the resulting replies are partially garbage. I also looked at the
+ // executor side of things, but that's harder to track as we are just
+ // banging bytes in the shmem there and don't use structs like on the
+ // go side.
+ ExecutorUsesForkServer: false,
+ KernelObject: "kernel.kasan",
+ CPP: "clang++",
+ cflags: []string{"-static", "-lc++"},
+ },
NetBSD: {
BuildOS: Linux,
SyscallNumbers: true,