diff options
author | Connor O'Brien <connoro@google.com> | 2022-02-01 18:11:31 -0800 |
---|---|---|
committer | Connor O'Brien <connoro@google.com> | 2022-02-14 18:48:26 -0800 |
commit | 616e3afc11c1bb48c21ae1230d9060b5b5e96d56 (patch) | |
tree | 8449fd6b8e19eb66b1cd8982831aa1b063efdd66 | |
parent | 41100a6aa07388031e6285b8975bae3e86db86f5 (diff) | |
download | libbpf-616e3afc11c1bb48c21ae1230d9060b5b5e96d56.tar.gz |
libbpf: support building bpftool
Make changes necessary for bpftool to successfully build against libbpf
- Grant visibility
- Include hashmap.h and nlattr.h in libbpf_headers
- Remove #if 0 block around references to __NR_bpf in
skel_internal.h. This is no longer necessary now that we've added
__NR_bpf to our glibc headers, and the affected functions are needed
for building bpftool.
Test: m bpftool
Test: m libbpf pahole libbpf_bcc
Bug: 203823368
Signed-off-by: Connor O'Brien <connoro@google.com>
Change-Id: If39f0989e162e0a7eac65e339b40ebda25211e2d
-rw-r--r-- | Android.bp | 3 | ||||
-rw-r--r-- | src/skel_internal.h | 4 |
2 files changed, 3 insertions, 4 deletions
@@ -45,10 +45,12 @@ genrule { "bpf/bpf_helpers.h", "bpf/bpf_tracing.h", "bpf/btf.h", + "bpf/hashmap.h", "bpf/libbpf_common.h", "bpf/libbpf.h", "bpf/libbpf_legacy.h", "bpf/libbpf_version.h", + "bpf/nlattr.h", "bpf/skel_internal.h", "bpf/xsk.h", ], @@ -82,6 +84,7 @@ cc_library_static { "libz", ], visibility: [ + "//external/bpftool", "//external/dwarves", "//external/stg", ], diff --git a/src/skel_internal.h b/src/skel_internal.h index 2761970..dcd3336 100644 --- a/src/skel_internal.h +++ b/src/skel_internal.h @@ -57,9 +57,6 @@ struct bpf_load_and_run_opts { const char *errstr; }; -// ANDROID: Since the glibc stub we have does not know about __NR_bpf, this -// fails to compile. For now, just do not provide this functionality. -#if 0 static inline int skel_sys_bpf(enum bpf_cmd cmd, union bpf_attr *attr, unsigned int size) { @@ -199,6 +196,5 @@ out: close(prog_fd); return err; } -#endif #endif |