diff mbox series

[U-Boot,v2,5/5] examples: add fallback memcpy

Message ID 20170909104746.5948-6-robdclark@gmail.com
State Accepted
Delegated to: Tom Rini
Headers show
Series vsprintf and short-wchar | expand

Commit Message

Rob Clark Sept. 9, 2017, 10:47 a.m. UTC
Solves build issue:

  Building current source for 134 boards (12 threads, 1 job per thread)
         arm:  +   lsxhl
  +examples/api/vsprintf.o: In function `string16':
  +lib/vsprintf.c:278: undefined reference to `memcpy'
  +examples/api/uuid.o: In function `uuid_bin_to_str':
  +lib/uuid.c:197: undefined reference to `memcpy'
  +lib/uuid.c:199: undefined reference to `memcpy'
  +make[3]: *** [examples/api/demo] Error 1
  +make[2]: *** [examples/api] Error 2
  +make[1]: *** [examples] Error 2
  +make: *** [sub-make] Error 2
    133    0    1 /134    sheevaplug

Signed-off-by: Rob Clark <robdclark@gmail.com>
---
 examples/api/glue.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Tom Rini Sept. 13, 2017, 2:28 a.m. UTC | #1
On Sat, Sep 09, 2017 at 06:47:43AM -0400, Rob Clark wrote:

> Solves build issue:
> 
>   Building current source for 134 boards (12 threads, 1 job per thread)
>          arm:  +   lsxhl
>   +examples/api/vsprintf.o: In function `string16':
>   +lib/vsprintf.c:278: undefined reference to `memcpy'
>   +examples/api/uuid.o: In function `uuid_bin_to_str':
>   +lib/uuid.c:197: undefined reference to `memcpy'
>   +lib/uuid.c:199: undefined reference to `memcpy'
>   +make[3]: *** [examples/api/demo] Error 1
>   +make[2]: *** [examples/api] Error 2
>   +make[1]: *** [examples] Error 2
>   +make: *** [sub-make] Error 2
>     133    0    1 /134    sheevaplug
> 
> Signed-off-by: Rob Clark <robdclark@gmail.com>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/examples/api/glue.c b/examples/api/glue.c
index 8aabf32c89..575c1e55f3 100644
--- a/examples/api/glue.c
+++ b/examples/api/glue.c
@@ -416,3 +416,15 @@  void ub_display_clear(void)
 {
 	syscall(API_DISPLAY_CLEAR, NULL);
 }
+
+__weak void *memcpy(void *dest, const void *src, size_t size)
+{
+	unsigned char *dptr = dest;
+	const unsigned char *ptr = src;
+	const unsigned char *end = src + size;
+
+	while (ptr < end)
+		*dptr++ = *ptr++;
+
+	return dest;
+}