]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Fix libbpf build on compilers missing __builtin_mul_overflow
authorAndrii Nakryiko <andriin@fb.com>
Thu, 20 Aug 2020 06:14:09 +0000 (23:14 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 20 Aug 2020 14:45:09 +0000 (16:45 +0200)
commit39f3d5905e5c6c74d0e774b3140ef54619f21308
tree2003d136a95b6e9884d38d3bc108bac9ec8cafb1
parent6c51b59f2774b92baf64d1affde7404cd435d850
libbpf: Fix libbpf build on compilers missing __builtin_mul_overflow

GCC compilers older than version 5 don't support __builtin_mul_overflow yet.
Given GCC 4.9 is the minimal supported compiler for building kernel and the
fact that libbpf is a dependency of resolve_btfids, which is dependency of
CONFIG_DEBUG_INFO_BTF=y, this needs to be handled. This patch fixes the issue
by falling back to slower detection of integer overflow in such cases.

Fixes: e535fbd01ef4 ("libbpf: Remove any use of reallocarray() in libbpf")
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20200820061411.1755905-2-andriin@fb.com
tools/lib/bpf/libbpf_internal.h