Work around LLVM ORCv2 issue affecting Cuttlefish

Android Cuttlefish x86 instances crashed with an execution privilege
access violation error, due to an R_386_PC32 relocation which is used
when calling a C function from Reactor code, who's address is not
associated with any symbol (since it's an absolute constant), but it
still invokes the symbol resolver for "".

Returning any address for this nameless symbol prevents the issue.

This is not a proper fix for the root cause, which is presumed to be a
bug in LLVM's handling of ELF::R_386_PC32 relocations not associated
with any symbol, but it enables us to make the switch from the
deprecated LLVM ORCv1 JIT API to ORCv2.

Bug: b/172974501
Change-Id: I2d1978fccd2365bd8837f6d2054f43792f61cf73
Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/50368
Kokoro-Result: kokoro <noreply+kokoro@google.com>
Tested-by: Nicolas Capens <nicolascapens@google.com>
Tested-by: Jason Macnak <natsu@google.com>
Reviewed-by: Jason Macnak <natsu@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
diff --git a/src/Reactor/LLVMJIT.cpp b/src/Reactor/LLVMJIT.cpp
index 7293af3..a1cc35c 100644
--- a/src/Reactor/LLVMJIT.cpp
+++ b/src/Reactor/LLVMJIT.cpp
@@ -497,6 +497,13 @@
 			functions.try_emplace("sync_fetch_and_min_4", reinterpret_cast<void *>(sync_fetch_and_min_4));
 			functions.try_emplace("sync_fetch_and_umax_4", reinterpret_cast<void *>(sync_fetch_and_umax_4));
 			functions.try_emplace("sync_fetch_and_umin_4", reinterpret_cast<void *>(sync_fetch_and_umin_4));
+
+#	if defined(__i386__)
+			// TODO(b/172974501): Workaround for an x86-32 issue where an R_386_PC32 relocation is used
+			// When calling a C function from Reactor code, who's address is not associated with any symbol
+			// (since it's an absolute constant), but it still invokes the symbol resolver for "".
+			functions.try_emplace("", nullptr);
+#	endif
 #endif
 #if __has_feature(memory_sanitizer)
 			functions.try_emplace("msan_unpoison", reinterpret_cast<void *>(__msan_unpoison));  // TODO(b/155148722): Remove when we no longer unpoison all writes.