Fix mingw compilation
cover Fix mingw compilation
This fixes mingw build of modules and kernel.
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH 1/3 Fix error when cross-compiling for windows from unix-like OS
In this case exeext doesn't match the expected value by autoconf and so tests fail as autoconf looks for compiled binaries under wrong name.
Signed-off-by Vladimir Serbinenko <[email protected]>
--- configure.ac | 12 ++++++++++++ 1 file changed, 12 insertions(+)
configure.ac +12 -0
@@ -575,12 +575,22 @@ tmp_CFLAGS="$CFLAGS" tmp_LDFLAGS="$LDFLAGS" tmp_CPPFLAGS="$CPPFLAGS" tmp_LIBS="$LIBS" +tmp_EXEEXT="$EXEEXT" +tmp_ac_exeext="$ac_exeext" CC="$TARGET_CC" CFLAGS="$TARGET_CFLAGS" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" LIBS="" +case "$target_os" in + cygwin*|mingw32*|mingw64*) TARGET_EXEEXT=.exe ;; + *) TARGET_EXEEXT= ;; +esac + +EXEEXT="$TARGET_EXEEXT" +ac_exeext="$TARGET_EXEEXT" + if test "x$target_m32" = x1; then # Force 32-bit mode. TARGET_CFLAGS="$TARGET_CFLAGS -m32"
@@ -1618,6 +1628,8 @@ CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" LDFLAGS="$tmp_LDFLAGS" LIBS="$tmp_LIBS" +EXEEXT="$tmp_EXEEXT" +ac_exeext="$tmp_ac_exeext" # # Check for options.
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH 3/3 pe2elf: Set correct flag for relocation sections
In reply to Vladimir SerbinenkoWithout this flag GRUB ignores the relocation section leading to a crash
Signed-off-by Vladimir Serbinenko <[email protected]>
--- util/grub-pe2elf.c | 1 + 1 file changed, 1 insertion(+)
util/grub-pe2elf.c +1 -0
@@ -341,6 +341,7 @@ write_reloc_section (FILE* fp, const char *name, char *image, shdr[i].sh_offset = offset; shdr[i].sh_link = symtab_section; shdr[i].sh_addralign =4 ; + shdr[i].sh_flags =SHF_INFO_LINK ; shdr[i].sh_entsize =sizeof (elf_reloc_t); shdr[i].sh_size = num_rels *sizeof (elf_reloc_t);
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel
PATCH 2/3 compiler-rt: Add pei386_runtime_relocator stub
In reply to Vladimir SerbinenkoIt's inserted by mingw and is meaningless in our environment
Signed-off-by Vladimir Serbinenko <[email protected]>
--- grub-core/kern/compiler-rt.c | 4 ++++ include/grub/compiler-rt.h | 1 + 2 files changed, 5 insertions(+)
grub-core/kern/compiler-rt.c +4 -0
@@ -210,6 +210,10 @@ void ___chkstk_ms (void)void __chkstk_ms (void ) { } + +void _pei386_runtime_relocator (void ) +{ +}#endif union component64
include/grub/compiler-rt.h +1 -0
@@ -207,6 +207,7 @@ void EXPORT_FUNC (__register_frame_info) (void);void EXPORT_FUNC (__deregister_frame_info ) (void );void EXPORT_FUNC (___chkstk_ms ) (void );void EXPORT_FUNC (__chkstk_ms ) (void ); +void EXPORT_FUNC (_pei386_runtime_relocator ) (void );#endif #endif
Signature · 7 lines
2.49.0 _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel