aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2021-09-14 11:04:58 -0700
committerColin Cross <ccross@android.com>2021-09-14 11:04:58 -0700
commit0126343c9e73f3d1c1cd4a3f2a24c19b8bbe61b4 (patch)
tree9c889c7e32c0d3bb1a44b26bf0394c46926e23cb
parentc9f9833121b0a9af436a58a7c9690d029d446d53 (diff)
downloadkmod-0126343c9e73f3d1c1cd4a3f2a24c19b8bbe61b4.tar.gz
Fix external/kmod compiling against musl
Include sys/cdefs.h before using __BEGIN_DECLS Move -DHAVE_DECL_STRNDUPA to glibc, musl doesn't provide it. Test: 190084016 Bug: m USE_HOST_MUSL=true Change-Id: Ie25ad3d8166f8d5f54fe94f154f3acc9957124f7
-rw-r--r--Android.bp2
-rw-r--r--port-gnu/elf.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 466f34c..4854a76 100644
--- a/Android.bp
+++ b/Android.bp
@@ -57,7 +57,7 @@ cc_defaults {
"-UNDEBUG",
],
target: {
- linux_glibc: {
+ glibc: {
cflags: ["-DHAVE_DECL_STRNDUPA"]
}
}
diff --git a/port-gnu/elf.h b/port-gnu/elf.h
index 30c42d8..6aae290 100644
--- a/port-gnu/elf.h
+++ b/port-gnu/elf.h
@@ -19,6 +19,7 @@
#ifndef _ELF_H
#define _ELF_H 1
+#include <sys/cdefs.h>
__BEGIN_DECLS