aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-25 12:30:54 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-03-25 12:30:54 +0000
commit0703e4ffb1bafaefa4057bc7e834ec344fbb23c0 (patch)
tree23b999ac5c78b7fc8bc2caaaf97f566e90e7560a
parent3b80a6affc8ab38b39fa6b3312b04139776f7a6f (diff)
parent505fc6000e199644bf7d3f2df4887b1b8272134f (diff)
downloadllvm-android13-mainline-go-media-release.tar.gz
Snap for 8358640 from 505fc6000e199644bf7d3f2df4887b1b8272134f to mainline-go-media-releaseaml_go_med_330913000android13-mainline-go-media-release
Change-Id: I9496e74861e0f2d5e583b0327087784220d4403a
-rw-r--r--host/include/llvm/Config/config.h4
-rw-r--r--include/llvm/Analysis/TargetLibraryInfo.h15
-rw-r--r--lib/Support/DynamicLibrary.cpp2
-rw-r--r--soong/llvm.go4
4 files changed, 22 insertions, 3 deletions
diff --git a/host/include/llvm/Config/config.h b/host/include/llvm/Config/config.h
index eb6c81d1ec1d..ce0c15d9184f 100644
--- a/host/include/llvm/Config/config.h
+++ b/host/include/llvm/Config/config.h
@@ -115,7 +115,7 @@
#define HAVE_ERROR_T 1
/* Define to 1 if you have the <execinfo.h> header file. */
-#ifndef __BIONIC__
+#if !defined(__BIONIC__) && !defined(ANDROID_HOST_MUSL)
#define HAVE_EXECINFO_H 1
#endif
@@ -247,7 +247,7 @@
/* #undef HAVE_MACH_O_DYLD_H */
/* Define if mallinfo() is available on this platform. */
-#if !defined(__APPLE__)
+#if !defined(__APPLE__) && !defined(ANDROID_HOST_MUSL)
#define HAVE_MALLINFO 1
#else
/* #undef HAVE_MALLINFO */
diff --git a/include/llvm/Analysis/TargetLibraryInfo.h b/include/llvm/Analysis/TargetLibraryInfo.h
index 02203126f05e..48cbd9b640eb 100644
--- a/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/include/llvm/Analysis/TargetLibraryInfo.h
@@ -27,6 +27,21 @@
#undef ftello
#endif
#endif // _WIN32
+
+#ifdef ANDROID_HOST_MUSL
+# ifdef fopen64
+# undef fopen64
+# endif
+# ifdef fseeko64
+# undef fseeko64
+# endif
+# ifdef ftello64
+# undef ftello64
+# endif
+# ifdef tmpfile64
+# undef tmpfile64
+# endif
+#endif
// END ANDROID-SPECIFIC
namespace llvm {
diff --git a/lib/Support/DynamicLibrary.cpp b/lib/Support/DynamicLibrary.cpp
index 9a7aeb50a216..3fdea209151b 100644
--- a/lib/Support/DynamicLibrary.cpp
+++ b/lib/Support/DynamicLibrary.cpp
@@ -143,7 +143,7 @@ void* DynamicLibrary::SearchForAddressOfSymbol(const char *symbolName) {
// On linux we have a weird situation. The stderr/out/in symbols are both
// macros and global variables because of standards requirements. So, we
// boldly use the EXPLICIT_SYMBOL macro without checking for a #define first.
-#if defined(__linux__) and !defined(__ANDROID__)
+#if defined(__linux__) and !defined(__ANDROID__) && !defined(ANDROID_HOST_MUSL)
{
EXPLICIT_SYMBOL(stderr);
EXPLICIT_SYMBOL(stdout);
diff --git a/soong/llvm.go b/soong/llvm.go
index edbc9cb95d5c..6a38fb56aec8 100644
--- a/soong/llvm.go
+++ b/soong/llvm.go
@@ -89,6 +89,9 @@ func forceBuildLlvmComponents(ctx android.LoadHookContext) {
if !forceBuild {
type props struct {
Target struct {
+ Darwin_arm64 struct {
+ Enabled *bool
+ }
Host struct {
Enabled *bool
}
@@ -98,6 +101,7 @@ func forceBuildLlvmComponents(ctx android.LoadHookContext) {
}
}
p := &props{}
+ p.Target.Darwin_arm64.Enabled = proptools.BoolPtr(true)
p.Target.Host.Enabled = proptools.BoolPtr(false)
p.Target.Linux_bionic_arm64.Enabled = proptools.BoolPtr(true)
ctx.AppendProperties(p)