aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-09-16 11:18:09 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-09-17 10:53:29 +0200
commit2c2e5f7129ca5060ce1f8f46c37ce6ee3e88114a (patch)
treef2118321590323c8f25a047cd734c83e0ef3c740 /sys
parent2e81ad19264ad65389bed4a7da11aece3ee72611 (diff)
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
Diffstat (limited to 'sys')
-rw-r--r--sys/targets/targets.go5
1 files changed, 4 insertions, 1 deletions
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