diff --git a/grub-core/kern/compiler-rt.c b/grub-core/kern/compiler-rt.c index 33e08fe06..a464200c6 100644 --- a/grub-core/kern/compiler-rt.c +++ b/grub-core/kern/compiler-rt.c @@ -420,7 +420,7 @@ __aeabi_llsl (grub_uint64_t u, int b) #endif -#if defined(__mips__) || defined(__riscv) +#if defined(__mips__) || defined(__riscv) || defined(__sparc__) /* Based on libgcc from gcc suite. */ int __clzsi2 (grub_uint32_t val) @@ -448,7 +448,7 @@ __clzsi2 (grub_uint32_t val) } #endif -#ifdef __riscv +#if defined(__riscv) || defined(__sparc__) int __clzdi2 (grub_uint64_t val) { diff --git a/include/grub/compiler-rt.h b/include/grub/compiler-rt.h index 31c0fd750..7591980b4 100644 --- a/include/grub/compiler-rt.h +++ b/include/grub/compiler-rt.h @@ -110,12 +110,12 @@ EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b); #endif -#if defined(__mips__) || defined(__riscv) +#if defined(__mips__) || defined(__riscv) || defined(__sparc__) int EXPORT_FUNC (__clzsi2) (grub_uint32_t val); #endif -#ifdef __riscv +#if defined(__riscv) || defined(__sparc__) int EXPORT_FUNC (__clzdi2) (grub_uint64_t val); #endif