From 5c26f9a783581058c5de93627ae64139c4b32ceb Mon Sep 17 00:00:00 2001 From: Ivan Khoronzhuk Date: Fri, 11 Oct 2019 03:28:04 +0300 Subject: libbpf: Don't use cxx to test_libpf target No need to use C++ for test_libbpf target when libbpf is on C and it can be tested with C, after this change the CXXFLAGS in makefiles can be avoided, at least in bpf samples, when sysroot is used, passing same C/LDFLAGS as for lib. Add "return 0" in test_libbpf to avoid warn, but also remove spaces at start of the lines to keep same style and avoid warns while apply. Signed-off-by: Ivan Khoronzhuk Signed-off-by: Alexei Starovoitov Acked-by: Andrii Nakryiko Link: https://lore.kernel.org/bpf/20191011002808.28206-12-ivan.khoronzhuk@linaro.org --- tools/lib/bpf/test_libbpf.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 tools/lib/bpf/test_libbpf.c (limited to 'tools/lib/bpf/test_libbpf.c') diff --git a/tools/lib/bpf/test_libbpf.c b/tools/lib/bpf/test_libbpf.c new file mode 100644 index 000000000000..f0eb2727b766 --- /dev/null +++ b/tools/lib/bpf/test_libbpf.c @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) */ +#include "libbpf.h" +#include "bpf.h" +#include "btf.h" + +/* do nothing, just make sure we can link successfully */ + +int main(int argc, char *argv[]) +{ + /* libbpf.h */ + libbpf_set_print(NULL); + + /* bpf.h */ + bpf_prog_get_fd_by_id(0); + + /* btf.h */ + btf__new(NULL, 0); + + return 0; +} -- cgit v1.2.3-59-g8ed1b