* 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*.
This commit is contained in:
Vladimir Serbinenko 2013-11-10 13:13:41 +01:00
parent 28668d808e
commit 54da019fdb
3 changed files with 18 additions and 9 deletions

View File

@ -1,4 +1,11 @@
2013-11-09 Vladimir Serbinenko <phcoder@gmail.com>
2013-11-10 Vladimir Serbinenko <phcoder@gmail.com>
* 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 <phcoder@gmail.com>
* configure.ac: Restore CFLAGS to TARGET_CFLAGS before external tests.
Add -march=core2 when testing compile of efiemu64.

View File

@ -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)

View File

@ -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