This is a note to let you know that I've just added the patch titled kbuild: Quote OBJCOPY var to avoid a pahole call break the build to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: kbuild-quote-objcopy-var-to-avoid-a-pahole-call-break-the-build.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From foo@baz Wed Oct 26 06:44:13 PM CEST 2022 From: Jiri Olsa <jolsa@xxxxxxxxxx> Date: Wed, 19 Oct 2022 10:56:01 +0200 Subject: kbuild: Quote OBJCOPY var to avoid a pahole call break the build To: stable@xxxxxxxxxxxxxxx Cc: "Andrii Nakryiko" <andrii@xxxxxxxxxx>, "Arnaldo Carvalho de Melo" <acme@xxxxxxxxxx>, bpf@xxxxxxxxxxxxxxx, "Arnaldo Carvalho de Melo" <acme@xxxxxxxxxx>, "Daniel Borkmann" <daniel@xxxxxxxxxxxxx>, "Martin Rodriguez Reboredo" <yakoyoku@xxxxxxxxx>, "Javier Martinez Canillas" <javierm@xxxxxxxxxx>, "Ilya Leoshkevich" <iii@xxxxxxxxxxxxx>, "Nathan Chancellor" <nathan@xxxxxxxxxx>, "Philip Müller" <philm@xxxxxxxxxxx> Message-ID: <20221019085604.1017583-3-jolsa@xxxxxxxxxx> From: Javier Martinez Canillas <javierm@xxxxxxxxxx> commit ff2e6efda0d5c51b33e2bcc0b0b981ac0a0ef214 upstream. [backported for dependency, skipped Makefile.modfinal change, because module BTF is not supported in 5.10] The ccache tool can be used to speed up cross-compilation, by calling the compiler and binutils through ccache. For example, following should work: $ export ARCH=arm64 CROSS_COMPILE="ccache aarch64-linux-gnu-" $ make M=drivers/gpu/drm/rockchip/ but pahole fails to extract the BTF info from DWARF, breaking the build: CC [M] drivers/gpu/drm/rockchip//rockchipdrm.mod.o LD [M] drivers/gpu/drm/rockchip//rockchipdrm.ko BTF [M] drivers/gpu/drm/rockchip//rockchipdrm.ko aarch64-linux-gnu-objcopy: invalid option -- 'J' Usage: aarch64-linux-gnu-objcopy [option(s)] in-file [out-file] Copies a binary file, possibly transforming it in the process ... make[1]: *** [scripts/Makefile.modpost:156: __modpost] Error 2 make: *** [Makefile:1866: modules] Error 2 this fails because OBJCOPY is set to "ccache aarch64-linux-gnu-copy" and later pahole is executed with the following command line: LLVM_OBJCOPY=$(OBJCOPY) $(PAHOLE) -J --btf_base vmlinux $@ which gets expanded to: LLVM_OBJCOPY=ccache aarch64-linux-gnu-objcopy pahole -J ... instead of: LLVM_OBJCOPY="ccache aarch64-linux-gnu-objcopy" pahole -J ... Fixes: 5f9ae91f7c0d ("kbuild: Build kernel module BTFs if BTF is enabled and pahole supports it") Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx> Signed-off-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> Acked-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/20210526215228.3729875-1-javierm@xxxxxxxxxx Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- scripts/link-vmlinux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -162,7 +162,7 @@ gen_btf() vmlinux_link ${1} info "BTF" ${2} - LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1} + LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${extra_paholeopt} ${1} # Create ${2} which contains just .BTF section but no symbols. Add # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all Patches currently in stable-queue which might be from jolsa@xxxxxxxxxx are queue-5.10/bpf-generate-btf_kind_float-when-linking-vmlinux.patch queue-5.10/kbuild-skip-per-cpu-btf-generation-for-pahole-v1.18-v1.21.patch queue-5.10/kbuild-quote-objcopy-var-to-avoid-a-pahole-call-break-the-build.patch queue-5.10/kbuild-unify-options-for-btf-generation-for-vmlinux-and-modules.patch queue-5.10/kbuild-add-skip_encoding_btf_enum64-option-to-pahole.patch