Merge "Use more compiler builtins for libm."
diff --git a/libc/Android.bp b/libc/Android.bp
index 82fc0bc..cd53906 100644
--- a/libc/Android.bp
+++ b/libc/Android.bp
@@ -782,7 +782,6 @@
arch: {
arm: {
cflags: [
- "-DHAVE_ASSEMBLER___MEMCPY_CHK",
"-DRENAME___STRCAT_CHK",
"-DRENAME___STRCPY_CHK",
],
@@ -809,7 +808,6 @@
],
},
arm64: {
- cflags: ["-DHAVE_ASSEMBLER___MEMCPY_CHK"],
srcs: [
"arch-arm64/string/__memcpy_chk.S",
"arch-arm64/string/__memset_chk.S",
diff --git a/libc/bionic/fortify.cpp b/libc/bionic/fortify.cpp
index 4317a56..73cf973 100644
--- a/libc/bionic/fortify.cpp
+++ b/libc/bionic/fortify.cpp
@@ -489,8 +489,9 @@
return strcpy(dst, src);
}
-#if !defined(HAVE_ASSEMBLER___MEMCPY_CHK)
+#if !defined(__arm__) && !defined(__aarch64__)
// Runtime implementation of __memcpy_chk (used directly by compiler, not in headers).
+// arm32 and arm64 have assembler implementations, and don't need this C fallback.
extern "C" void* __memcpy_chk(void* dst, const void* src, size_t count, size_t dst_len) {
__check_count("memcpy", "count", count);
__check_buffer_access("memcpy", "write into", count, dst_len);
diff --git a/libc/include/sys/resource.h b/libc/include/sys/resource.h
index 9181125..ccb267d 100644
--- a/libc/include/sys/resource.h
+++ b/libc/include/sys/resource.h
@@ -41,6 +41,7 @@
#define RLIM_SAVED_MAX RLIM_INFINITY
typedef unsigned long rlim_t;
+typedef unsigned long long rlim64_t;
int getrlimit(int __resource, struct rlimit* __limit);
int setrlimit(int __resource, const struct rlimit* __limit);
diff --git a/tests/sys_resource_test.cpp b/tests/sys_resource_test.cpp
index 0247fcb..492fabd 100644
--- a/tests/sys_resource_test.cpp
+++ b/tests/sys_resource_test.cpp
@@ -26,6 +26,7 @@
ASSERT_NE(sizeof(rlimit), sizeof(rlimit64));
ASSERT_EQ(4U, sizeof(rlim_t));
#endif
+ ASSERT_EQ(8U, sizeof(rlim64_t));
}
class SysResourceTest : public ::testing::Test {