From: Viktor Malik on gitlab.com https://gitlab.com/cki-project/kernel-ark/-/merge_requests/2749#note_1636610...
I believe that we decided to replace the `EXTRA_` flags by a custom bpftool, otherwise there were errors:
```suggestion:-0+0 %{make} %{?_smp_mflags} TPROGS_USER_CFLAGS="%{?build_hostcflags}" TPROGS_USER_LDFLAGS="%{?build_hostldflags}" BPFTOOL="$(pwd)/tools/bpf/bpftool/bpftool" ARCH=$Arch V=1 M=samples/bpf/ VMLINUX_H="${RPM_VMLINUX_H}" || true ```
With this, samples/bpf should compile with PIE.
FWIW, it should suffice to move the below lines
```plaintext 2774 # Prevent bpf selftests to build bpftool repeatedly: 2775 export BPFTOOL=$(pwd)/tools/bpf/bpftool/bpftool ```
above this command, but when I tried that, the bpftool in samples still attempted to build and errors occurred.