diff options
| author | Space Meyer <spm@google.com> | 2023-01-06 12:50:26 +0100 |
|---|---|---|
| committer | Space Meyer <git@the-space.agency> | 2023-01-09 14:25:36 +0100 |
| commit | df3838a1b408f22e5df7cd986138d6ec5768369d (patch) | |
| tree | bddc682c0d599008033f4a3a3e8d8340c4796d91 /pkg | |
| parent | 1dac8c7a01e2bdd35cb04eb4901ddb157291ac2d (diff) | |
syz-ci/jobs: use linker supplied in syz-ci config
Previously we only used the linter from the syz-ci config when building
the kernel for regular fuzzing. We were missing some plumbing to have
this setting reach patch testing and bisection jobs.
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/bisect/bisect.go | 3 | ||||
| -rw-r--r-- | pkg/bisect/bisect_test.go | 2 | ||||
| -rw-r--r-- | pkg/instance/instance.go | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go index 5755bf562..ed961f537 100644 --- a/pkg/bisect/bisect.go +++ b/pkg/bisect/bisect.go @@ -23,6 +23,7 @@ type Config struct { Fix bool DefaultCompiler string CompilerType string + Linker string BinDir string Ccache string Timeout time.Duration @@ -478,7 +479,7 @@ func (env *env) build() (*vcs.Commit, string, error) { return current, "", fmt.Errorf("kernel clean failed: %v", err) } kern := &env.cfg.Kernel - _, imageDetails, err := env.inst.BuildKernel(bisectEnv.Compiler, env.cfg.Ccache, kern.Userspace, + _, imageDetails, err := env.inst.BuildKernel(bisectEnv.Compiler, env.cfg.Linker, env.cfg.Ccache, kern.Userspace, kern.Cmdline, kern.Sysctl, bisectEnv.KernelConfig) if imageDetails.CompilerID != "" { env.log("compiler: %v", imageDetails.CompilerID) diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go index 7930e545c..79bb70400 100644 --- a/pkg/bisect/bisect_test.go +++ b/pkg/bisect/bisect_test.go @@ -32,7 +32,7 @@ func (env *testEnv) BuildSyzkaller(repo, commit string) (string, error) { return "", nil } -func (env *testEnv) BuildKernel(compilerBin, cCache, userspaceDir, cmdlineFile, sysctlFile string, +func (env *testEnv) BuildKernel(compilerBin, linker, cCache, userspaceDir, cmdlineFile, sysctlFile string, kernelConfig []byte) (string, build.ImageDetails, error) { commit := env.headCommit() configHash := hash.String(kernelConfig) diff --git a/pkg/instance/instance.go b/pkg/instance/instance.go index d25eae4c5..b697ab926 100644 --- a/pkg/instance/instance.go +++ b/pkg/instance/instance.go @@ -29,7 +29,7 @@ import ( type Env interface { BuildSyzkaller(string, string) (string, error) - BuildKernel(string, string, string, string, string, []byte) (string, build.ImageDetails, error) + BuildKernel(string, string, string, string, string, string, []byte) (string, build.ImageDetails, error) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]EnvTestResult, error) } @@ -114,7 +114,8 @@ func (env *env) BuildSyzkaller(repoURL, commit string) (string, error) { return buildLog, nil } -func (env *env) BuildKernel(compilerBin, ccacheBin, userspaceDir, cmdlineFile, sysctlFile string, kernelConfig []byte) ( +func (env *env) BuildKernel(compilerBin, linkerBin, ccacheBin, userspaceDir, cmdlineFile, sysctlFile string, + kernelConfig []byte) ( string, build.ImageDetails, error) { imageDir := filepath.Join(env.cfg.Workdir, "image") params := build.Params{ @@ -124,6 +125,7 @@ func (env *env) BuildKernel(compilerBin, ccacheBin, userspaceDir, cmdlineFile, s KernelDir: env.cfg.KernelSrc, OutputDir: imageDir, Compiler: compilerBin, + Linker: linkerBin, Ccache: ccacheBin, UserspaceDir: userspaceDir, CmdlineFile: cmdlineFile, |
