libbpf: Add GCC support for bpf_tail_call_static
authorJames Hilliard <james.hilliard1@gmail.com>
Mon, 29 Aug 2022 21:05:46 +0000 (15:05 -0600)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 31 Aug 2022 18:54:23 +0000 (20:54 +0200)
commit14e5ce79943a72b9bf0fff8a5867320a9fa3e40d
tree366c1cec405f7e3a454d85de08de45e2042b10b0
parent6f95de6d713130c953af0a40b13c1da519f91c4e
libbpf: Add GCC support for bpf_tail_call_static

The bpf_tail_call_static function is currently not defined unless
using clang >= 8.

To support bpf_tail_call_static on GCC we can check if __clang__ is
not defined to enable bpf_tail_call_static.

We need to use GCC assembly syntax when the compiler does not define
__clang__ as LLVM inline assembly is not fully compatible with GCC.

Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220829210546.755377-1-james.hilliard1@gmail.com
tools/lib/bpf/bpf_helpers.h