- honor uclibc's notion of LFS support
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 29 Nov 2006 20:26:05 +0000 (20:26 -0000)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Wed, 29 Nov 2006 20:26:05 +0000 (20:26 -0000)
target/x86/grub/grub.300-honor_UCLIBC_HAS_LFS.patch [new file with mode: 0644]
target/x86/grub/grub.mk

diff --git a/target/x86/grub/grub.300-honor_UCLIBC_HAS_LFS.patch b/target/x86/grub/grub.300-honor_UCLIBC_HAS_LFS.patch
new file mode 100644 (file)
index 0000000..5b94186
--- /dev/null
@@ -0,0 +1,34 @@
+diff -rup grub-0.97.orig/grub/asmstub.c grub-0.97/grub/asmstub.c
+--- grub-0.97.orig/grub/asmstub.c      2006-11-29 20:36:20.000000000 +0100
++++ grub-0.97/grub/asmstub.c   2006-11-29 21:26:16.000000000 +0100
+@@ -18,10 +18,13 @@
+  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
++#include <features.h>
++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
+ /* Try to use glibc's transparant LFS support. */
+ #define _LARGEFILE_SOURCE     1
+ /* lseek becomes synonymous with lseek64.  */
+ #define _FILE_OFFSET_BITS     64
++#endif
+ /* Simulator entry point. */
+ int grub_stage2 (void);
+diff -rup grub-0.97.orig/lib/device.c grub-0.97/lib/device.c
+--- grub-0.97.orig/lib/device.c        2006-11-29 20:36:20.000000000 +0100
++++ grub-0.97/lib/device.c     2006-11-29 21:25:19.000000000 +0100
+@@ -18,10 +18,13 @@
+  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+  */
++#include <features.h>
++#if !defined __UCLIBC__ || (defined __UCLIBC__ && defined __UCLIBC_HAS_LFS__)
+ /* Try to use glibc's transparant LFS support. */
+ #define _LARGEFILE_SOURCE       1
+ /* lseek becomes synonymous with lseek64.  */
+ #define _FILE_OFFSET_BITS       64
++#endif
+ #include <stdio.h>
+ #include <stdlib.h>
index 8e4bd575e352d09b61b2740b04aea75c7bbd08f4..af3ce6da09306a9cc1bff95f0046411e1cd4fb19 100644 (file)
@@ -36,6 +36,10 @@ GRUB_TARGET_FILES+=$(GRUB_SPLASHIMAGE)
 endif
 GRUB_CFLAGS=-DSUPPORT_LOOPDEV
 
+ifeq ($(BR2_LARGEFILE),)
+GRUB_CFLAGS+=-U_FILE_OFFSET_BITS
+endif
+
 $(DL_DIR)/$(GRUB_SOURCE):
         $(WGET) -P $(DL_DIR) $(GRUB_SITE)/$(GRUB_SOURCE)