From 5f02926bbcebc1acaa7475a4c3d39c915605c147 Mon Sep 17 00:00:00 2001 From: BVK Chaitanya Date: Wed, 26 May 2010 09:56:59 +0530 Subject: [PATCH] emu build fixes for sparc64 and freebsd --- conf/any-emu.rmk | 7 ++++++- include/grub/cache.h | 3 ++- include/grub/emu/misc.h | 1 + util/misc.c | 8 -------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/conf/any-emu.rmk b/conf/any-emu.rmk index 3f0df06aa..17abc8911 100644 --- a/conf/any-emu.rmk +++ b/conf/any-emu.rmk @@ -1,6 +1,8 @@ # -*- makefile -*- -COMMON_CFLAGS += -nostdinc -isystem $(shell $(TARGET_CC) -print-file-name=include) +ifeq ($(target_cpu), sparc64) +COMMON_LDFLAGS += -mno-relax +endif kernel_img_RELOCATABLE = yes pkglib_PROGRAMS = kernel.img @@ -45,6 +47,9 @@ cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) endif grub_emu_LDFLAGS = $(LIBCURSES) +ifeq ($(target_cpu), sparc64) +grub_emu_LDFLAGS += -m64 -mno-relax +endif ifeq ($(enable_grub_emu_usb), yes) kernel_img_HEADERS += libusb.h diff --git a/include/grub/cache.h b/include/grub/cache.h index 27e44f0a2..a54bc00f8 100644 --- a/include/grub/cache.h +++ b/include/grub/cache.h @@ -23,7 +23,8 @@ #include #include -#if defined (__i386__) || defined (__x86_64__) +#if defined (__i386__) || defined (__x86_64__) || \ + (defined (GRUB_MACHINE_EMU) && GRUB_MACHINE_EMU) static inline void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) diff --git a/include/grub/emu/misc.h b/include/grub/emu/misc.h index e037e6be7..1492e757a 100644 --- a/include/grub/emu/misc.h +++ b/include/grub/emu/misc.h @@ -46,5 +46,6 @@ int EXPORT_FUNC(asprintf) (char **buf, const char *fmt, ...); #endif char * EXPORT_FUNC(xasprintf) (const char *fmt, ...); +char * canonicalize_file_name (const char *path); #endif /* GRUB_EMU_MISC_H */ diff --git a/util/misc.c b/util/misc.c index 91bc25a55..dd0077d72 100644 --- a/util/misc.c +++ b/util/misc.c @@ -214,14 +214,6 @@ grub_millisleep (grub_uint32_t ms) #endif -#if !(defined (__i386__) || defined (__x86_64__)) && GRUB_NO_MODULES -void -grub_arch_sync_caches (void *address __attribute__ ((unused)), - grub_size_t len __attribute__ ((unused))) -{ -} -#endif - #ifdef __MINGW32__ void sync (void)