aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-01-24 11:28:55 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-01-24 11:28:55 +0100
commitfa3d6b0b21cfd27db2381afedc5da7a69d587191 (patch)
tree8a0974228d8f8664fe7d8d6942b504afb3a6050d /tools
parentf4e42cabb707a984e6b6e5589653e11cfd2856aa (diff)
Makefile: don't cross-compile executor if cross-compiler is missing
We started building netbsd executor on linux. This fails on CI since cross-compiler is missing. But we don't want to exclude netbsd from presubmit entirely. So check if cross-compiler is missing and just produce a warning. This should unbreak CI and humans will see the warning.
Diffstat (limited to 'tools')
-rw-r--r--tools/syz-env/env.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/syz-env/env.go b/tools/syz-env/env.go
index a5fc4fbb1..cae88c5a9 100644
--- a/tools/syz-env/env.go
+++ b/tools/syz-env/env.go
@@ -6,6 +6,7 @@ package main
import (
"fmt"
"os"
+ "os/exec"
"runtime"
"strconv"
"strings"
@@ -40,6 +41,12 @@ func main() {
{"ADDCFLAGS", strings.Join(target.CrossCFlags, " ")},
{"NCORES", strconv.Itoa(runtime.NumCPU())},
{"EXE", target.ExeExtension},
+ {"NATIVEBUILDOS", target.BuildOS},
+ }
+ if targetOS != runtime.GOOS {
+ if _, err := exec.LookPath(target.CCompiler); err != nil {
+ vars = append(vars, Var{"NO_CROSS_COMPILER", "yes"})
+ }
}
for _, v := range vars {
fmt.Printf("export %v=%v\\n", v.Name, v.Val)