From e0ebc75df24dbfaabb4e97e7de1ab4d4cd36abf2 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Mon, 16 Sep 2019 14:11:53 +0200 Subject: [PATCH] runtime: implement memcpy A call to memcpy is sometimes created by the compiler, for example when compiling with -opt=s or opt=2. --- src/runtime/runtime_cortexm.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/runtime/runtime_cortexm.go b/src/runtime/runtime_cortexm.go index 55d41d25..2622b67a 100644 --- a/src/runtime/runtime_cortexm.go +++ b/src/runtime/runtime_cortexm.go @@ -132,3 +132,9 @@ func libc_memset(ptr unsafe.Pointer, c byte, size uintptr) { func libc_memmove(dst, src unsafe.Pointer, size uintptr) { memmove(dst, src, size) } + +// Implement memcpy for LLVM and compiler-rt. +//go:export memcpy +func libc_memcpy(dst, src unsafe.Pointer, size uintptr) { + memcpy(dst, src, size) +}