From 8ed3d47016fdf9afc7672bd6fddcf4a7250b6d12 Mon Sep 17 00:00:00 2001 From: Space Meyer Date: Sat, 30 Jul 2022 12:04:54 +0000 Subject: pkg/vcs: cherry pick fix for compiling linux with clang prior to v5.11 --- pkg/vcs/linux.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'pkg/vcs/linux.go') diff --git a/pkg/vcs/linux.go b/pkg/vcs/linux.go index d48db3256..a44729233 100644 --- a/pkg/vcs/linux.go +++ b/pkg/vcs/linux.go @@ -137,6 +137,22 @@ func (ctx *linux) EnvForCommit(binDir, commit string, kernelConfig []byte) (*Bis KernelConfig: cf.Serialize(), } + // Compiling v4.6..v5.11 with a modern objtool, w/o this patch, results in the + // following issue, when compiling with clang: + // arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table + // We don't bisect that far back with neither clang nor gcc, so this should be fine: + fix := "1d489151e9f9d1647110277ff77282fe4d96d09b" + contained, err := ctx.git.Contains(fix) + if err != nil { + return nil, err + } + if !contained { + _, err := ctx.git.git("cherry-pick", "--no-commit", fix) + if err != nil { + return nil, err + } + } + return env, nil } -- cgit mrf-deployment