aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-04-23 01:19:49 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-23 01:19:49 +0000
commitf847fd7131b17b32364e9e4d7c26fafa03eb2dfd (patch)
treee89666e108f62e9e4c9553d06e108ac370fe461d
parentf992adb5bf7264afa2a752a4a54e5c976a850a8d (diff)
parent89267bdfba4e28a6ddc2b4e9c5cab6c4a96f181c (diff)
downloadbpftool-android14-d2-s3-release.tar.gz
Original change: https://android-review.googlesource.com/c/platform/external/bpftool/+/2072344 Change-Id: I63fb95d6e4efebc86b65b26837743e6a346e5440 Ignore-AOSP-First: this is an automerge Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--Android.bp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Android.bp b/Android.bp
index 4a09836..b83d6ba 100644
--- a/Android.bp
+++ b/Android.bp
@@ -31,6 +31,19 @@ cc_binary_host {
"include/uapi",
"src/kernel/bpf"
],
+ target: {
+ musl: {
+ // There is an unfortunate interaction between the bionic uapi headers
+ // used by musl and the kernel headers distributed with bpftool. The
+ // bionic uapi headers include <linux/compiler_types.h>, which they
+ // expect to be resolved to their own copy of compiler_types.h that
+ // includes compiler.h. It instead resolves to the bpftool copy,
+ // which includes compiler-gcc.h directly, triggering an error if
+ // the _LINUX_COMPILER_H_ header guard is not already defined. Hack
+ // around it by always including linux/compiler.h from the command line.
+ cflags: ["-include linux/compiler.h"],
+ },
+ },
static_libs: [
"libbpf",
"libcap",