This is a note to let you know that I've just added the patch titled tools/resolve_btfids: Use pkg-config to locate libelf 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-use-pkg-config-to-locate-libelf.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 0e43662e61f2569500ab83b8188c065603530785 Mon Sep 17 00:00:00 2001 From: Shen Jiamin <shen_jiamin@xxxxxxxxxxxxxxx> Date: Thu, 15 Dec 2022 12:47:03 +0800 Subject: tools/resolve_btfids: Use pkg-config to locate libelf From: Shen Jiamin <shen_jiamin@xxxxxxxxxxxxxxx> commit 0e43662e61f2569500ab83b8188c065603530785 upstream. When libelf was not installed in the standard location, it cannot be located by the current building config. Use pkg-config to help locate libelf in such cases. Signed-off-by: Shen Jiamin <shen_jiamin@xxxxxxxxxxxxxxx> Signed-off-by: Daniel Borkmann <daniel@xxxxxxxxxxxxx> Acked-by: Jiri Olsa <jolsa@xxxxxxxxxx> Link: https://lore.kernel.org/bpf/20221215044703.400139-1-shen_jiamin@xxxxxxxxxxxxxxx Cc: Nathan Chancellor <nathan@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- tools/bpf/resolve_btfids/Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/tools/bpf/resolve_btfids/Makefile +++ b/tools/bpf/resolve_btfids/Makefile @@ -56,13 +56,17 @@ $(BPFOBJ): $(wildcard $(LIBBPF_SRC)/*.[c DESTDIR=$(LIBBPF_DESTDIR) prefix= EXTRA_CFLAGS="$(CFLAGS)" \ $(abspath $@) install_headers +LIBELF_FLAGS := $(shell $(HOSTPKG_CONFIG) libelf --cflags 2>/dev/null) +LIBELF_LIBS := $(shell $(HOSTPKG_CONFIG) libelf --libs 2>/dev/null || echo -lelf) + CFLAGS += -g \ -I$(srctree)/tools/include \ -I$(srctree)/tools/include/uapi \ -I$(LIBBPF_INCLUDE) \ - -I$(SUBCMD_SRC) + -I$(SUBCMD_SRC) \ + $(LIBELF_FLAGS) -LIBS = -lelf -lz +LIBS = $(LIBELF_LIBS) -lz export srctree OUTPUT CFLAGS Q include $(srctree)/tools/build/Makefile.include Patches currently in stable-queue which might be from shen_jiamin@xxxxxxxxxxxxxxx are queue-6.1/tools-resolve_btfids-use-pkg-config-to-locate-libelf.patch