aboutsummaryrefslogtreecommitdiffstats
path: root/tools/syz-kconf
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2022-01-28 10:27:54 +0100
committerDmitry Vyukov <dvyukov@google.com>2022-02-05 08:59:58 +0100
commita7dab6385c1d95547a88e22577fb56fbcd5c37eb (patch)
treee4874b1228432ed61c8bb67ddea4cf3fb81f454b /tools/syz-kconf
parente13a05ed99be3112220ed09062bd52e1c0a2ffb6 (diff)
tools/syz-kconf: allow to specify custom compiler
This will be needed at least for kmsan config which needs a fresh clang.
Diffstat (limited to 'tools/syz-kconf')
-rw-r--r--tools/syz-kconf/kconf.go4
-rw-r--r--tools/syz-kconf/parser.go8
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/syz-kconf/kconf.go b/tools/syz-kconf/kconf.go
index c46c73170..316ffd3a8 100644
--- a/tools/syz-kconf/kconf.go
+++ b/tools/syz-kconf/kconf.go
@@ -425,7 +425,9 @@ func (ctx *Context) Make(args ...string) error {
if ctx.Target.Triple != "" {
args = append(args, "CROSS_COMPILE="+ctx.Target.Triple+"-")
}
- if ctx.Target.KernelCompiler != "" {
+ if ctx.Inst.Compiler != "" {
+ args = append(args, "CC="+ctx.Inst.Compiler)
+ } else if ctx.Target.KernelCompiler != "" {
args = append(args, "CC="+ctx.Target.KernelCompiler)
}
_, err := osutil.RunCmd(10*time.Minute, ctx.SourceDir, "make", args...)
diff --git a/tools/syz-kconf/parser.go b/tools/syz-kconf/parser.go
index 8b8a074c7..64aad9403 100644
--- a/tools/syz-kconf/parser.go
+++ b/tools/syz-kconf/parser.go
@@ -19,6 +19,7 @@ import (
type Instance struct {
Name string
Kernel Kernel
+ Compiler string
Verbatim []byte
Shell []Shell
Features Features
@@ -79,6 +80,7 @@ type rawFile struct {
Repo string
Tag string
}
+ Compiler string
Shell []yaml.Node
Verbatim string
Config []yaml.Node
@@ -181,6 +183,12 @@ func mergeFile(inst *Instance, raw *rawFile, file string, errs *Errors) {
}
inst.Kernel = raw.Kernel
}
+ if raw.Compiler != "" {
+ if inst.Compiler != "" {
+ errs.push("%v: compiler is set twice", file)
+ }
+ inst.Compiler = raw.Compiler
+ }
for _, node := range raw.Shell {
cmd, _, constraints, err := parseNode(node)
if err != nil {