aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2022-10-13 10:22:44 +0000
committerAleksandr Nogikh <wp32pw@gmail.com>2022-10-25 11:24:45 -0700
commit78cef5b1cbb65b2b95541b564d795db136b09db1 (patch)
tree4a9dd050f517ee3a17fe5ccf81d608bf857007c3 /pkg
parentafef4a4fae829061730fec5e8be861e6e236020e (diff)
pkg/build: don't take trailing arguments in runMakeImpl
The call has quite a lot of fixed arguments, which makes it prone to errors that do not manifest themselves during compilation (see #3441).
Diffstat (limited to 'pkg')
-rw-r--r--pkg/build/linux.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index 69f623a16..bb6e66ef3 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -143,7 +143,7 @@ func (linux) createImage(params Params, kernelPath string) error {
}
func (linux) clean(kernelDir, targetArch string) error {
- return runMakeImpl(targetArch, "", "", "", kernelDir, "distclean")
+ return runMakeImpl(targetArch, "", "", "", kernelDir, []string{"distclean"})
}
func (linux) writeFile(file string, data []byte) error {
@@ -153,10 +153,10 @@ func (linux) writeFile(file string, data []byte) error {
return osutil.SandboxChown(file)
}
-func runMakeImpl(arch, compiler, linker, ccache, kernelDir string, addArgs ...string) error {
+func runMakeImpl(arch, compiler, linker, ccache, kernelDir string, extraArgs []string) error {
target := targets.Get(targets.Linux, arch)
args := LinuxMakeArgs(target, compiler, linker, ccache, "")
- args = append(args, addArgs...)
+ args = append(args, extraArgs...)
cmd := osutil.Command("make", args...)
if err := osutil.Sandbox(cmd, true, true); err != nil {
return err
@@ -179,8 +179,8 @@ func runMakeImpl(arch, compiler, linker, ccache, kernelDir string, addArgs ...st
return err
}
-func runMake(params Params, addArgs ...string) error {
- return runMakeImpl(params.TargetArch, params.Compiler, params.Linker, params.Ccache, params.KernelDir, addArgs...)
+func runMake(params Params, extraArgs ...string) error {
+ return runMakeImpl(params.TargetArch, params.Compiler, params.Linker, params.Ccache, params.KernelDir, extraArgs)
}
func LinuxMakeArgs(target *targets.Target, compiler, linker, ccache, buildDir string) []string {