This is a note to let you know that I've just added the patch titled tools/resolve_btfids: Compile resolve_btfids as host program to the 6.1-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: tools-resolve_btfids-compile-resolve_btfids-as-host-program.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 56a2df7615fa050cc67b89245b2a482849077939 Mon Sep 17 00:00:00 2001 From: Jiri Olsa <jolsa@xxxxxxxxxx> Date: Thu, 2 Feb 2023 12:28:39 +0100 Subject: tools/resolve_btfids: Compile resolve_btfids as host program From: Jiri Olsa <jolsa@xxxxxxxxxx> commit 56a2df7615fa050cc67b89245b2a482849077939 upstream. Making resolve_btfids to be compiled as host program so we can avoid cross compile issues as reported by Nathan. Also we no longer need HOST_OVERRIDES for BINARY target, just for 'prepare' targets. Fixes: 13e07691a16f ("tools/resolve_btfids: Alter how HOSTCC is forced") Reported-by: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx> Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx> Tested-by: Nathan Chancellor <nathan@xxxxxxxxxx> Acked-by: Ian Rogers <irogers@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/20230202112839.1131892-1-jolsa@xxxxxxxxxx Cc: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/bpf/resolve_btfids/Build | 4 +++- tools/bpf/resolve_btfids/Makefile | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) --- a/tools/bpf/resolve_btfids/Build +++ b/tools/bpf/resolve_btfids/Build @@ -1,3 +1,5 @@ +hostprogs := resolve_btfids + resolve_btfids-y += main.o resolve_btfids-y += rbtree.o resolve_btfids-y += zalloc.o @@ -7,4 +9,4 @@ resolve_btfids-y += str_error_r.o $(OUTPUT)%.o: ../../lib/%.c FORCE $(call rule_mkdir) - $(call if_changed_dep,cc_o_c) + $(call if_changed_dep,host_cc_o_c) --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -22,6 +22,9 @@ HOST_OVERRIDES := AR="$(HOSTAR)" CC="$(H EXTRA_CFLAGS="$(HOSTCFLAGS) $(KBUILD_HOSTCFLAGS)" RM ?= rm +HOSTCC ?= gcc +HOSTLD ?= ld +HOSTAR ?= ar CROSS_COMPILE = OUTPUT ?= $(srctree)/tools/bpf/resolve_btfids/ @@ -64,7 +67,7 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[c LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null) LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) -CFLAGS += -g \ +HOSTCFLAGS += -g \ -I$(srctree)/tools/include \ -I$(srctree)/tools/include/uapi \ -I$(LIBBPF_INCLUDE) \ @@ -73,11 +76,11 @@ CFLAGS += -g \ LIBS = $(LIBELF_LIBS) -lz -export srctree OUTPUT CFLAGS Q +export srctree OUTPUT HOSTCFLAGS Q HOSTCC HOSTLD HOSTAR include $(srctree)/tools/build/Makefile.include $(BINARY_IN): fixdep FORCE prepare | $(OUTPUT) - $(Q)$(MAKE) $(build)=resolve_btfids $(HOST_OVERRIDES) + $(Q)$(MAKE) $(build)=resolve_btfids $(BINARY): $(BPFOBJ) $(SUBCMDOBJ) $(BINARY_IN) $(call msg,LINK,$@) Patches currently in stable-queue which might be from jolsa@xxxxxxxxxx are queue-6.1/tools-resolve_btfids-fix-setting-hostcflags.patch queue-6.1/tools-lib-subcmd-make-install_headers-clearer.patch queue-6.1/tools-resolve_btfids-compile-resolve_btfids-as-host-program.patch queue-6.1/tools-resolve_btfids-use-pkg-config-to-locate-libelf.patch queue-6.1/tools-lib-subcmd-add-install-target.patch queue-6.1/tools-resolve_btfids-install-subcmd-headers.patch queue-6.1/tools-resolve_btfids-tidy-host_overrides.patch queue-6.1/tools-resolve_btfids-pass-hostcflags-as-extra_cflags-to-prepare-targets.patch queue-6.1/tools-lib-subcmd-add-dependency-test-to-install_headers.patch queue-6.1/tools-resolve_btfids-alter-how-hostcc-is-forced.patch