]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix compilation on cygwin.
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 13 Jan 2011 21:23:49 +0000 (22:23 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 13 Jan 2011 21:23:49 +0000 (22:23 +0100)
* 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.

ChangeLog
conf/Makefile.common
conf/i386-pc-cygwin-img-ld.sc
configure.ac
grub-core/Makefile.am
grub-core/genmod.sh.in
util/grub-pe2elf.c

index 7a3f3f63a39ef83e001937b4754bc38b24b8870c..696da12150f9929ded148d832f97f9f774ff4844 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+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
index 2df8465c09d76af6918e9055918410251e194c0d..32ca76d08a0dcf7caf34483bfedc1ad08071c586 100644 (file)
@@ -67,7 +67,11 @@ CFLAGS_KERNEL = $(CFLAGS_CPU) $(CFLAGS_PLATFORM) -ffreestanding
 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
index a41cac75e2c16316782d6ec531d5864f18884054..3b579d34450bd56dbbb65fa6070a00ce5066f5fa 100644 (file)
@@ -13,15 +13,9 @@ SECTIONS
     __data_start__ = . ;
     *(.data)
     __data_end__ = . ;
-  }
-  .rdata :
-  {
     __rdata_start__ = . ;
     *(.rdata)
     __rdata_end__ = . ;
-  }
-  .pdata :
-  {
     *(.pdata)
     edata = . ;
   }
index 055c65e67f8a33f8951cf9859eebb660aa96cf37..0b9207ea2c6c7f015ef4d49647e27ab529d213a5 100644 (file)
@@ -454,7 +454,7 @@ fi
 # 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
   ;;
@@ -964,6 +964,7 @@ AM_CONDITIONAL([COND_APPLE_CC], [test x$TARGET_APPLE_CC = x1])
 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
index fcf3fc42d835ad1f097ebb427bea7fed114a5c10..94f7f3ffe7483aaedfca73654a228780ada91bb7 100644 (file)
@@ -303,7 +303,7 @@ platform_DATA += moddep.lst
 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)
 
index b97f3e1c78c82d8bafd84087442efdb02af73c3a..023cd10625a0209cdf87073d47799ad8e5182769 100644 (file)
@@ -52,8 +52,8 @@ fi
 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 \
index f370bbfa8b54b9d0b32c3d503f76684300ec91ab..cf690841f36a9ba872aa1b79de5b4100d3abef33 100644 (file)
@@ -337,7 +337,7 @@ write_symbol_table (FILE* fp, char *image,
       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;