From ef71bece856d11315f0336b5fe99c8681887e33c Mon Sep 17 00:00:00 2001 From: Viktor Malik Date: Wed, 5 Mar 2025 14:16:50 +0100 Subject: [PATCH] Fix LLVM feature detection bpftool disassembler optionally uses LLVM to improve its capabilities. Unfortunately, even if llvm-devel is installed, the feature detection of LLVM doesn't work: Auto-detecting system features: ... clang-bpf-co-re: [ on ] ... llvm: [ OFF ] ... libcap: [ on ] ... libbfd: [ on ] The reason is that the feature detection tries to compile a simple C++ program and link it against libLLVM which fails as LDFLAGS contains -pie while CXXFLAGS does not contain -fpie. Fix this by setting EXTRA_CXXFLAGS from the bpftool build. Signed-off-by: Viktor Malik --- bpftool.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bpftool.spec b/bpftool.spec index 372e0cd..b9c34db 100644 --- a/bpftool.spec +++ b/bpftool.spec @@ -44,7 +44,7 @@ manipulation of eBPF programs and maps. # We need to use vmlinux.h from kernel-devel rather than the one from the running system %define kernel_version %(rpm -q --qf "%%{VERSION}-%%{RELEASE}.%%{ARCH}" kernel-devel) pushd tools/bpf/bpftool -%make_build EXTRA_CFLAGS="%{build_cflags}" EXTRA_LDFLAGS="%{build_ldflags}" VMLINUX_H="/usr/src/kernels/%{kernel_version}/vmlinux.h" +%make_build EXTRA_CFLAGS="%{build_cflags}" EXTRA_CXXFLAGS="%{build_cflags}" EXTRA_LDFLAGS="%{build_ldflags}" VMLINUX_H="/usr/src/kernels/%{kernel_version}/vmlinux.h" %install pushd tools/bpf/bpftool