executor: split source per-OS

Update #191
This commit is contained in:
Dmitry Vyukov 2017-09-20 16:55:28 +02:00
parent 9cd52ccb43
commit d606e60dfe
4 changed files with 13 additions and 2 deletions

View File

@ -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)\"

View File

@ -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;
}

View File

@ -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 {