Index: conf/i386-efi.rmk =================================================================== --- conf/i386-efi.rmk (revision 1787) +++ conf/i386-efi.rmk (working copy) @@ -1,8 +1,8 @@ # -*- makefile -*- -COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 -COMMON_CFLAGS = -fno-builtin -m32 -COMMON_LDFLAGS = -melf_i386 -nostdlib +COMMON_ASFLAGS = -nostdinc -fno-builtin +COMMON_CFLAGS = -fno-builtin +COMMON_LDFLAGS = -nostdlib # Used by various components. These rules need to precede them. normal/lexer.c_DEPENDENCIES = grub_script.tab.h Index: configure.ac =================================================================== --- configure.ac (revision 1787) +++ configure.ac (working copy) @@ -75,7 +75,6 @@ # Adjust CPU unless target was explicitly specified. if test -z "$target_alias"; then case "$target_cpu"-"$platform" in - x86_64-efi) ;; x86_64-*) target_cpu=i386 ;; powerpc64-ieee1275) target_cpu=powerpc ;; esac @@ -84,21 +83,15 @@ # Check if the platform is supported, make final adjustments. case "$target_cpu"-"$platform" in i386-efi) ;; - x86_64-efi) ;; - i386-pc) ;; - i386-coreboot) ;; - i386-linuxbios) platform=coreboot ;; - i386-ieee1275) ;; + i386-pc) target_m32=1 ;; + i386-coreboot) target_m32=1 ;; + i386-linuxbios) target_m32=1 ; platform=coreboot ;; + i386-ieee1275) target_m32=1 ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; esac -case "$target_cpu" in - i386 | powerpc) target_m32=1 ;; - x86_64 | sparc64) target_m64=1 ;; -esac - AC_SUBST(target_cpu) AC_SUBST(platform) Index: include/grub/i386/setjmp.h =================================================================== --- include/grub/i386/setjmp.h (revision 1787) +++ include/grub/i386/setjmp.h (working copy) @@ -19,10 +19,19 @@ #ifndef GRUB_SETJMP_CPU_HEADER #define GRUB_SETJMP_CPU_HEADER 1 -typedef unsigned long grub_jmp_buf[6]; +typedef unsigned long grub_jmp_buf[8]; +#ifdef __x86_64__ + +int grub_setjmp (grub_jmp_buf env); +void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); + +#else + int grub_setjmp (grub_jmp_buf env) __attribute__ ((cdecl, regparm (3))); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn, cdecl, regparm (3))); +#endif + #endif /* ! GRUB_SETJMP_CPU_HEADER */ Index: include/grub/i386/types.h =================================================================== --- include/grub/i386/types.h (revision 1787) +++ include/grub/i386/types.h (working copy) @@ -19,12 +19,24 @@ #ifndef GRUB_TYPES_CPU_HEADER #define GRUB_TYPES_CPU_HEADER 1 +#ifdef __i386__ + /* The size of void *. */ #define GRUB_TARGET_SIZEOF_VOID_P 4 /* The size of long. */ #define GRUB_TARGET_SIZEOF_LONG 4 +#else + +/* The size of void *. */ +#define GRUB_TARGET_SIZEOF_VOID_P 8 + +/* The size of long. */ +#define GRUB_TARGET_SIZEOF_LONG 8 + +#endif + /* i386 is little-endian. */ #undef GRUB_TARGET_WORDS_BIGENDIAN