bpftool: Define _GNU_SOURCE only once
authorQuentin Monnet <quentin@isovalent.com>
Tue, 25 Oct 2022 15:03:22 +0000 (16:03 +0100)
committerAlexei Starovoitov <ast@kernel.org>
Tue, 25 Oct 2022 17:11:56 +0000 (10:11 -0700)
commitb3d84af7cdfc079ef86d94f7cf125821559925fa
treeccf59a53c1caa6f861363f00caa9c06eb88a1f2f
parent8f4bc15b9ad73434643aadb19506e1547bedf7eb
bpftool: Define _GNU_SOURCE only once

_GNU_SOURCE is defined in several source files for bpftool, but only one
of them takes the precaution of checking whether the value is already
defined. Add #ifndef for other occurrences too.

This is in preparation for the support of disassembling JIT-ed programs
with LLVM, with $(llvm-config --cflags) passing -D_GNU_SOURCE as a
compilation argument.

Signed-off-by: Quentin Monnet <quentin@isovalent.com>
Tested-by: Niklas Söderlund <niklas.soderlund@corigine.com>
Acked-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20221025150329.97371-2-quentin@isovalent.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
tools/bpf/bpftool/common.c
tools/bpf/bpftool/iter.c
tools/bpf/bpftool/jit_disasm.c
tools/bpf/bpftool/net.c
tools/bpf/bpftool/perf.c
tools/bpf/bpftool/prog.c
tools/bpf/bpftool/xlated_dumper.c