Remove libgcc dependency.

libgcc for boot environment isn't always present and compatible.
libgcc is often absent if endianness or bit-size at boot is different
from running OS.
libgcc may use optimised opcodes that aren't available on boot time.
So instead of relying on libgcc shipped with the compiler, supply
the functions in GRUB directly.
Tests are present to ensure that those replacement functions behave the
way compiler expects them to.
This commit is contained in:
Vladimir Serbinenko 2015-03-03 20:23:42 +01:00
parent 77697d14e5
commit 064360e667
21 changed files with 1441 additions and 479 deletions

View file

@ -42,21 +42,6 @@ strcasecmp (const char *s1, const char *s2)
return grub_strcasecmp (s1, s2);
}
#ifdef GRUB_UTIL
static inline void *
memcpy (void *dest, const void *src, grub_size_t n)
{
return grub_memcpy (dest, src, n);
}
static inline int
memcmp (const void *s1, const void *s2, grub_size_t n)
{
return grub_memcmp (s1, s2, n);
}
#endif
static inline void
bcopy (const void *src, void *dest, grub_size_t n)
{
@ -99,4 +84,9 @@ memchr (const void *s, int c, grub_size_t n)
return grub_memchr (s, c, n);
}
#define memcmp grub_memcmp
#define memcpy grub_memcpy
#define memmove grub_memmove
#define memset grub_memset
#endif