Fix art compiling against musl
Fix various issues when compling art against musl:
Check for ANDROID_HOST_MUSL when defining strlcpy and sig*64.
Remove error.h, its not used and doesn't exist in musl.
Include time.h that was being included transitively in glibc but
not in musl.
Add the musl libc library name to the list.
pthread_sigqueue takes a sigval, not a sigval_t.
Bug: 190084016
Test: m USE_HOST_MUSL=true
Change-Id: I2548ef0013234c42efded411c733450c19434855
diff --git a/sigchainlib/sigchain_test.cc b/sigchainlib/sigchain_test.cc
index 249fff1..d879f5a 100644
--- a/sigchainlib/sigchain_test.cc
+++ b/sigchainlib/sigchain_test.cc
@@ -73,13 +73,13 @@
protected:
void RaiseHandled() {
- sigval_t value;
+ sigval value;
value.sival_ptr = &value;
pthread_sigqueue(pthread_self(), SIGSEGV, value);
}
void RaiseUnhandled() {
- sigval_t value;
+ sigval value;
value.sival_ptr = nullptr;
pthread_sigqueue(pthread_self(), SIGSEGV, value);
}
@@ -208,6 +208,8 @@
constexpr char kLibcSoName[] = "libc.so";
#elif defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ == 6
constexpr char kLibcSoName[] = "libc.so.6";
+#elif defined(ANDROID_HOST_MUSL)
+ constexpr char kLibcSoName[] = "libc_musl.so";
#else
#error Unknown libc
#endif