Based on your work, current WIP patch. I've committed some parts of your
patch as well as my own fixes. Remainder is attached
Current problems:
-double/float is mostly a kludge
-build-grub-mkfont
-nm on OpenBSD doesn't accept same options as GNU one.
=== modified file 'conf/Makefile.common'
--- conf/Makefile.common 2013-08-21 18:59:18 +
+++ conf/Makefile.common 2013-08-21 19:05:19 +
@@ -9,6 +9,7 @@
# Platform specific options
if COND_i386_pc
CFLAGS_PLATFORM += -mrtd -mregparm=3
+ LDFLAGS_PLATFORM = -Wl,-melf_i386
endif
if COND_i386_efi
LDFLAGS_PLATFORM = -Wl,-melf_i386
@@ -18,12 +19,15 @@
endif
if COND_i386_qemu
CFLAGS_PLATFORM += -mrtd -mregparm=3
+ LDFLAGS_PLATFORM = -Wl,-melf_i386
endif
if COND_i386_coreboot
CFLAGS_PLATFORM += -mrtd -mregparm=3
+ LDFLAGS_PLATFORM = -Wl,-melf_i386
endif
if COND_i386_ieee1275
CFLAGS_PLATFORM += -mrtd -mregparm=3
+ LDFLAGS_PLATFORM = -Wl,-melf_i386
endif
if COND_mips_loongson
CFLAGS_PLATFORM += -mexplicit-relocs
=== modified file 'configure.ac'
--- configure.ac 2013-08-16 13:04:38 +
+++ configure.ac 2013-08-21 19:05:19 +
@@ -440,7 +440,7 @@
LIBS=""
# debug flags.
-WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wempty-body -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
+WARN_FLAGS="-Wall -W -Wshadow -Wold-style-definition -Wpointer-arith -Wundef -Wextra -Waddress -Wattributes -Wcast-align -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wendif-labels -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmain -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-noreturn -Wmultichar -Wnonnull -Woverflow -Wparentheses -Wpointer-arith -Wpointer-to-int-cast -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wstrict-aliasing -Wswitch -Wtrigraphs -Wundef -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wpointer-sign"
HOST_CFLAGS="$HOST_CFLAGS $WARN_FLAGS"
TARGET_CFLAGS="$TARGET_CFLAGS $WARN_FLAGS -g -Wredundant-decls -Wmissing-prototypes -Wmissing-declarations"
TARGET_CCASFLAGS="$TARGET_CCASFLAGS -g"
=== modified file 'grub-core/lib/minilzo/lzoconf.h'
--- grub-core/lib/minilzo/lzoconf.h 2011-08-14 09:39:31 +
+++ grub-core/lib/minilzo/lzoconf.h 2013-08-21 19:05:19 +
@@ -53,7 +53,19 @@
# include
#endif
#include
+#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double signed long long
+#define float signed long long
+#endif
#include
+#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double __grub_poison
+#define float __grub_poison
+#endif
/***
=== modified file 'grub-core/lib/minilzo/minilzo.c'
--- grub-core/lib/minilzo/minilzo.c 2011-08-14 09:39:31 +
+++ grub-core/lib/minilzo/minilzo.c 2013-08-21 19:05:19 +
@@ -58,7 +58,20 @@
# include
#endif
#include
+#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double signed long long
+#define float signed long long
+#endif
#include
+#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double __grub_poison
+#define float __grub_poison
+#endif
+
#if defined(MINILZO_CFG_USE_INTERNAL_LZODEFS)
#ifndef __LZODEFS_H_INCLUDED
=== modified file 'grub-core/lib/posix_wrap/sys/types.h'
--- grub-core/lib/posix_wrap/sys/types.h 2013-04-14 17:57:15 +
+++ grub-core/lib/posix_wrap/sys/types.h 2013-08-21 19:05:19 +
@@ -21,10 +21,22 @@
#include
-#ifndef __APPLE__
+#if !defined (__APPLE__) && !defined (__OpenBSD__)
typedef grub_size_t size_t;
#else
+#if !defined (GRUB_UTIL) && !defined (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double signed long long
+#define float signed long long
+#endif
#include
+#if !defined (GRUB_UTIL) && !defined (GRU