Skip to content

Commit

Permalink
examples: add fallback memcpy
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
robclark authored and trini committed Sep 12, 2017
1 parent 22ada0c commit 7e3e205
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions examples/api/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 7e3e205

Please sign in to comment.