From: Vladimir Serbinenko Date: Sun, 10 Nov 2013 12:13:41 +0000 (+0100) Subject: * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and X-Git-Tag: grub-2.02-beta1~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54da019fdbef17c0bb033ccb2b58527656843d6d;p=thirdparty%2Fgrub.git * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and -DELF. * grub-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__ instead of ELF*. --- diff --git a/ChangeLog b/ChangeLog index 29d59587b..368dcf19b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -2013-11-09 Vladimir Serbinenko +2013-11-10 Vladimir Serbinenko + + * grub-core/Makefile.am (efiemu): Remove leftover -DAPPLE_CC and + -DELF. + * grub-core/efiemu/runtime/config.h: Use __i386__ and __x86_64__ + instead of ELF*. + +2013-11-10 Vladimir Serbinenko * configure.ac: Restore CFLAGS to TARGET_CFLAGS before external tests. Add -march=core2 when testing compile of efiemu64. diff --git a/grub-core/Makefile.am b/grub-core/Makefile.am index 980acf346..6c20c7d59 100644 --- a/grub-core/Makefile.am +++ b/grub-core/Makefile.am @@ -390,27 +390,27 @@ if COND_ENABLE_EFIEMU efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) -rm -f $@; \ if test "x$(TARGET_APPLE_CC)" = x1; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF32 -DAPPLE_CC -m32 -Wall -Werror -nostdlib -O2 -c -o $@.bin $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -O2 -c -o $@.bin $< || exit 1; \ $(OBJCONV) -felf32 -nu -nd $@.bin $@ || exit 1; \ rm -f $@.bin; \ else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF32 -m32 -Wall -Werror -nostdlib -O2 -c -o $@ $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m32 -Wall -Werror -nostdlib -O2 -c -o $@ $< || exit 1; \ if test ! -z "$(TARGET_OBJ2ELF)"; then $(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi; \ fi efiemu64_c.o: efiemu/runtime/efiemu.c if test "x$(TARGET_APPLE_CC)" = x1; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -DAPPLE_CC=1 -m64 -nostdlib -Wall -Werror -mno-red-zone -c -o $@ $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -mno-red-zone -c -o $@ $< || exit 1; \ else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -nostdlib -Wall -Werror -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ fi efiemu64_s.o: efiemu/runtime/efiemu.S -rm -f $@ if test "x$(TARGET_APPLE_CC)" = x1; then \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -DAPPLE_CC=1 -m64 -Wall -Werror -nostdlib -O2 -mno-red-zone -c -o $@ $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mno-red-zone -c -o $@ $< || exit 1; \ else \ - $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -DELF64 -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ + $(TARGET_CC) $(DEFS) $(INCLUDES) $(CPPFLAGS_EFIEMU) $(CPPFLAGS_DEFAULT) -m64 -Wall -Werror -nostdlib -O2 -mcmodel=large -mno-red-zone -c -o $@ $< || exit 1; \ fi efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELEF) diff --git a/grub-core/efiemu/runtime/config.h b/grub-core/efiemu/runtime/config.h index 26fb2ff08..c9fe02716 100644 --- a/grub-core/efiemu/runtime/config.h +++ b/grub-core/efiemu/runtime/config.h @@ -19,16 +19,18 @@ #define GRUB_TYPES_CPU_HEADER 1 -#ifdef ELF32 +#ifdef __i386__ # define SIZEOF_VOID_P 4 # define SIZEOF_LONG 4 # define GRUB_TARGET_SIZEOF_VOID_P 4 # define GRUB_TARGET_SIZEOF_LONG 4 # define EFI_FUNC(x) x -#else +#elif defined (__x86_64__) # define SIZEOF_VOID_P 8 # define SIZEOF_LONG 8 # define GRUB_TARGET_SIZEOF_VOID_P 8 # define GRUB_TARGET_SIZEOF_LONG 8 # define EFI_FUNC(x) x ## _real +#else +#error "Unknown architecture" #endif