Merge changes I7ba9cef9,Ia191be0b,I16ba3dc8
* changes:
Expose unwinder APIs in NDK stubs for R and up.
Use abi::__cxa_demangle declared in cxxabi.h
__cxa_atexit_test: declare __cxa_atexit and __cxa_finalize
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/SECCOMP_ALLOWLIST_COMMON.TXT b/libc/SECCOMP_ALLOWLIST_COMMON.TXT
index efbf28b..d366bad 100644
--- a/libc/SECCOMP_ALLOWLIST_COMMON.TXT
+++ b/libc/SECCOMP_ALLOWLIST_COMMON.TXT
@@ -30,12 +30,6 @@
# Needed for a CTS test of seccomp (b/34763393).
int seccomp(unsigned, unsigned, void*) all
-# TODO: remove these now we've updated the toolchain (http://b/229989971).
-int open(const char*, int, ...) arm,x86,x86_64
-int stat64(const char*, stat64*) arm,x86
-ssize_t readlink(const char*, char*, size_t) arm,x86,x86_64
-int stat(const char*, stat*) arm,x86,x86_64
-
#
# (Potentially) useful new syscalls which we don't yet use in bionic.
#
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/libm/Android.bp b/libm/Android.bp
index df81e1c..2748871 100644
--- a/libm/Android.bp
+++ b/libm/Android.bp
@@ -346,10 +346,33 @@
],
exclude_srcs: [
+ // TODO: do the rest when our clang has https://reviews.llvm.org/D136508.
+ // TODO: "upstream-freebsd/lib/msun/src/s_ceil.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_ceilf.c",
+ "upstream-freebsd/lib/msun/src/s_copysign.c",
+ "upstream-freebsd/lib/msun/src/s_copysignf.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_floor.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_floorf.c",
+ "upstream-freebsd/lib/msun/src/s_fma.c",
+ "upstream-freebsd/lib/msun/src/s_fmaf.c",
+ "upstream-freebsd/lib/msun/src/s_fmax.c",
+ "upstream-freebsd/lib/msun/src/s_fmaxf.c",
+ "upstream-freebsd/lib/msun/src/s_fmin.c",
+ "upstream-freebsd/lib/msun/src/s_fminf.c",
"upstream-freebsd/lib/msun/src/s_llrint.c",
"upstream-freebsd/lib/msun/src/s_llrintf.c",
+ "upstream-freebsd/lib/msun/src/s_llround.c",
+ "upstream-freebsd/lib/msun/src/s_llroundf.c",
"upstream-freebsd/lib/msun/src/s_lrint.c",
"upstream-freebsd/lib/msun/src/s_lrintf.c",
+ "upstream-freebsd/lib/msun/src/s_lround.c",
+ "upstream-freebsd/lib/msun/src/s_lroundf.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_rint.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_rintf.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_round.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_roundf.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_trunc.c",
+ // TODO: "upstream-freebsd/lib/msun/src/s_truncf.c",
],
version_script: ":libm.riscv64.map",
},
diff --git a/libm/builtins.cpp b/libm/builtins.cpp
index cf00f52..58cd81d 100644
--- a/libm/builtins.cpp
+++ b/libm/builtins.cpp
@@ -25,13 +25,19 @@
#if defined(__aarch64__)
float ceilf(float x) { return __builtin_ceilf(x); }
double ceil(double x) { return __builtin_ceil(x); }
+#endif
+#if defined(__aarch64__) || defined(__riscv)
double copysign(double x, double y) { return __builtin_copysign(x, y); }
float copysignf(float x, float y) { return __builtin_copysignf(x, y); }
+#endif
+#if defined(__aarch64__)
float floorf(float x) { return __builtin_floorf(x); }
double floor(double x) { return __builtin_floor(x); }
+#endif
+#if defined(__aarch64__) || defined(__riscv)
float fmaf(float x, float y, float z) { return __builtin_fmaf(x, y, z); }
double fma(double x, double y, double z) { return __builtin_fma(x, y, z); }
@@ -45,7 +51,9 @@
long lroundf(float x) { return __builtin_lroundf(x); }
long long llround(double x) { return __builtin_llround(x); }
long long llroundf(float x) { return __builtin_llroundf(x); }
+#endif
+#if defined(__aarch64__)
float rintf(float x) { return __builtin_rintf(x); }
double rint(double x) { return __builtin_rint(x); }
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 {