Add missed symbol __aeabi_idivmod for Android.
SwiftShader segfaults when trying to resolve missed symbol. The symbol is requested at least on ARM32 (armv7l)..
Change-Id: I96dd157afc1832ef39daaf46d818c8033820d86b
Bug: b/149229646
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/41049
Reviewed-by: Ben Clayton <bclayton@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
Kokoro-Presubmit: Lingfeng Yang <lfy@google.com>
Tested-by: Ben Clayton <bclayton@google.com>
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index 2a36d98..a879b6a 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -79,6 +79,10 @@
# include <sanitizer/msan_interface.h>
#endif
+#ifdef __ANDROID__
+extern "C" signed __aeabi_idivmod();
+#endif
+
namespace {
// Cache provides a simple, thread-safe key-value store.
@@ -540,6 +544,7 @@
#endif
#ifdef __ANDROID__
+ functions.emplace("aeabi_idivmod", reinterpret_cast<void *>(__aeabi_idivmod));
functions.emplace("aeabi_unwind_cpp_pr0", reinterpret_cast<void *>(F::neverCalled));
functions.emplace("sync_synchronize", reinterpret_cast<void *>(F::sync_synchronize));
functions.emplace("sync_fetch_and_add_4", reinterpret_cast<void *>(F::sync_fetch_and_add_4));