[2342] 2009-06-18 Vladimir Serbinenko <[email protected]>

Vladimir Serbinenko <[email protected]> Thu, 18 Jun 2009 14:02:23 +0000
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 2342
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=2342
Author:   phcoder
Date:     2009-06-18 14:02:23 +0000 (Thu, 18 Jun 2009)
Log Message:
-----------
2009-06-18  Vladimir Serbinenko  <[email protected]>

	Fix build with Apple's toolchain. Part 1

	* commands/i386/pc/drivemap_int13h.S: use assembly-time constants
	for long calls
	* configure.ac: remove a leftover AC_MSG_RESULT
	(CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with 
	Apple's toolchain

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/commands/i386/pc/drivemap_int13h.S
    trunk/grub2/configure.ac

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2009-06-18 13:51:06 UTC (rev 2341)
+++ trunk/grub2/ChangeLog	2009-06-18 14:02:23 UTC (rev 2342)
@@ -1,5 +1,15 @@
 2009-06-18  Vladimir Serbinenko  <[email protected]>
 
+	Fix build with Apple's toolchain. Part 1
+
+	* commands/i386/pc/drivemap_int13h.S: use assembly-time constants
+	for long calls
+	* configure.ac: remove a leftover AC_MSG_RESULT
+	(CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with 
+	Apple's toolchain
+
+2009-06-18  Vladimir Serbinenko  <[email protected]>
+
 	Fix warnings
 
 	* fs/ntfscomp.c (decomp_get16): initialize c1 and c2

Modified: trunk/grub2/commands/i386/pc/drivemap_int13h.S
===================================================================
--- trunk/grub2/commands/i386/pc/drivemap_int13h.S	2009-06-18 13:51:06 UTC (rev 2341)
+++ trunk/grub2/commands/i386/pc/drivemap_int13h.S	2009-06-18 14:02:23 UTC (rev 2342)
@@ -66,7 +66,12 @@
 	popf
 	pushf
 
+#ifdef APPLE_CC
+	grub_drivemap_oldhandler_ofs = INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler))
+	lcall *%cs:grub_drivemap_oldhandler_ofs
+#else
 	lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler))
+#endif
 
 	push	%bp
 	mov	%sp, %bp
@@ -89,7 +94,11 @@
 	popf
 	pushf
 
+#ifdef APPLE_CC
+	lcall *%cs:grub_drivemap_oldhandler_ofs
+#else
 	lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler))
+#endif
 
 	push	%bp
 	mov	%sp, %bp

Modified: trunk/grub2/configure.ac
===================================================================
--- trunk/grub2/configure.ac	2009-06-18 13:51:06 UTC (rev 2341)
+++ trunk/grub2/configure.ac	2009-06-18 14:02:23 UTC (rev 2342)
@@ -308,7 +308,6 @@
 AC_SUBST(TARGET_IMG_LDSCRIPT)
 AC_SUBST(TARGET_IMG_LDFLAGS)
 AC_SUBST(TARGET_IMG_CFLAGS)
-AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC])
 
 # For platforms where ELF is not the default link format.
 AC_MSG_CHECKING([for command to convert module to ELF format])
@@ -396,7 +395,11 @@
 
 # Set them to their new values for the tests below.
 CC="$TARGET_CC"
+if test "x$TARGET_APPLE_CC" = x1 ; then
+CFLAGS="$TARGET_CFLAGS -nostdlib"
+else
 CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100"
+fi
 CPPFLAGS="$TARGET_CPPFLAGS"
 LDFLAGS="$TARGET_LDFLAGS"