Provide x86_64 mem* functions in librust_baremetal.
On arm/arm64, these functions (memset, memcpy, etc.) are provided by
libarm-optimized-routines-mem, which is included in librust_baremetal.
However, that library does not provide x86_64 implementations, so we
include the same assembly versions of these functions used elsewhere in
Bionic to satisfy downstream librust_baremetal users.
The librust_baremetal library is now also explicitly disabled for 32-bit
x86 and arm; the Virtualization module where librust_baremetal is used
only works on 64-bit platforms for now.
Bug: 389669171
Test: link x86_64 pvmfw
Change-Id: I63d88b1d05f84f511ecfca4262c30858fda08eb9
diff --git a/libc/Android.bp b/libc/Android.bp
index ee50dad..76f0dfb 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -2079,6 +2079,7 @@
// This library contains the following unresolved symbols:
// __errno
+// __x86_shared_cache_size_half (x86_64 only)
// abort
// async_safe_fatal_va_list
cc_library_static {
@@ -2098,11 +2099,33 @@
"bionic/strtol.cpp",
],
arch: {
+ arm: {
+ enabled: false,
+ },
arm64: {
srcs: [
"arch-arm64/string/__memcpy_chk.S",
],
},
+ x86: {
+ enabled: false,
+ },
+ x86_64: {
+ srcs: [
+ "arch-x86_64/string/sse2-memmove-slm.S",
+ "arch-x86_64/string/sse2-memset-slm.S",
+ "arch-x86_64/string/sse2-stpcpy-slm.S",
+ "arch-x86_64/string/sse2-stpncpy-slm.S",
+ "arch-x86_64/string/sse2-strcat-slm.S",
+ "arch-x86_64/string/sse2-strcpy-slm.S",
+ "arch-x86_64/string/sse2-strlen-slm.S",
+ "arch-x86_64/string/sse2-strncat-slm.S",
+ "arch-x86_64/string/sse2-strncpy-slm.S",
+ "arch-x86_64/string/sse4-memcmp-slm.S",
+ "arch-x86_64/string/ssse3-strcmp-slm.S",
+ "arch-x86_64/string/ssse3-strncmp-slm.S",
+ ],
+ },
},
whole_static_libs: [
"//external/llvm-libc:llvmlibc",