summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Boulby <daniel.boulby@arm.com>2022-10-21 17:38:24 +0100
committerDaniel Boulby <daniel.boulby@arm.com>2022-10-24 16:49:32 +0100
commit93cec697deb654303379cae8f25a31dc8b90cd31 (patch)
tree8771834181203e27b598e2085ead7738127d306e
parenta194255d75ed9e2ef56bd6e14349a3e7d86af934 (diff)
fix(deps): add missing aeabi_memcpy.S
Add missing aeabi_memcpy.S file from llvm compiler-rt library [1]. This is required for Aarch32 builds with clang. [1] https://github.com/llvm/llvm-project.git Change-Id: I7fd6ab1e81dd45d24afef49a3eb8fcdcbc5c082f Signed-off-by: Daniel Boulby <daniel.boulby@arm.com>
-rw-r--r--lib/compiler-rt/builtins/arm/aeabi_memcpy.S29
-rw-r--r--lib/compiler-rt/compiler-rt.mk1
2 files changed, 30 insertions, 0 deletions
diff --git a/lib/compiler-rt/builtins/arm/aeabi_memcpy.S b/lib/compiler-rt/builtins/arm/aeabi_memcpy.S
new file mode 100644
index 000000000..93e1b05d5
--- /dev/null
+++ b/lib/compiler-rt/builtins/arm/aeabi_memcpy.S
@@ -0,0 +1,29 @@
+//===-- aeabi_memcpy.S - EABI memcpy implementation -----------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "../assembly.h"
+
+// void __aeabi_memcpy(void *dest, void *src, size_t n) { memcpy(dest, src, n); }
+
+ .syntax unified
+ .p2align 2
+DEFINE_COMPILERRT_FUNCTION(__aeabi_memcpy)
+#ifdef USE_THUMB_1
+ push {r7, lr}
+ bl memcpy
+ pop {r7, pc}
+#else
+ b memcpy
+#endif
+END_COMPILERRT_FUNCTION(__aeabi_memcpy)
+
+DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcpy4, __aeabi_memcpy)
+DEFINE_AEABI_FUNCTION_ALIAS(__aeabi_memcpy8, __aeabi_memcpy)
+
+NO_EXEC_STACK_DIRECTIVE
+
diff --git a/lib/compiler-rt/compiler-rt.mk b/lib/compiler-rt/compiler-rt.mk
index 40c669f98..2338908f3 100644
--- a/lib/compiler-rt/compiler-rt.mk
+++ b/lib/compiler-rt/compiler-rt.mk
@@ -34,6 +34,7 @@ COMPILER_RT_SRCS := lib/compiler-rt/builtins/popcountdi2.c \
ifeq (${ARCH},aarch32)
COMPILER_RT_SRCS += lib/compiler-rt/builtins/arm/aeabi_ldivmod.S \
lib/compiler-rt/builtins/arm/aeabi_uldivmod.S \
+ lib/compiler-rt/builtins/arm/aeabi_memcpy.S \
lib/compiler-rt/builtins/ctzdi2.c \
lib/compiler-rt/builtins/divdi3.c \
lib/compiler-rt/builtins/divmoddi4.c \