aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-09-20 16:55:28 +0200
committerDmitry Vyukov <dvyukov@google.com>2017-09-20 21:19:29 +0200
commitd606e60dfe3d50499812f7d740dae6e727fa9f76 (patch)
treec064112adf95aef1119c5b81068f97cacdcf2b36
parent9cd52ccb43572d63bda7b0ed13ed57b98951d7eb (diff)
executor: split source per-OS
Update #191
-rw-r--r--Makefile2
-rw-r--r--executor/executor_fuchsia.cc9
-rw-r--r--executor/executor_linux.cc (renamed from executor/executor.cc)0
-rw-r--r--pkg/ipc/ipc_test.go4
4 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 47e33e209..14ec5376d 100644
--- a/Makefile
+++ b/Makefile
@@ -118,7 +118,7 @@ target:
# executor uses stacks of limited size, so no jumbo frames.
executor:
mkdir -p ./bin/$(TARGETOS)_$(TARGETARCH)
- $(CC) -o ./bin/$(TARGETOS)_$(TARGETARCH)/syz-executor executor/executor.cc \
+ $(CC) -o ./bin/$(TARGETOS)_$(TARGETARCH)/syz-executor executor/executor_$(TARGETOS).cc \
-pthread -Wall -Wframe-larger-than=8192 -Wparentheses -Werror -O1 -g \
$(ADDCFLAGS) $(CFLAGS) -DGIT_REVISION=\"$(REV)\"
diff --git a/executor/executor_fuchsia.cc b/executor/executor_fuchsia.cc
new file mode 100644
index 000000000..6a312167b
--- /dev/null
+++ b/executor/executor_fuchsia.cc
@@ -0,0 +1,9 @@
+// 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
+
+int main()
+{
+ return 0;
+}
diff --git a/executor/executor.cc b/executor/executor_linux.cc
index cd0e406ff..cd0e406ff 100644
--- a/executor/executor.cc
+++ b/executor/executor_linux.cc
diff --git a/pkg/ipc/ipc_test.go b/pkg/ipc/ipc_test.go
index d52579553..ca0af1060 100644
--- a/pkg/ipc/ipc_test.go
+++ b/pkg/ipc/ipc_test.go
@@ -4,6 +4,7 @@
package ipc
import (
+ "fmt"
"math/rand"
"os"
"path/filepath"
@@ -20,7 +21,8 @@ import (
const timeout = 10 * time.Second
func buildExecutor(t *testing.T, target *prog.Target) string {
- return buildProgram(t, target, filepath.FromSlash("../../executor/executor.cc"))
+ src := fmt.Sprintf("../../executor/executor_%v.cc", target.OS)
+ return buildProgram(t, target, filepath.FromSlash(src))
}
func buildSource(t *testing.T, target *prog.Target, src []byte) string {