diff --git a/ChangeLog b/ChangeLog index ba50cfb68..5405e5069 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-12-16 Vladimir Serbinenko + + Determine the need for mingw-related stubs at compile time rather than + using not very significant $target_os. + 2013-12-16 Vladimir Serbinenko * grub-core/genmod.sh.in: Strip before converting to ELF as strip diff --git a/configure.ac b/configure.ac index b7bc4f810..59bd8736b 100644 --- a/configure.ac +++ b/configure.ac @@ -693,16 +693,6 @@ if test "x$grub_cv_cc_fno_asynchronous_unwind_tables" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-asynchronous-unwind-tables" fi -# For platforms where ELF is not the default link format. -case "${target_os}" in - cygwin) -# FIXME: put proper test here - NEED_REGISTER_FRAME_INFO=1 - ;; - *) NEED_REGISTER_FRAME_INFO=0 ;; -esac - - AC_ARG_ENABLE([efiemu], [AS_HELP_STRING([--enable-efiemu], [build and install the efiemu runtimes (default=guessed)])]) diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c index 05cb1faf7..54db2e125 100644 --- a/grub-core/kern/misc.c +++ b/grub-core/kern/misc.c @@ -1283,7 +1283,7 @@ grub_fatal (const char *fmt, ...) grub_abort (); } -#if NEED_REGISTER_FRAME_INFO && !defined(GRUB_UTIL) +#if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL) void __register_frame_info (void) { } @@ -1291,6 +1291,13 @@ void __register_frame_info (void) void __deregister_frame_info (void) { } +void ___chkstk_ms (void) +{ +} + +void __chkstk_ms (void) +{ +} #endif #if BOOT_TIME_STATS diff --git a/include/grub/misc.h b/include/grub/misc.h index be74d9082..b3ba7306d 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -377,9 +377,11 @@ grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint64_t d, grub_uint64_t *r); -#if !defined(GRUB_UTIL) && NEED_REGISTER_FRAME_INFO +#if (defined (__MINGW32__) || defined (__CYGWIN__)) && !defined(GRUB_UTIL) 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); #endif /* Inline functions. */