aboutsummaryrefslogtreecommitdiffstats
path: root/package/grub/patches/200-darwin_fixes.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-05-28 19:48:05 +0000
committerFelix Fietkau <nbd@openwrt.org>2010-05-28 19:48:05 +0000
commit439ca1b72b94b7f38e88b2c0450818d0e5a1f844 (patch)
tree3e1cb426fa794aa7859458147c097f33a595cbc6 /package/grub/patches/200-darwin_fixes.patch
parent464c781c2b65a1859de3d26dff6ee2c6c34fb8ac (diff)
downloadupstream-439ca1b72b94b7f38e88b2c0450818d0e5a1f844.tar.gz
upstream-439ca1b72b94b7f38e88b2c0450818d0e5a1f844.tar.bz2
upstream-439ca1b72b94b7f38e88b2c0450818d0e5a1f844.zip
grub: compile fixes for Mac OS X (based on patches by Jukka Ylitalo)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21608 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/grub/patches/200-darwin_fixes.patch')
-rw-r--r--package/grub/patches/200-darwin_fixes.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/package/grub/patches/200-darwin_fixes.patch b/package/grub/patches/200-darwin_fixes.patch
new file mode 100644
index 0000000000..c5c55a9182
--- /dev/null
+++ b/package/grub/patches/200-darwin_fixes.patch
@@ -0,0 +1,48 @@
+--- a/stage2/asm.S
++++ b/stage2/asm.S
+@@ -95,14 +95,16 @@ VARIABLE(stage2_id)
+ VARIABLE(force_lba)
+ .byte 0
+ VARIABLE(version_string)
+- .string VERSION
++ .ascii VERSION
++ .byte 0
+ VARIABLE(config_file)
+ #ifndef STAGE1_5
+- .string "/boot/grub/menu.lst"
++ .ascii "/boot/grub/menu.lst"
+ #else /* STAGE1_5 */
+ .long 0xffffffff
+- .string "/boot/grub/stage2"
++ .ascii "/boot/grub/stage2"
+ #endif /* STAGE1_5 */
++ .byte 0
+
+ /*
+ * Leave some breathing room for the config file name.
+@@ -762,7 +764,9 @@ ENTRY(chain_stage1)
+ call EXT_C(prot_to_real)
+ .code16
+
+-#ifdef ABSOLUTE_WITHOUT_ASTERISK
++#ifdef __APPLE__
++ DATA32 ADDR32 ljmp offset
++#elif defined(ABSOLUTE_WITHOUT_ASTERISK)
+ DATA32 ADDR32 ljmp (offset)
+ #else
+ DATA32 ADDR32 ljmp *(offset)
+--- a/stage2/char_io.c
++++ b/stage2/char_io.c
+@@ -1345,5 +1345,12 @@ grub_strcpy (char *dest, const char *src
+ #ifndef GRUB_UTIL
+ # undef memcpy
+ /* GCC emits references to memcpy() for struct copies etc. */
++#ifdef __APPLE__
++void *memcpy (void *dest, const void *src, int n)
++{
++ return grub_memmove(dest, src, n);
++}
++#else
+ void *memcpy (void *dest, const void *src, int n) __attribute__ ((alias ("grub_memmove")));
+ #endif
++#endif