Commit 9283b255 by Chris Forbes

Wire up some required external functions for arm32

Bug: b/135298866 Change-Id: Ic8d2375ae7e7ee8c521f8c4c1ca6ec44db9fb8be Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/32988Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com> Reviewed-by: 's avatarBen Clayton <bclayton@google.com>
parent ea38f958
...@@ -534,7 +534,17 @@ namespace rr ...@@ -534,7 +534,17 @@ namespace rr
} }
} }
}; };
struct F { static void nop() {} }; struct F
{
static void nop() {}
static void neverCalled() { UNREACHABLE("Should never be called"); }
#ifdef __ANDROID__
// forwarders since we can't take address of builtins
static void sync_synchronize() { __sync_synchronize(); }
static uint32_t sync_fetch_and_add_4(uint32_t *ptr, uint32_t val) { return __sync_fetch_and_add_4(ptr, val); }
#endif
};
func_.emplace("nop", reinterpret_cast<void*>(F::nop)); func_.emplace("nop", reinterpret_cast<void*>(F::nop));
func_.emplace("floorf", reinterpret_cast<void*>(floorf)); func_.emplace("floorf", reinterpret_cast<void*>(floorf));
...@@ -572,6 +582,12 @@ namespace rr ...@@ -572,6 +582,12 @@ namespace rr
#elif defined(__linux__) #elif defined(__linux__)
func_.emplace("sincosf", reinterpret_cast<void*>(sincosf)); func_.emplace("sincosf", reinterpret_cast<void*>(sincosf));
#endif // __APPLE__ #endif // __APPLE__
#ifdef __ANDROID__
func_.emplace("aeabi_unwind_cpp_pr0", reinterpret_cast<void*>(F::neverCalled));
func_.emplace("sync_synchronize", reinterpret_cast<void*>(F::sync_synchronize));
func_.emplace("sync_fetch_and_add_4", reinterpret_cast<void*>(F::sync_fetch_and_add_4));
#endif
} }
void *findSymbol(const std::string &name) const void *findSymbol(const std::string &name) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment