Re: GRUB2 on OpenBSD 5.3-amd64: linking problem

2013-08-21 Thread Vladimir 'φ-coder/phcoder' Serbinenko
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

Re: GRUB2 on OpenBSD 5.3-amd64: linking problem

2013-08-22 Thread Vladimir 'φ-coder/phcoder' Serbinenko
On 21.08.2013 21:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> 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.
> 
Only the first problem still remains.
=== 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-22 16:57:12 +
@@ -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-22 16:57:12 +
@@ -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-22 16:57:12 +
@@ -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 (GRUB_MACHINE_EMU)
+#undef double
+#undef float
+#define double __grub_poison
+#define float __grub_poison
+#endif
 #endif
 typedef grub_ssize_t ssize_t;
 #ifndef GRUB_POSIX_BOOL_DEFINED



signature.asc
Description: OpenPGP digital signature
___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub


Re: GRUB2 on OpenBSD 5.3-amd64: linking problem

2013-08-23 Thread Ilya Bakulin
On Thursday 22 August 2013 20:16:48 Vladimir 'φ-coder/phcoder' Serbinenko 
wrote:
> On 21.08.2013 21:06, Vladimir 'φ-coder/phcoder' Serbinenko wrote:
> > 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.
>
> Only the first problem still remains.

I have just tested the compilation of the latest revision (5148) and confirm 
that it compiles OK!
There is a warning about random generator not being secure in 
util/grub-mkpasswd-pbkdf2.c, which may be supressed by adding "&& ! defined 
(__OpenBSD__)" to the defines list.
Thank you Vladimir, I appreciate your work on making GRUB really Unified 
bootloader!

I will test actual installation to MBR and things like that later today / on 
weekend and will report back.

--
Ilya

___
Bug-grub mailing list
Bug-grub@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-grub