aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2022-04-22 23:26:12 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-04-22 23:26:12 +0000
commite1bdb0718fe0a1d3de04960aa289af39b16002b8 (patch)
treee89666e108f62e9e4c9553d06e108ac370fe461d
parentd41b5b03ec13a6b008f420b819d3ea9685bcf8cc (diff)
parent61b9d9ccc29e1301a06476f0aa5b2e1ab705f10b (diff)
downloadbpftool-e1bdb0718fe0a1d3de04960aa289af39b16002b8.tar.gz
Hack around linux/compiler-gcc.h issue with musl am: 61b9d9ccc2
Original change: https://android-review.googlesource.com/c/platform/external/bpftool/+/2072344 Change-Id: If0bb18b8630c15d7fb70f01cc410881d94be7094 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",