aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/syz-kconf/kconf.go3
-rw-r--r--tools/syz-kconf/parser.go8
2 files changed, 11 insertions, 0 deletions
diff --git a/tools/syz-kconf/kconf.go b/tools/syz-kconf/kconf.go
index 9745ad3b8..ec8f3e54a 100644
--- a/tools/syz-kconf/kconf.go
+++ b/tools/syz-kconf/kconf.go
@@ -429,6 +429,9 @@ func (ctx *Context) Make(args ...string) error {
} else if ctx.Target.KernelCompiler != "" {
args = append(args, "CC="+ctx.Target.KernelCompiler)
}
+ if ctx.Inst.Linker != "" {
+ args = append(args, "LD="+ctx.replaceVars(ctx.Inst.Linker))
+ }
_, err := osutil.RunCmd(10*time.Minute, ctx.SourceDir, "make", args...)
return err
}
diff --git a/tools/syz-kconf/parser.go b/tools/syz-kconf/parser.go
index 64aad9403..00455c3e5 100644
--- a/tools/syz-kconf/parser.go
+++ b/tools/syz-kconf/parser.go
@@ -20,6 +20,7 @@ type Instance struct {
Name string
Kernel Kernel
Compiler string
+ Linker string
Verbatim []byte
Shell []Shell
Features Features
@@ -81,6 +82,7 @@ type rawFile struct {
Tag string
}
Compiler string
+ Linker string
Shell []yaml.Node
Verbatim string
Config []yaml.Node
@@ -189,6 +191,12 @@ func mergeFile(inst *Instance, raw *rawFile, file string, errs *Errors) {
}
inst.Compiler = raw.Compiler
}
+ if raw.Linker != "" {
+ if inst.Linker != "" {
+ errs.push("%v: linker is set twice", file)
+ }
+ inst.Linker = raw.Linker
+ }
for _, node := range raw.Shell {
cmd, _, constraints, err := parseNode(node)
if err != nil {