From 2c2e5f7129ca5060ce1f8f46c37ce6ee3e88114a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sun, 16 Sep 2018 11:18:09 +0200 Subject: sys/targets: use native compiler for test OS We used to use gcc for test OS, but this is linux-specific. Other OSes may use c++ or clang as main compiler, so use whatever is the default for the host OS. Update #712 --- sys/targets/targets.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/targets/targets.go b/sys/targets/targets.go index 8d2e37f3f..42731b8fa 100644 --- a/sys/targets/targets.go +++ b/sys/targets/targets.go @@ -302,6 +302,9 @@ func init() { initTarget(target, OS, arch) } } + for _, target := range List["test"] { + target.CCompiler = List[runtime.GOOS][runtime.GOARCH].CCompiler + } } func initTarget(target *Target, OS, arch string) { @@ -315,7 +318,7 @@ func initTarget(target *Target, OS, arch string) { } target.DataOffset = 512 << 20 target.NumPages = (16 << 20) / target.PageSize - if OS == runtime.GOOS && arch == runtime.GOARCH { + if OS == "linux" && arch == runtime.GOARCH { // Don't use cross-compiler for native compilation, there are cases when this does not work: // https://github.com/google/syzkaller/pull/619 // https://github.com/google/syzkaller/issues/387 -- cgit mrf-deployment