summaryrefslogtreecommitdiff
path: root/libc/test/IntegrationTest/test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/test/IntegrationTest/test.cpp')
-rw-r--r--libc/test/IntegrationTest/test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libc/test/IntegrationTest/test.cpp b/libc/test/IntegrationTest/test.cpp
index 3bdbe89a3fb6..2751f3180a8e 100644
--- a/libc/test/IntegrationTest/test.cpp
+++ b/libc/test/IntegrationTest/test.cpp
@@ -6,9 +6,14 @@
//
//===----------------------------------------------------------------------===//
+#include "src/__support/common.h"
#include <stddef.h>
#include <stdint.h>
+#ifdef LIBC_TARGET_ARCH_IS_AARCH64
+#include "src/sys/auxv/getauxval.h"
+#endif
+
// Integration tests rely on the following memory functions. This is because the
// compiler code generation can emit calls to them. We want to map the external
// entrypoint to the internal implementation of the function used for testing.
@@ -79,4 +84,12 @@ void *realloc(void *ptr, size_t s) {
// Integration tests are linked with -nostdlib. BFD linker expects
// __dso_handle when -nostdlib is used.
void *__dso_handle = nullptr;
+
+#ifdef LIBC_TARGET_ARCH_IS_AARCH64
+// Due to historical reasons, libgcc on aarch64 may expect __getauxval to be
+// defined. See also https://gcc.gnu.org/pipermail/gcc-cvs/2020-June/300635.html
+unsigned long __getauxval(unsigned long id) {
+ return LIBC_NAMESPACE::getauxval(id);
+}
+#endif
} // extern "C"