mirror of
https://github.com/xdp-project/bpf-examples.git
synced 2024-05-06 15:54:53 +00:00
It is fairly natural to include <errno.h> in BPF programs as some helpers and hooks use these errno defines (like lsm-nobpf/). Again we discover that when compiling with clang option[1] "-target bpf" the OS distros header files gets confused as __x86_64__ isn't define by clang which in this case (on Fedora) cause include <gnu/stubs-32.h>. The error looks like this: $ make CLANG lsm-nobpf-kern.o In file included from lsm-nobpf-kern.c:6: In file included from /usr/include/errno.h:25: In file included from /usr/include/features.h:474: /usr/include/gnu/stubs.h:7:11: fatal error: 'gnu/stubs-32.h' file not found # include <gnu/stubs-32.h> ^~~~~~~~~~~~~~~~ This patch adds a compile test to configure script to help people realize why compiling is failing on their systems. [1] https://www.kernel.org/doc/html/latest/bpf/bpf_devel_QA.html#q-clang-flag-for-target-bpf Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
6.1 KiB
Executable File
6.1 KiB
Executable File