diff options
author | Andrii Nakryiko <andriin@fb.com> | 2020-08-18 18:36:04 -0700 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2020-08-18 18:38:25 -0700 |
commit | 029258d7b22894fabcecb1626e1b87d18a6823f4 (patch) | |
tree | 15b1b7ecf8e298c62341d0d81578763d69216511 /tools/lib/bpf/Makefile | |
parent | 00b2e95325f8c9dd56a7dae691b01e321838a557 (diff) | |
download | linux-029258d7b22894fabcecb1626e1b87d18a6823f4.tar.gz linux-029258d7b22894fabcecb1626e1b87d18a6823f4.tar.bz2 linux-029258d7b22894fabcecb1626e1b87d18a6823f4.zip |
libbpf: Remove any use of reallocarray() in libbpf
Re-implement glibc's reallocarray() for libbpf internal-only use.
reallocarray(), unfortunately, is not available in all versions of glibc, so
requires extra feature detection and using reallocarray() stub from
<tools/libc_compat.h> and COMPAT_NEED_REALLOCARRAY. All this complicates build
of libbpf unnecessarily and is just a maintenance burden. Instead, it's
trivial to implement libbpf-specific internal version and use it throughout
libbpf.
Which is what this patch does, along with converting some realloc() uses that
should really have been reallocarray() in the first place.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200819013607.3607269-2-andriin@fb.com
Diffstat (limited to 'tools/lib/bpf/Makefile')
-rw-r--r-- | tools/lib/bpf/Makefile | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/tools/lib/bpf/Makefile b/tools/lib/bpf/Makefile index 95c946e94ca5..621ad96d06fd 100644 --- a/tools/lib/bpf/Makefile +++ b/tools/lib/bpf/Makefile @@ -56,7 +56,7 @@ ifndef VERBOSE endif FEATURE_USER = .libbpf -FEATURE_TESTS = libelf libelf-mmap zlib bpf reallocarray +FEATURE_TESTS = libelf libelf-mmap zlib bpf FEATURE_DISPLAY = libelf zlib bpf INCLUDES = -I. -I$(srctree)/tools/include -I$(srctree)/tools/arch/$(ARCH)/include/uapi -I$(srctree)/tools/include/uapi @@ -102,10 +102,6 @@ ifeq ($(feature-libelf-mmap), 1) override CFLAGS += -DHAVE_LIBELF_MMAP_SUPPORT endif -ifeq ($(feature-reallocarray), 0) - override CFLAGS += -DCOMPAT_NEED_REALLOCARRAY -endif - # Append required CFLAGS override CFLAGS += $(EXTRA_WARNINGS) -Wno-switch-enum override CFLAGS += -Werror -Wall |