linux/tools/bpf/bpftool
Viktor Malik 0513eeee86 bpftool: Prevent setting duplicate _GNU_SOURCE in Makefile
When building selftests with CFLAGS set via env variable, the value of
CFLAGS is propagated into bpftool Makefile (called from selftests
Makefile). This makes the compilation fail as _GNU_SOURCE is defined two
times - once from selftests Makefile (by including lib.mk) and once from
bpftool Makefile (by calling `llvm-config --cflags`):

    $ CFLAGS="" make -C tools/testing/selftests/bpf
    [...]
    CC      /bpf-next/tools/testing/selftests/bpf/tools/build/bpftool/btf.o
    <command-line>: error: "_GNU_SOURCE" redefined [-Werror]
    <command-line>: note: this is the location of the previous definition
    cc1: all warnings being treated as errors
    [...]

Filter out -D_GNU_SOURCE from the result of `llvm-config --cflags` in
bpftool Makefile to prevent this error.

Signed-off-by: Viktor Malik <vmalik@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Quentin Monnet <qmo@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: https://lore.kernel.org/bpf/acec3108b62d4df1436cda777e58e93e033ac7a7.1730449390.git.vmalik@redhat.com
2024-11-01 12:37:01 -07:00
..
bash-completion bpftool: Add bash-completion for tcx subcommand 2024-07-29 12:54:04 -07:00
Documentation bpftool: Fix typos 2024-09-09 15:57:52 -07:00
skeleton bpftool: Fix typo in MAX_NUM_METRICS macro name 2024-06-03 16:58:27 +02:00
.gitignore bpftool: Fix SPDX tag for Makefiles and .gitignore 2021-11-10 09:00:52 -08:00
btf_dumper.c bpftool: Fix printing of pointer value 2023-10-19 16:29:36 +02:00
btf.c bpftool: __bpf_fastcall for kfuncs marked with special decl_tag 2024-10-03 17:47:53 -07:00
cfg.c bpftool: Support printing opcodes and source file references in CFG 2023-04-05 21:27:27 -07:00
cfg.h bpftool: Support printing opcodes and source file references in CFG 2023-04-05 21:27:27 -07:00
cgroup.c bpftool: Query only cgroup-related attach types 2024-06-11 11:39:09 -07:00
common.c bpftool: Un-const bpf_func_info to fix it for llvm 17 and newer 2024-05-21 10:36:28 -07:00
feature.c bpftool: fix some typos in bpftool 2024-09-05 13:07:47 -07:00
gen.c bpftool: improve skeleton backwards compat with old buggy libbpfs 2024-07-09 19:03:05 -07:00
iter.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
jit_disasm.c bpf, bpftool: Fix incorrect disasm pc 2024-11-01 12:31:44 -07:00
json_writer.c tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
json_writer.h tools: bpftool: json: Fix backslash escape typo in jsonw_puts 2023-03-29 09:48:45 -07:00
link.c bpftool: Add link dump support for BPF_LINK_TYPE_SOCKMAP 2024-04-10 19:52:25 -07:00
main.c bpftool: clean-up usage of libbpf_get_error() 2022-11-20 16:17:46 -08:00
main.h bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
Makefile bpftool: Prevent setting duplicate _GNU_SOURCE in Makefile 2024-11-01 12:37:01 -07:00
map_perf_ring.c bpftool: Fix error message of strerror 2022-09-30 15:40:46 -07:00
map.c bpftool: Recognize arena map type 2024-03-11 15:37:24 -07:00
net.c bpftool: Fix undefined behavior in qsort(NULL, 0, ...) 2024-09-10 11:40:55 -07:00
netlink_dumper.c bpftool: Use consistent include paths for libbpf 2020-01-20 16:37:45 -08:00
netlink_dumper.h bpftool: Extend net dump with tcx progs 2023-07-19 10:07:28 -07:00
perf.c bpftool: fix perf help message 2023-08-11 20:54:29 -07:00
pids.c bpftool: Enable libbpf logs when loading pid_iter in debug mode 2024-03-19 23:12:22 -07:00
prog.c bpftool: Fix typo in usage help 2024-07-17 22:45:58 +02:00
struct_ops.c bpftool: Mount bpffs on provided dir instead of parent dir 2024-04-04 15:37:12 -07:00
tracelog.c bpftool, musl compat: Replace sys/fcntl.h by fcntl.h 2022-04-25 23:24:28 +02:00
xlated_dumper.c tools/bpf: Fix the wrong format specifier 2024-07-30 13:41:20 -07:00
xlated_dumper.h bpftool: Dump the kernel symbol's module name 2023-07-11 20:07:50 -07:00