+2011-01-13 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Fix compilation on cygwin.
+
+ * conf/Makefile.common (STRIPFLAGS_KERNEL): Add -F elf32-i386 and
+ -R .drectve on cygwin.
+ * conf/i386-pc-cygwin-img-ld.sc: Merge rdata and pdata into data.
+ * configure.ac: Use $(top_builddir) in TARGET_OBJ2ELF.
+ (COND_CYGWIN): New condition.
+ * grub-core/Makefile.am (%.mod): Set TARGET_OBJ2ELF.
+ * grub-core/genmod.sh.in: Use ${TARGET_OBJ2ELF} and
+ not @TARGET_OBJ2ELF@.
+ * util/grub-pe2elf.c (write_symbol_table): Use pe_symtab->type and not
+ type to determine whether aux is to be used.
+
2011-01-12 Vladimir Serbinenko <phcoder@gmail.com>
* util/ieee1275/ofpath.c (grub_util_devname_to_ofpath): Use the
LDFLAGS_KERNEL = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N -static-libgcc
CPPFLAGS_KERNEL = $(CPPFLAGS_CPU) $(CPPFLAGS_PLATFORM)
CCASFLAGS_KERNEL = $(CCASFLAGS_CPU) $(CCASFLAGS_PLATFORM)
+if COND_CYGWIN
+STRIPFLAGS_KERNEL = -F elf32-i386 -R .rel.dyn -R .reginfo -R .note -R .comment -R .drectve
+else
STRIPFLAGS_KERNEL = -R .rel.dyn -R .reginfo -R .note -R .comment
+endif
CFLAGS_MODULE = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
LDFLAGS_MODULE = $(LDFLAGS_CPU) $(LDFLAGS_PLATFORM) -nostdlib -Wl,-N,-r,-d
__data_start__ = . ;
*(.data)
__data_end__ = . ;
- }
- .rdata :
- {
__rdata_start__ = . ;
*(.rdata)
__rdata_end__ = . ;
- }
- .pdata :
- {
*(.pdata)
edata = . ;
}
# For platforms where ELF is not the default link format.
AC_MSG_CHECKING([for command to convert module to ELF format])
case "${host_os}" in
- cygwin) TARGET_OBJ2ELF='$(grub_utildir)/grub-pe2elf';
+ cygwin) TARGET_OBJ2ELF='$(top_builddir)/grub-pe2elf';
# FIXME: put proper test here
NEED_REGISTER_FRAME_INFO=1
;;
AM_CONDITIONAL([COND_ENABLE_EFIEMU], [test x$enable_efiemu = xyes])
AM_CONDITIONAL([COND_HAVE_ASM_USCORE], [test x$HAVE_ASM_USCORE = x1])
+AM_CONDITIONAL([COND_CYGWIN], [test x$host_os = xcygwin])
# Output files.
grub_CHECK_LINK_DIR
CLEANFILES += config.log syminfo.lst moddep.lst
$(MOD_FILES): %.mod : genmod.sh moddep.lst %.module$(EXEEXT)
- sh $^ $@
+ TARGET_OBJ2ELF=@TARGET_OBJ2ELF@ sh $^ $@
platform_DATA += $(MOD_FILES)
CLEANFILES += $(MOD_FILES)
rm -f $t1 $t2
if test x@TARGET_APPLE_CC@ != x1; then
- if ! test -z "@TARGET_OBJ2ELF@"; then
- ./@TARGET_OBJ2ELF@ $tmpfile || exit 1
+ if ! test -z "${TARGET_OBJ2ELF}"; then
+ ./${TARGET_OBJ2ELF} $tmpfile || exit 1
fi
if test x@platform@ != xemu; then
@STRIP@ --strip-unneeded \
else
bind = STB_LOCAL;
- if ((type != STT_FUNC) && (pe_symtab->num_aux))
+ if ((pe_symtab->type != GRUB_PE32_DT_FUNCTION) && (pe_symtab->num_aux))
{
if (! pe_symtab->value)
type = STT_SECTION;