Skip to content

Commit

Permalink
Determine the need for mingw-related stubs at compile time rather than
Browse files Browse the repository at this point in the history
	using not very significant $target_os.
  • Loading branch information
phcoder committed Dec 16, 2013
1 parent fadddc2 commit 252a289
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 12 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2013-12-16 Vladimir Serbinenko <[email protected]>

Determine the need for mingw-related stubs at compile time rather than
using not very significant $target_os.

2013-12-16 Vladimir Serbinenko <[email protected]>

* grub-core/genmod.sh.in: Strip before converting to ELF as strip
Expand Down
10 changes: 0 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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)])])
Expand Down
9 changes: 8 additions & 1 deletion grub-core/kern/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,14 +1283,21 @@ 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)
{
}

void __deregister_frame_info (void)
{
}
void ___chkstk_ms (void)
{
}

void __chkstk_ms (void)
{
}
#endif

#if BOOT_TIME_STATS
Expand Down
4 changes: 3 additions & 1 deletion include/grub/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit 252a289

Please sign in to comment.