diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-10-20 14:12:37 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2020-11-04 09:42:40 -0300 |
commit | c18cf78d7969db89934587fa476220eefe7bd4bd (patch) | |
tree | 7758e69afc47c8d4371e49b6007e9d57f3470877 /tools/perf/util/bpf-loader.h | |
parent | cc3b964d5eb49d0c9da08760f8760bb6945f1df5 (diff) |
perf bpf: Enclose libbpf.h include within HAVE_LIBBPF_SUPPORT
As it uses the 'deprecated' attribute in a way that breaks the build
with old gcc compilers, so to continue being able to build in such
systems where NO_LIBBPF=1 is being used, enclose it under
HAVE_LIBBPF_SUPPORT.
1 centos:6 : FAIL gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
2 oraclelinux:6 : FAIL gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23.0.1)
CC /tmp/build/perf/builtin-record.o
In file included from util/bpf-loader.h:11,
from builtin-record.c:39:
/git/linux/tools/lib/bpf/libbpf.h:203: error: wrong number of arguments specified for 'deprecated' attribute
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/bpf-loader.h')
-rw-r--r-- | tools/perf/util/bpf-loader.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/bpf-loader.h b/tools/perf/util/bpf-loader.h index 25251d63164c..5d1c725cea29 100644 --- a/tools/perf/util/bpf-loader.h +++ b/tools/perf/util/bpf-loader.h @@ -8,6 +8,8 @@ #include <linux/compiler.h> #include <linux/err.h> + +#ifdef HAVE_LIBBPF_SUPPORT #include <bpf/libbpf.h> enum bpf_loader_errno { @@ -38,6 +40,7 @@ enum bpf_loader_errno { BPF_LOADER_ERRNO__OBJCONF_MAP_IDX2BIG, /* Index too large */ __BPF_LOADER_ERRNO__END, }; +#endif // HAVE_LIBBPF_SUPPORT struct evsel; struct evlist; |