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