aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/build/linux.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/pkg/build/linux.go b/pkg/build/linux.go
index 735118a1a..b9301d3d9 100644
--- a/pkg/build/linux.go
+++ b/pkg/build/linux.go
@@ -128,6 +128,16 @@ func runMake(kernelDir string, args ...string) error {
return err
}
cmd.Dir = kernelDir
+ cmd.Env = append([]string{}, os.Environ()...)
+ // This makes the build [more] deterministic:
+ // 2 builds from the same sources should result in the same vmlinux binary.
+ // We plan to use it for detecting no-op changes during bisection.
+ cmd.Env = append(cmd.Env,
+ "KBUILD_BUILD_VERSION=0",
+ "KBUILD_BUILD_TIMESTAMP=now",
+ "KBUILD_BUILD_USER=syzkaller",
+ "KBUILD_BUILD_HOST=syzkaller",
+ )
_, err := osutil.Run(time.Hour, cmd)
return err
}