Various GRUB build fixes
cover Various GRUB build fixes
Hey,
As in subject... I am CC-ing folks who were somehow involved in doing/reviewing patches touching broken files. If I missed somebody then sorry about that. Anyway, please take a look.
There are still broken builds which I am going to fix soon. However, fortunately most of our targets build without any issue right now.
Daniel
grub-core/kern/compiler-rt.c | 5 +++-- grub-core/loader/ia64/efi/linux.c | 3 +-- grub-core/loader/mips/linux.c | 2 +- grub-core/loader/powerpc/ieee1275/linux.c | 4 ++-- include/grub/compiler-rt.h | 4 +++- 5 files changed, 10 insertions(+), 8 deletions(-)
Daniel Kiper (5):
verifiers: IA-64 fallout cleanup
verifiers: PowerPC fallout cleanup
verifiers: MIPS fallout cleanup
mips: Enable __clzsi2()
sparc: Enable __clzsi2() and __clzdi2()
PATCH 1/5 verifiers: IA-64 fallout cleanup
IA-64 fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility to verify kernel and modules command lines).
--- grub-core/loader/ia64/efi/linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
grub-core/loader/ia64/efi/linux.c +1 -2
@@ -505,8 +505,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), *p ='\0' ; - err =grub_verify_string (cmdline,GRUB_VERIFY_KERNEL_CMDLINE ); -if (err) +if (grub_verify_string (cmdline,GRUB_VERIFY_KERNEL_CMDLINE )) goto fail; boot_param->command_line = (grub_uint64_t ) cmdline;
Signature · 1 line
2.11.0
PATCH 2/5 verifiers: PowerPC fallout cleanup
In reply to Daniel KiperPowerPC fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility to verify kernel and modules command lines) and ca0a4f689 (verifiers: File type for fine-grained signature-verification controlling).
--- grub-core/loader/powerpc/ieee1275/linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
grub-core/loader/powerpc/ieee1275/linux.c +2 -2
@@ -270,7 +270,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto out; } - elf =grub_elf_open (argv[0 ]); + elf =grub_elf_open (argv[0 ],GRUB_FILE_TYPE_LINUX_KERNEL );if (! elf) goto out;
@@ -303,7 +303,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),/* Create kernel command line. */ grub_memcpy (linux_args,LINUX_IMAGE ,sizeof (LINUX_IMAGE ));if (grub_create_loader_cmdline (argc, argv, linux_args +sizeof (LINUX_IMAGE ) -1 , - size)) + size,GRUB_VERIFY_KERNEL_CMDLINE )) goto out; out:
Signature · 1 line
2.11.0
PATCH 3/5 verifiers: MIPS fallout cleanup
In reply to Daniel KiperMIPS fallout cleanup after commit 4d4a8c96e (verifiers: Add possibility to verify kernel and modules command lines).
--- grub-core/loader/mips/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
grub-core/loader/mips/linux.c +1 -1
@@ -314,7 +314,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)),grub_memcpy (params,LINUX_IMAGE ,sizeof (LINUX_IMAGE ));grub_create_loader_cmdline (argc, argv, params +sizeof (LINUX_IMAGE ) -1 , - size); + size,GRUB_VERIFY_KERNEL_CMDLINE );#else linux_argv = extra; argv_off = (grub_uint8_t *) linux_argv - (grub_uint8_t *) playground;
Signature · 1 line
2.11.0
PATCH 4/5 mips: Enable __clzsi2()
In reply to Daniel KiperThis patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers for clz) but for MIPS target.
--- grub-core/kern/compiler-rt.c | 5 +++-- include/grub/compiler-rt.h | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-)
grub-core/kern/compiler-rt.c +3 -2
@@ -420,8 +420,7 @@ __aeabi_llsl (grub_uint64_t u, int b)#endif -#ifdef __riscv - +#if defined(__mips__) || defined(__riscv)/* Based on libgcc from gcc suite. */ int __clzsi2 (grub_uint32_t val)
@@ -447,7 +446,9 @@ __clzsi2 (grub_uint32_t val) }return (i - val); } +#endif +#ifdef __riscvint __clzdi2 (grub_uint64_t val) {
include/grub/compiler-rt.h +3 -1
@@ -110,10 +110,12 @@ EXPORT_FUNC (__aeabi_llsr) (grub_uint64_t u, int b);#endif -#ifdef __riscv +#if defined(__mips__) || defined(__riscv)int EXPORT_FUNC (__clzsi2 ) (grub_uint32_t val); +#endif +#ifdef __riscvint EXPORT_FUNC (__clzdi2 ) (grub_uint64_t val);#endif
Signature · 1 line
2.11.0
PATCH 5/5 sparc: Enable __clzsi2() and __clzdi2()
In reply to Daniel KiperThis patch is similiar to commit e795b9011 (RISC-V: Add libgcc helpers for clz) but for SPARC target.
--- grub-core/kern/compiler-rt.c | 4 ++-- include/grub/compiler-rt.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
grub-core/kern/compiler-rt.c +2 -2
@@ -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) {
include/grub/compiler-rt.h +2 -2
@@ -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
Signature · 1 line
2.11.0
Quoted 18 lines · Daniel Kiper
Hey,
As in subject... I am CC-ing folks who were somehow involved in doing/reviewing patches touching broken files. If I missed somebody then sorry about that. Anyway, please take a look.
There are still broken builds which I am going to fix soon. However, fortunately most of our targets build without any issue right now.
Daniel
grub-core/kern/compiler-rt.c | 5 +++-- grub-core/loader/ia64/efi/linux.c | 3 +-- grub-core/loader/mips/linux.c | 2 +- grub-core/loader/powerpc/ieee1275/linux.c | 4 ++-- include/grub/compiler-rt.h | 4 +++- 5 files changed, 10 insertions(+), 8 deletions(-)
Quoted 2 lines
Daniel Kiper (5):
verifiers: IA-64 fallout cleanup
It seems like the things fixed in these two would have prevented compiling. I guess it was not tried on these platforms?
Quoted 4 lines
verifiers: PowerPC fallout cleanup
verifiers: MIPS fallout cleanup> mips: Enable__clzsi2()
sparc: Enable__clzsi2()and__clzdi2()
Anyway, LGTM
Quoted 19 lines · Ross Philipson
Quoted 18 lines · Daniel Kiper
Hey,
As in subject... I am CC-ing folks who were somehow involved in doing/reviewing patches touching broken files. If I missed somebody then sorry about that. Anyway, please take a look.
There are still broken builds which I am going to fix soon. However, fortunately most of our targets build without any issue right now.
Daniel
grub-core/kern/compiler-rt.c | 5 +++-- grub-core/loader/ia64/efi/linux.c | 3 +-- grub-core/loader/mips/linux.c | 2 +- grub-core/loader/powerpc/ieee1275/linux.c | 4 ++-- include/grub/compiler-rt.h | 4 +++- 5 files changed, 10 insertions(+), 8 deletions(-)
Quoted 5 lines
Quoted 2 lines
Daniel Kiper (5):
verifiers: IA-64 fallout cleanupIt seems like the things fixed in these two would have prevented compiling. I guess it was not tried on these platforms?
Nope.
Quoted 8 lines
Quoted 4 lines
verifiers: PowerPC fallout cleanup
verifiers: MIPS fallout cleanup> mips: Enable__clzsi2()
sparc: Enable__clzsi2()and__clzdi2()Anyway, LGTM
Reviewed-by Ross Philipson <[email protected]>
Thanks a lot! Patches have been pushed.
Daniel