grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
       [not found] <20160312165742.GR17281@wolfman.devio.us>
@ 2016-03-12 18:29 ` Andrei Borzenkov
  2016-03-12 19:54   ` Jiri B
  0 siblings, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-12 18:29 UTC (permalink / raw)
  To: Jiri B, bug-grub, The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 4262 bytes --]

12.03.2016 19:57, Jiri B пишет:
> Hi,
> 
> I'm trying to build grub-2.02-beta3 on OpenBSD 5.9 amd64 and build
> fails:
> 
> cc -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno-
unreachable-code -Wno-conversion  -O2 -pipe     -o grub-macbless util/grub_macbless-grub-macbless.o grub-core/osdep/grub_macbless-init.o grub-core/kern/emu/grub_macbless-argp_common.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a /usr/local/lib/libintl.so.6.0 -L/usr/local/lib /usr/local/lib/libiconv.so.6.0 -lc -Wl,-rpath,/usr/local/lib      
> libgrubkern.a(libgrubkern_a-hostdisk.o): In function `read_device_map':
> hostdisk.c:(.text+0x7ab): warning: warning: strcpy() is almost always misused, please use strlcpy()
> libgrubkern.a(libgrubkern_a-misc.o): In function `grub_util_get_path':
> misc.c:(.text+0x12a): warning: warning: sprintf() is often misused, please use snprintf()
> libgrubkern.a(libgrubkern_a-getroot.o): In function `grub_util_part_to_disk':
> getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
> 

Does attached patch help?

> Plus, autogen.sh uses GNU options of find command, till now
> I solved that this way:
> 
> --- autogen.sh.orig     Sat Mar 12 17:02:35 2016
> +++ autogen.sh  Sat Mar 12 17:03:05 2016
> @ -8,7 +8,7 @@ set -e
>  export LC_COLLATE=C
>  unset LC_ALL
>  
> -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
> +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -path './build-aux/*' ! -path './grub-core/lib/libgcrypt/src/misc.c' ! -path './grub-core/lib/libgcrypt/src/global.c' ! -path './grub-core/lib/libgcrypt/src/secmem.c'  ! -path './util/grub-gen-widthspec.c' ! -path './util/grub-gen-asciih.c' |sort > po/POTFILES.in
>  find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
>  

Hmm ... we support building on Windows which is case insensitive. What
are other options to compare full path name case insenstive?

>  echo "Importing unicode..."
> 
> Another thing - 'INSTALL' file says >= autoconf 2.60 is needed but
> it is >= 2.62 otherwise there is:
> 
>   "error: possibly undefined macro: AS_ECHO"
> 

Indeed. According to git log, AS_ECHO appeared first in 2.61a. What
version you have?

> IIRC there's also a difference between NetBSD and OpenBSD regarding
> to disks. NetBSD uses eg. /dev/rwd0c for NetBSD part, /dev/rwd0d for
> whole disk, OpenBSD uses 'c' for whole disk and 'd' has no special
> reason.
> 

If I understand it correctly, getrawpartition() is supposed to handle it
(i.e. return entire disk partition number). What exactly does not work?

> Howto reproduce:
> 1. OpenBSD 5.9 amd64 (snapshot; I have one cca month old)
> 2. get grub-2.02-beta3
> 3. autoconf-2.62, automake-1.10, python-2.7, gcc-4.9
> 4. (replace 'ipath' with 'path' in autogen.sh, see above)
> 5. put PYTHON in env pointing to python2.7
> 6. build
> 
> Thanks for help.
> 
> j.
> 
> _______________________________________________
> Bug-grub mailing list
> Bug-grub@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-grub
> 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libutil.patch --]
[-- Type: text/x-patch; name="libutil.patch", Size: 774 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] Makefile.util.def: add $LIBINTL to grub-macbless flags

Fixes compilation on Open BSD.

Reported by Jiri B <jirib@devio.us>

---
 Makefile.util.def | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile.util.def b/Makefile.util.def
index ed9b4c6..f9caccb 100644
--- a/Makefile.util.def
+++ b/Makefile.util.def
@@ -416,7 +416,7 @@ program = {
   ldadd = libgrubgcry.a;
   ldadd = libgrubkern.a;
   ldadd = grub-core/gnulib/libgnu.a;
-  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
+  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
 };
 
 data = {
-- 
tg: (3c3e96d..) u/bsd-libutil (depends on: master)

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-12 18:29 ` [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition' Andrei Borzenkov
@ 2016-03-12 19:54   ` Jiri B
  2016-03-13  5:41     ` Andrei Borzenkov
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri B @ 2016-03-12 19:54 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: bug-grub, The development of GNU GRUB

On Sat, Mar 12, 2016 at 09:29:15PM +0300, Andrei Borzenkov wrote:
> > cc -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wno
>  -
> unreachable-code -Wno-conversion  -O2 -pipe     -o grub-macbless util/grub_macbless-grub-macbless.o grub-core/osdep/grub_macbless-init.o grub-core/kern/emu/grub_macbless-argp_common.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a /usr/local/lib/libintl.so.6.0 -L/usr/local/lib /usr/local/lib/libiconv.so.6.0 -lc -Wl,-rpath,/usr/local/lib      
> > libgrubkern.a(libgrubkern_a-hostdisk.o): In function `read_device_map':
> > hostdisk.c:(.text+0x7ab): warning: warning: strcpy() is almost always misused, please use strlcpy()
> > libgrubkern.a(libgrubkern_a-misc.o): In function `grub_util_get_path':
> > misc.c:(.text+0x12a): warning: warning: sprintf() is often misused, please use snprintf()
> > libgrubkern.a(libgrubkern_a-getroot.o): In function `grub_util_part_to_disk':
> > getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
> > 
> 
> Does attached patch help?
>
> diff --git a/Makefile.util.def b/Makefile.util.def
> index ed9b4c6..f9caccb 100644
> --- a/Makefile.util.def
> +++ b/Makefile.util.def
> @@ -416,7 +416,7 @@ program = {
>    ldadd = libgrubgcry.a;
>    ldadd = libgrubkern.a;
>    ldadd = grub-core/gnulib/libgnu.a;
> -  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
> +  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
>  };
>  
>  data = {

Thank you, your diff makes compilation pass.

Well, I see something went wrong now with compressing a file:

$ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
-r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
-r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img

It should not be 128MB, right? :)

I uploaded whole build log here: http://devio.us/~jirib/grub.txt (2.3MB)

> > -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
> > +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -path './build-aux/*' ! -path './grub-core/lib/libgcrypt/src/misc.c' ! -path './grub-core/lib/libgcrypt/src/global.c' ! -path './grub-core/lib/libgcrypt/src/secmem.c'  ! -path './util/grub-gen-widthspec.c' ! -path './util/grub-gen-asciih.c' |sort > po/POTFILES.in
> >  find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
> >  
> 
> Hmm ... we support building on Windows which is case insensitive. What
> are other options to compare full path name case insenstive?

I can live with patching it. OpenBSD find doesn't have 'ipath' and IIUC
it's not POSIX requiremement, so I doubt it will be implemented.

> > Another thing - 'INSTALL' file says >= autoconf 2.60 is needed but
> > it is >= 2.62 otherwise there is:
> > 
> >   "error: possibly undefined macro: AS_ECHO"
> > 
> 
> Indeed. According to git log, AS_ECHO appeared first in 2.61a. What
> version you have?

IIUC it was firstly available in "normal" autoconf release in 2.62.

> > IIRC there's also a difference between NetBSD and OpenBSD regarding
> > to disks. NetBSD uses eg. /dev/rwd0c for NetBSD part, /dev/rwd0d for
> > whole disk, OpenBSD uses 'c' for whole disk and 'd' has no special
> > reason.
> > 
> 
> If I understand it correctly, getrawpartition() is supposed to handle it
> (i.e. return entire disk partition number). What exactly does not work?

The above comment was just comment. Not sure if there's real issue in
grub code based on those NetBSD/OpenBSD differences.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-12 19:54   ` Jiri B
@ 2016-03-13  5:41     ` Andrei Borzenkov
  2016-03-14 18:19       ` Jiri B
  0 siblings, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-13  5:41 UTC (permalink / raw)
  To: Jiri B; +Cc: bug-grub, The development of GNU GRUB

12.03.2016 22:54, Jiri B пишет:
> On Sat, Mar 12, 2016 at 09:29:15PM +0300, Andrei Borzenkov wrote:
>>> cc -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align  -Wextra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations -Wformat=2 -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-parameter -Wno-redundant-decls -Wn
o
>>  -
>> unreachable-code -Wno-conversion  -O2 -pipe     -o grub-macbless util/grub_macbless-grub-macbless.o grub-core/osdep/grub_macbless-init.o grub-core/kern/emu/grub_macbless-argp_common.o  libgrubmods.a libgrubgcry.a libgrubkern.a grub-core/gnulib/libgnu.a /usr/local/lib/libintl.so.6.0 -L/usr/local/lib /usr/local/lib/libiconv.so.6.0 -lc -Wl,-rpath,/usr/local/lib      
>>> libgrubkern.a(libgrubkern_a-hostdisk.o): In function `read_device_map':
>>> hostdisk.c:(.text+0x7ab): warning: warning: strcpy() is almost always misused, please use strlcpy()
>>> libgrubkern.a(libgrubkern_a-misc.o): In function `grub_util_get_path':
>>> misc.c:(.text+0x12a): warning: warning: sprintf() is often misused, please use snprintf()
>>> libgrubkern.a(libgrubkern_a-getroot.o): In function `grub_util_part_to_disk':
>>> getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
>>>
>>
>> Does attached patch help?
>>
>> diff --git a/Makefile.util.def b/Makefile.util.def
>> index ed9b4c6..f9caccb 100644
>> --- a/Makefile.util.def
>> +++ b/Makefile.util.def
>> @@ -416,7 +416,7 @@ program = {
>>    ldadd = libgrubgcry.a;
>>    ldadd = libgrubkern.a;
>>    ldadd = grub-core/gnulib/libgnu.a;
>> -  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
>> +  ldadd = '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM)';
>>  };
>>  
>>  data = {
> 
> Thank you, your diff makes compilation pass.
> 

Good, pushed. Thanks for testing.

> Well, I see something went wrong now with compressing a file:
> 
> $ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
> -r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img
> 
> It should not be 128MB, right? :)
> 

No. Something went wrong with section addresses/offsets. Please test
2.02~beta2 - do you observe the same problem? Please upload
lzma_decompress.image. Where obcopy comes from (obcopy --version)? What
assembler is used?

> I uploaded whole build log here: http://devio.us/~jirib/grub.txt (2.3MB)
> 
>>> -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
>>> +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -path './build-aux/*' ! -path './grub-core/lib/libgcrypt/src/misc.c' ! -path './grub-core/lib/libgcrypt/src/global.c' ! -path './grub-core/lib/libgcrypt/src/secmem.c'  ! -path './util/grub-gen-widthspec.c' ! -path './util/grub-gen-asciih.c' |sort > po/POTFILES.in
>>>  find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
>>>  
>>
>> Hmm ... we support building on Windows which is case insensitive. What
>> are other options to compare full path name case insenstive?
> 
> I can live with patching it. OpenBSD find doesn't have 'ipath' and IIUC
> it's not POSIX requiremement, so I doubt it will be implemented.
> 

Why did you need it initially? Normally it is needed only when building
from GIT; tarball comes with generated files.

>>> Another thing - 'INSTALL' file says >= autoconf 2.60 is needed but
>>> it is >= 2.62 otherwise there is:
>>>
>>>   "error: possibly undefined macro: AS_ECHO"
>>>
>>
>> Indeed. According to git log, AS_ECHO appeared first in 2.61a. What
>> version you have?
> 
> IIUC it was firstly available in "normal" autoconf release in 2.62.
> 

This does not answer my question - what autoconf version your system
ships with (i.e. - do we need to change configure.ac or simply update
INSTALL)?

>>> IIRC there's also a difference between NetBSD and OpenBSD regarding
>>> to disks. NetBSD uses eg. /dev/rwd0c for NetBSD part, /dev/rwd0d for
>>> whole disk, OpenBSD uses 'c' for whole disk and 'd' has no special
>>> reason.
>>>
>>
>> If I understand it correctly, getrawpartition() is supposed to handle it
>> (i.e. return entire disk partition number). What exactly does not work?
> 
> The above comment was just comment. Not sure if there's real issue in
> grub code based on those NetBSD/OpenBSD differences.
> 

OK, please test after lzma_decompress issue is solved and report problems.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-13  5:41     ` Andrei Borzenkov
@ 2016-03-14 18:19       ` Jiri B
  2016-03-14 18:46         ` Andrei Borzenkov
  2016-03-24  3:55         ` Andrei Borzenkov
  0 siblings, 2 replies; 17+ messages in thread
From: Jiri B @ 2016-03-14 18:19 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: bug-grub, The development of GNU GRUB

On Sun, Mar 13, 2016 at 08:41:27AM +0300, Andrei Borzenkov wrote:
> > Well, I see something went wrong now with compressing a file:
> > 
> > $ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
> > -r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
> > -r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img
> > 
> > It should not be 128MB, right? :)
> > 
> 
> No. Something went wrong with section addresses/offsets. Please test
> 2.02~beta2 - do you observe the same problem? Please upload
> lzma_decompress.image. Where obcopy comes from (obcopy --version)? What
> assembler is used?

$ objcopy -V
GNU objcopy 2.17
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.

OpenBSD uses binutils-2.17 and it's not possible to update it just like that,
it's part of OS.

The file is available here: http://afterboot.cz/pub/lzma_decompress.img

> > I uploaded whole build log here: http://devio.us/~jirib/grub.txt (2.3MB)
> > 
> >>> -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
> >>> +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -path './build-aux/*' ! -path './grub-core/lib/libgcrypt/src/misc.c' ! -path './grub-core/lib/libgcrypt/src/global.c' ! -path './grub-core/lib/libgcrypt/src/secmem.c'  ! -path './util/grub-gen-widthspec.c' ! -path './util/grub-gen-asciih.c' |sort > po/POTFILES.in
> >>>  find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
> >>>  
> >>
> >> Hmm ... we support building on Windows which is case insensitive. What
> >> are other options to compare full path name case insenstive?
> > 
> > I can live with patching it. OpenBSD find doesn't have 'ipath' and IIUC
> > it's not POSIX requiremement, so I doubt it will be implemented.
> > 
> 
> Why did you need it initially? Normally it is needed only when building
> from GIT; tarball comes with generated files.

I built from git snapshot, I haven't seen any tarball for beta3.

> >>> Another thing - 'INSTALL' file says >= autoconf 2.60 is needed but
> >>> it is >= 2.62 otherwise there is:
> >>>
> >>>   "error: possibly undefined macro: AS_ECHO"
> >>>
> >>
> >> Indeed. According to git log, AS_ECHO appeared first in 2.61a. What
> >> version you have?
> > 
> > IIUC it was firstly available in "normal" autoconf release in 2.62.
> > 
> 
> This does not answer my question - what autoconf version your system
> ships with (i.e. - do we need to change configure.ac or simply update
> INSTALL)?

IMO it would be ok to update INSTALL file. I had following autoconf
versions:

autoconf-2.13p3
autoconf-2.52p5
autoconf-2.59p4
autoconf-2.60p4
autoconf-2.61p4
autoconf-2.62p1
autoconf-2.63p0
autoconf-2.65p0
autoconf-2.67p0
autoconf-2.68p0
autoconf-2.69p1

Thanks for help.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-14 18:19       ` Jiri B
@ 2016-03-14 18:46         ` Andrei Borzenkov
  2016-03-17 10:12           ` Jiri B
  2016-03-24  3:55         ` Andrei Borzenkov
  1 sibling, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-14 18:46 UTC (permalink / raw)
  To: Jiri B; +Cc: bug-grub, The development of GNU GRUB

14.03.2016 21:19, Jiri B пишет:
> On Sun, Mar 13, 2016 at 08:41:27AM +0300, Andrei Borzenkov wrote:
>>> Well, I see something went wrong now with compressing a file:
>>>
>>> $ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
>>> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
>>> -r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img
>>>
>>> It should not be 128MB, right? :)
>>>
>>
>> No. Something went wrong with section addresses/offsets. Please test
>> 2.02~beta2 - do you observe the same problem? Please upload

Did you test beta2?

>> lzma_decompress.image. Where obcopy comes from (obcopy --version)? What
>> assembler is used?
> 
> $ objcopy -V
> GNU objcopy 2.17
> Copyright 2005 Free Software Foundation, Inc.
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License.  This program has absolutely no warranty.
> 
> OpenBSD uses binutils-2.17 and it's not possible to update it just like that,
> it's part of OS.
> 
> The file is available here: http://afterboot.cz/pub/lzma_decompress.img
> 

I asked lzma_decompress.image, not img. img is too late.

>>> I uploaded whole build log here: http://devio.us/~jirib/grub.txt (2.3MB)
>>>
>>>>> -find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
>>>>> +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -path './build-aux/*' ! -path './grub-core/lib/libgcrypt/src/misc.c' ! -path './grub-core/lib/libgcrypt/src/global.c' ! -path './grub-core/lib/libgcrypt/src/secmem.c'  ! -path './util/grub-gen-widthspec.c' ! -path './util/grub-gen-asciih.c' |sort > po/POTFILES.in
>>>>>  find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
>>>>>  
>>>>
>>>> Hmm ... we support building on Windows which is case insensitive. What
>>>> are other options to compare full path name case insenstive?
>>>
>>> I can live with patching it. OpenBSD find doesn't have 'ipath' and IIUC
>>> it's not POSIX requiremement, so I doubt it will be implemented.
>>>
>>
>> Why did you need it initially? Normally it is needed only when building
>> from GIT; tarball comes with generated files.
> 
> I built from git snapshot, I haven't seen any tarball for beta3.
> 

They are available on http://alpha.gnu.org/gnu/grub/.




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-14 18:46         ` Andrei Borzenkov
@ 2016-03-17 10:12           ` Jiri B
  2016-03-17 15:54             ` Andrei Borzenkov
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri B @ 2016-03-17 10:12 UTC (permalink / raw)
  To: Andrei Borzenkov; +Cc: bug-grub, The development of GNU GRUB

On Mon, Mar 14, 2016 at 09:46:20PM +0300, Andrei Borzenkov wrote:
> >>> $ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
> >>> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
> >>> -r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img
> >> [...]
> >> No. Something went wrong with section addresses/offsets. Please test
> >> 2.02~beta2 - do you observe the same problem? Please upload
> 
> Did you test beta2?

Hi, sorry for delay. Yes I tried beta2, same result.

> >> lzma_decompress.image. Where obcopy comes from (obcopy --version)? What
> >> assembler is used?
> > 
> > $ objcopy -V
> > GNU objcopy 2.17
> > Copyright 2005 Free Software Foundation, Inc.
> > This program is free software; you may redistribute it under the terms of
> > the GNU General Public License.  This program has absolutely no warranty.
> > [...]
> 
> I asked lzma_decompress.image, not img. img is too late.

I apologize, I missed valid filename. So here as lzma_decompress.image from beta3
(as beta2 got same huge img file).

http://afterboot.cz/pub/lzma_decompress.image
SHA256 (lzma_decompress.image) = 3968a35c3fc2570cf1a888179433f23a7319d104c8622c71e501f4ba6ca38308

Thank you for help.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-17 10:12           ` Jiri B
@ 2016-03-17 15:54             ` Andrei Borzenkov
  2016-03-17 16:04               ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-17 15:54 UTC (permalink / raw)
  To: Jiri B; +Cc: bug-grub, The development of GNU GRUB

17.03.2016 13:12, Jiri B пишет:
> On Mon, Mar 14, 2016 at 09:46:20PM +0300, Andrei Borzenkov wrote:
>>>>> $ tar tzvf /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep lzma_decompress
>>>>> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.image
>>>>> -r--r--r--  1 root     bin      134480024 Jan  1  1970 lib/grub/i386-pc/lzma_decompress.img
>>>> [...]
>>>> No. Something went wrong with section addresses/offsets. Please test
>>>> 2.02~beta2 - do you observe the same problem? Please upload
>>
>> Did you test beta2?
> 
> Hi, sorry for delay. Yes I tried beta2, same result.
> 
>>>> lzma_decompress.image. Where obcopy comes from (obcopy --version)? What
>>>> assembler is used?
>>>
>>> $ objcopy -V
>>> GNU objcopy 2.17
>>> Copyright 2005 Free Software Foundation, Inc.
>>> This program is free software; you may redistribute it under the terms of
>>> the GNU General Public License.  This program has absolutely no warranty.
>>> [...]
>>
>> I asked lzma_decompress.image, not img. img is too late.
> 
> I apologize, I missed valid filename. So here as lzma_decompress.image from beta3
> (as beta2 got same huge img file).
> 
> http://afterboot.cz/pub/lzma_decompress.image
> SHA256 (lzma_decompress.image) = 3968a35c3fc2570cf1a888179433f23a7319d104c8622c71e501f4ba6ca38308
> 

Well, your compiler managed to create shared library instead of
executable file:

bor@bor-Latitude-E5450:~$ LANG=C objdump -f Загрузки/lzma_decompress.image

Загрузки/lzma_decompress.image:     file format elf32-i386
architecture: i386, flags 0x00000050:
HAS_SYMS, DYNAMIC
start address 0x00008200

I get the same if I explicitly add -shared to linker flags.

Could you test with

./configure TARGET_LDFLAGS=-static


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-17 15:54             ` Andrei Borzenkov
@ 2016-03-17 16:04               ` Vladimir 'phcoder' Serbinenko
  2016-03-17 16:07                 ` Andrei Borzenkov
  0 siblings, 1 reply; 17+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2016-03-17 16:04 UTC (permalink / raw)
  To: Andrei Borzenkov, Jiri B; +Cc: bug-grub, The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]

The real problem is .hash section. We need to strip it

Le jeu. 17 mars 2016 16:54, Andrei Borzenkov <arvidjaar@gmail.com> a écrit :

> 17.03.2016 13:12, Jiri B пишет:
> > On Mon, Mar 14, 2016 at 09:46:20PM +0300, Andrei Borzenkov wrote:
> >>>>> $ tar tzvf
> /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep
> lzma_decompress
> >>>>> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970
> lib/grub/i386-pc/lzma_decompress.image
> >>>>> -r--r--r--  1 root     bin      134480024 Jan  1  1970
> lib/grub/i386-pc/lzma_decompress.img
> >>>> [...]
> >>>> No. Something went wrong with section addresses/offsets. Please test
> >>>> 2.02~beta2 - do you observe the same problem? Please upload
> >>
> >> Did you test beta2?
> >
> > Hi, sorry for delay. Yes I tried beta2, same result.
> >
> >>>> lzma_decompress.image. Where obcopy comes from (obcopy --version)?
> What
> >>>> assembler is used?
> >>>
> >>> $ objcopy -V
> >>> GNU objcopy 2.17
> >>> Copyright 2005 Free Software Foundation, Inc.
> >>> This program is free software; you may redistribute it under the terms
> of
> >>> the GNU General Public License.  This program has absolutely no
> warranty.
> >>> [...]
> >>
> >> I asked lzma_decompress.image, not img. img is too late.
> >
> > I apologize, I missed valid filename. So here as lzma_decompress.image
> from beta3
> > (as beta2 got same huge img file).
> >
> > http://afterboot.cz/pub/lzma_decompress.image
> > SHA256 (lzma_decompress.image) =
> 3968a35c3fc2570cf1a888179433f23a7319d104c8622c71e501f4ba6ca38308
> >
>
> Well, your compiler managed to create shared library instead of
> executable file:
>
> bor@bor-Latitude-E5450:~$ LANG=C objdump -f Загрузки/lzma_decompress.image
>
> Загрузки/lzma_decompress.image:     file format elf32-i386
> architecture: i386, flags 0x00000050:
> HAS_SYMS, DYNAMIC
> start address 0x00008200
>
> I get the same if I explicitly add -shared to linker flags.
>
> Could you test with
>
> ./configure TARGET_LDFLAGS=-static
>
> _______________________________________________
> Bug-grub mailing list
> Bug-grub@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-grub
>

[-- Attachment #2: Type: text/html, Size: 3030 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-17 16:04               ` Vladimir 'phcoder' Serbinenko
@ 2016-03-17 16:07                 ` Andrei Borzenkov
  2016-03-17 20:56                   ` Jiri B
  0 siblings, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-17 16:07 UTC (permalink / raw)
  To: Vladimir 'phcoder' Serbinenko, Jiri B
  Cc: bug-grub, The development of GNU GRUB

17.03.2016 19:04, Vladimir 'phcoder' Serbinenko пишет:
> The real problem is .hash section. We need to strip it
> 

I tried it, it does not change anything.

bor@bor-Latitude-E5450:~/build/grub$ objcopy  -O binary
--strip-unneeded -R .note -R .comment -R .note.gnu.build-id -R
.MIPS.abiflags -R .reginfo -R .rel.dyn -R .note.gnu.gold-version -R
.ARM.exidx -R .hash ~/Загрузки/lzma_decompress.image /tmp/x.img
bor@bor-Latitude-E5450:~/build/grub$ LC_ALL=C ll /tmp/x.img
-rw-rw-r-- 1 bor bor 134480024 Mar 17 19:06 /tmp/x.img


> Le jeu. 17 mars 2016 16:54, Andrei Borzenkov <arvidjaar@gmail.com> a écrit :
> 
>> 17.03.2016 13:12, Jiri B пишет:
>>> On Mon, Mar 14, 2016 at 09:46:20PM +0300, Andrei Borzenkov wrote:
>>>>>>> $ tar tzvf
>> /home/jirib/openbsd/packages/amd64/all/grub-2.02-beta3.tgz | grep
>> lzma_decompress
>>>>>>> -r-xr-xr-x  1 root     bin           3904 Jan  1  1970
>> lib/grub/i386-pc/lzma_decompress.image
>>>>>>> -r--r--r--  1 root     bin      134480024 Jan  1  1970
>> lib/grub/i386-pc/lzma_decompress.img
>>>>>> [...]
>>>>>> No. Something went wrong with section addresses/offsets. Please test
>>>>>> 2.02~beta2 - do you observe the same problem? Please upload
>>>>
>>>> Did you test beta2?
>>>
>>> Hi, sorry for delay. Yes I tried beta2, same result.
>>>
>>>>>> lzma_decompress.image. Where obcopy comes from (obcopy --version)?
>> What
>>>>>> assembler is used?
>>>>>
>>>>> $ objcopy -V
>>>>> GNU objcopy 2.17
>>>>> Copyright 2005 Free Software Foundation, Inc.
>>>>> This program is free software; you may redistribute it under the terms
>> of
>>>>> the GNU General Public License.  This program has absolutely no
>> warranty.
>>>>> [...]
>>>>
>>>> I asked lzma_decompress.image, not img. img is too late.
>>>
>>> I apologize, I missed valid filename. So here as lzma_decompress.image
>> from beta3
>>> (as beta2 got same huge img file).
>>>
>>> http://afterboot.cz/pub/lzma_decompress.image
>>> SHA256 (lzma_decompress.image) =
>> 3968a35c3fc2570cf1a888179433f23a7319d104c8622c71e501f4ba6ca38308
>>>
>>
>> Well, your compiler managed to create shared library instead of
>> executable file:
>>
>> bor@bor-Latitude-E5450:~$ LANG=C objdump -f Загрузки/lzma_decompress.image
>>
>> Загрузки/lzma_decompress.image:     file format elf32-i386
>> architecture: i386, flags 0x00000050:
>> HAS_SYMS, DYNAMIC
>> start address 0x00008200
>>
>> I get the same if I explicitly add -shared to linker flags.
>>
>> Could you test with
>>
>> ./configure TARGET_LDFLAGS=-static
>>
>> _______________________________________________
>> Bug-grub mailing list
>> Bug-grub@gnu.org
>> https://lists.gnu.org/mailman/listinfo/bug-grub
>>
> 



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-17 16:07                 ` Andrei Borzenkov
@ 2016-03-17 20:56                   ` Jiri B
  2016-03-18  3:26                     ` Andrei Borzenkov
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri B @ 2016-03-17 20:56 UTC (permalink / raw)
  To: Andrei Borzenkov
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

> >> [...]
> >> Well, your compiler managed to create shared library instead of
> >> executable file:
> >>
> >> bor@bor-Latitude-E5450:~$ LANG=C objdump -f Загрузки/lzma_decompress.image
> >>
> >> Загрузки/lzma_decompress.image:     file format elf32-i386
> >> architecture: i386, flags 0x00000050:
> >> HAS_SYMS, DYNAMIC
> >> start address 0x00008200
> >>
> >> I get the same if I explicitly add -shared to linker flags.
> >>
> >> Could you test with
> >>
> >> ./configure TARGET_LDFLAGS=-static

TARGET_LDFLAGS=-static caused no difference. But... While being
a little bit desperate I had a look at grub 0.9.x in OpenBSD ports
and there was

  CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie

So I gave it a try and it seems better (?)

$ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
-rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
-rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img

$ objdump -f /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image

/home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image:     file format elf32-i386
architecture: i386, flags 0x00000002:
EXEC_P
start address 0x00008200

It is OK?

grub 0.9.x in OpenBSD ports is for i386 arch only (not for 64bit one).
I have no idea why, I'll ask on ports@ list some OpenBSD porters.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-17 20:56                   ` Jiri B
@ 2016-03-18  3:26                     ` Andrei Borzenkov
  2016-03-18 13:01                       ` Jiri B
  0 siblings, 1 reply; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-18  3:26 UTC (permalink / raw)
  To: Jiri B
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

17.03.2016 23:56, Jiri B пишет:
>>>> [...]
>>>> Well, your compiler managed to create shared library instead of
>>>> executable file:
>>>>
>>>> bor@bor-Latitude-E5450:~$ LANG=C objdump -f Загрузки/lzma_decompress.image
>>>>
>>>> Загрузки/lzma_decompress.image:     file format elf32-i386
>>>> architecture: i386, flags 0x00000050:
>>>> HAS_SYMS, DYNAMIC
>>>> start address 0x00008200
>>>>
>>>> I get the same if I explicitly add -shared to linker flags.
>>>>
>>>> Could you test with
>>>>
>>>> ./configure TARGET_LDFLAGS=-static
> 
> TARGET_LDFLAGS=-static caused no difference. But... While being
> a little bit desperate I had a look at grub 0.9.x in OpenBSD ports
> and there was
> 
>   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
> 
> So I gave it a try and it seems better (?)
> 
> $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
> -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
> -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
> 
> $ objdump -f /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image
> 
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image:     file format elf32-i386
> architecture: i386, flags 0x00000002:
> EXEC_P
> start address 0x00008200
> 
> It is OK?
> 

It certainly looks better than before. Does it actually work?

We aready use -fno-PIE, looks like we need to explicitly check for
-fno-pie as well.

> grub 0.9.x in OpenBSD ports is for i386 arch only (not for 64bit one).
> I have no idea why, I'll ask on ports@ list some OpenBSD porters.
> 
> j.
> 



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-18  3:26                     ` Andrei Borzenkov
@ 2016-03-18 13:01                       ` Jiri B
  2016-03-18 16:53                         ` Andrei Borzenkov
  0 siblings, 1 reply; 17+ messages in thread
From: Jiri B @ 2016-03-18 13:01 UTC (permalink / raw)
  To: Andrei Borzenkov
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

On Fri, Mar 18, 2016 at 06:26:47AM +0300, Andrei Borzenkov wrote:
> > [...]
> >   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
> > 
> > So I gave it a try and it seems better (?)
> > 
> > $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
> > -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
> > -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
> > 
> > $ objdump -f /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image
> > 
> > /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image:     file format elf32-i386
> > architecture: i386, flags 0x00000002:
> > EXEC_P
> > start address 0x00008200
> > 
> > It is OK?
> > 
> 
> It certainly looks better than before. Does it actually work?
> 
> We aready use -fno-PIE, looks like we need to explicitly check for
> -fno-pie as well.

I just booted OpenBSD from "native OpenBSD" grub2:

grub-install /dev/rwd0c # used qemu for testing
XX_xxxx files put into /etc/grub.d
cat >> /etc/grub.d/40_custom << EOF
menuentry "OpenBSD" {
    set root=(hd0,4)
    chainloader +1
}
EOF
grub-mkconfig -o /grub/grub.cfg

Thank you, I'm going to proceed with pxechainloader.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-18 13:01                       ` Jiri B
@ 2016-03-18 16:53                         ` Andrei Borzenkov
  2016-03-18 19:48                           ` Vladimir 'phcoder' Serbinenko
  2016-03-22 10:31                           ` Jiri B
  0 siblings, 2 replies; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-18 16:53 UTC (permalink / raw)
  To: Jiri B
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

[-- Attachment #1: Type: text/plain, Size: 1498 bytes --]

18.03.2016 16:01, Jiri B пишет:
> On Fri, Mar 18, 2016 at 06:26:47AM +0300, Andrei Borzenkov wrote:
>>> [...]
>>>   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
>>>
>>> So I gave it a try and it seems better (?)
>>>
>>> $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
>>> -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
>>> -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
>>>
>>> $ objdump -f /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image
>>>
>>> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image:     file format elf32-i386
>>> architecture: i386, flags 0x00000002:
>>> EXEC_P
>>> start address 0x00008200
>>>
>>> It is OK?
>>>
>>
>> It certainly looks better than before. Does it actually work?
>>
>> We aready use -fno-PIE, looks like we need to explicitly check for
>> -fno-pie as well.
> 
> I just booted OpenBSD from "native OpenBSD" grub2:
> 

Good. Please test attached patch.

@Vladimir: I was unsure whether to add explicit -fpie test, but at the
end I do not see what it buys us. Both options have been introduced at
the same time and we want neither enabled. Current test covers both.

Is it OK to commit?

[-- Attachment #2: fno-pie.patch --]
[-- Type: text/x-patch, Size: 1273 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: set -fno-pie together with -fno-PIE

OpenBSD 5.9 apparently defaults to -fpie. We use -fno-PIE when appropriate
already, but that is not enough - it does not turn off -fpie.

Actually check for -fPIE is not precise enough. __PIE__ is set for both
-fpie and -fPIE but with different values. As far as I can tell, both
options were introduced at the same time, so both should always be supported.

This fixes compilation on OpenBSD 5.9 which otherwise created insanely big
lzma_decompress.img.

Reported, suggested and tested by: Jiri B <jirib@devio.us>

---
 configure.ac | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index a85b134..57e1713 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS"
 # Position independent executable.
 grub_CHECK_PIE
 [# Need that, because some distributions ship compilers that include
-# `-fPIE' in the default specs.
+# `-fPIE' or '-fpie' in the default specs.
 if [ x"$pie_possible" = xyes ]; then
-  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
+  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
 fi]
 
 CFLAGS="$TARGET_CFLAGS"
-- 
tg: (76eac44..) u/fno-pie (depends on: master)

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-18 16:53                         ` Andrei Borzenkov
@ 2016-03-18 19:48                           ` Vladimir 'phcoder' Serbinenko
  2016-03-22 10:31                           ` Jiri B
  1 sibling, 0 replies; 17+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2016-03-18 19:48 UTC (permalink / raw)
  To: Andrei Borzenkov, Jiri B; +Cc: bug-grub, The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 1744 bytes --]

If it solves the problem, go ahead

Le ven. 18 mars 2016 17:53, Andrei Borzenkov <arvidjaar@gmail.com> a écrit :

> 18.03.2016 16:01, Jiri B пишет:
> > On Fri, Mar 18, 2016 at 06:26:47AM +0300, Andrei Borzenkov wrote:
> >>> [...]
> >>>   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
> >>>
> >>> So I gave it a try and it seems better (?)
> >>>
> >>> $ ls -l
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/
> lzma_decompress.im*
> >>> -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
> >>> -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
> >>>
> >>> $ objdump -f
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image
> >>>
> >>>
> /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image:
>    file format elf32-i386
> >>> architecture: i386, flags 0x00000002:
> >>> EXEC_P
> >>> start address 0x00008200
> >>>
> >>> It is OK?
> >>>
> >>
> >> It certainly looks better than before. Does it actually work?
> >>
> >> We aready use -fno-PIE, looks like we need to explicitly check for
> >> -fno-pie as well.
> >
> > I just booted OpenBSD from "native OpenBSD" grub2:
> >
>
> Good. Please test attached patch.
>
> @Vladimir: I was unsure whether to add explicit -fpie test, but at the
> end I do not see what it buys us. Both options have been introduced at
> the same time and we want neither enabled. Current test covers both.
>
> Is it OK to commit?
>

[-- Attachment #2: Type: text/html, Size: 2329 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-18 16:53                         ` Andrei Borzenkov
  2016-03-18 19:48                           ` Vladimir 'phcoder' Serbinenko
@ 2016-03-22 10:31                           ` Jiri B
  2016-03-22 17:48                             ` Andrei Borzenkov
  1 sibling, 1 reply; 17+ messages in thread
From: Jiri B @ 2016-03-22 10:31 UTC (permalink / raw)
  To: Andrei Borzenkov
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

> >>> [...]
> >>>   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
> >>>
> >>> $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
> >>> -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
> >>> -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
> >>>
> >>> [...]
> >>>
>
> Good. Please test attached patch.
> 
> [...]
> 
> diff --git a/configure.ac b/configure.ac
> index a85b134..57e1713 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS"
>  # Position independent executable.
>  grub_CHECK_PIE
>  [# Need that, because some distributions ship compilers that include
> -# `-fPIE' in the default specs.
> +# `-fPIE' or '-fpie' in the default specs.
>  if [ x"$pie_possible" = xyes ]; then
> -  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
> +  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
>  fi]
>  
>  CFLAGS="$TARGET_CFLAGS"

Thx, builds find on OpenBSD.

j.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-22 10:31                           ` Jiri B
@ 2016-03-22 17:48                             ` Andrei Borzenkov
  0 siblings, 0 replies; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-22 17:48 UTC (permalink / raw)
  To: Jiri B
  Cc: Vladimir 'phcoder' Serbinenko,
	The development of GNU GRUB, bug-grub

[-- Attachment #1: Type: text/plain, Size: 1388 bytes --]

22.03.2016 13:31, Jiri B пишет:
>>>>> [...]
>>>>>   CFLAGS=-ftrampolines -fno-stack-protector -fno-pie -nopie
>>>>>
>>>>> $ ls -l /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.im*
>>>>> -rwxr-xr-x  1 jirib  wheel  3068 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.image*
>>>>> -rw-r--r--  1 jirib  wheel  2832 Mar 17 21:45 /home/jirib/openbsd/pobj/grub-2.02-beta3/fake-amd64/usr/local/lib/grub/i386-pc/lzma_decompress.img
>>>>>
>>>>> [...]
>>>>>
>>
>> Good. Please test attached patch.
>>
>> [...]
>>
>> diff --git a/configure.ac b/configure.ac
>> index a85b134..57e1713 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1185,9 +1185,9 @@ CFLAGS="$TARGET_CFLAGS"
>>  # Position independent executable.
>>  grub_CHECK_PIE
>>  [# Need that, because some distributions ship compilers that include
>> -# `-fPIE' in the default specs.
>> +# `-fPIE' or '-fpie' in the default specs.
>>  if [ x"$pie_possible" = xyes ]; then
>> -  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE"
>> +  TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE -fno-pie"
>>  fi]
>>  
>>  CFLAGS="$TARGET_CFLAGS"
> 
> Thx, builds find on OpenBSD.
> 

OK, so we are left with -ipath. One possibility is something like
attached patch; another - to replace ipath with -path | grep -v. Latter
is probably more readable.

[-- Attachment #2: find-ipath.patch --]
[-- Type: text/x-patch, Size: 2090 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] autogen.sh: avoid non-portable -ipath and -iname

OpenBSD 5.9 find does not have ipath, although it supports iname. For
consistency, also replace iname with suitable pattern.

Reported By: Jiri B <jirib@devio.us>

---
 autogen.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 7537561..cd254d8 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,8 +8,9 @@ set -e
 export LC_COLLATE=C
 unset LC_ALL
 
-find . -iname '*.[ch]' ! -ipath './grub-core/lib/libgcrypt-grub/*' ! -ipath './build-aux/*' ! -ipath './grub-core/lib/libgcrypt/src/misc.c' ! -ipath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libgcrypt/src/secmem.c'  ! -ipath './util/grub-gen-widthspec.c' ! -ipath './util/grub-gen-asciih.c' |sort > po/POTFILES.in
-find util -iname '*.in' ! -name Makefile.in  |sort > po/POTFILES-shell.in
+# This avoids non-portable -iname and -ipath
+find . -name '*.[cC][hH]' ! -path './[gG][rR][uU][bB]-[cC][oO][rR][eE]/[lL][iI][bB]/[lL][iI][bB][gG][cC][rR][yY][pP][tT]-[gG][rR][uU][bB]/*' ! -path './[bB][uU][iI][lL][dD]-[aA][uU][xX]/*' ! -path './[gG][rR][uU][bB]-[cC][oO][rR][eE]/[lL][iI][bB]/[lL][iI][bB][gG][cC][rR][yY][pP][tT]/[sS][rR][cC]/[mM][iI][sS][cC].[cC]' ! -path './[gG][rR][uU][bB]-[cC][oO][rR][eE]/[lL][iI][bB]/[lL][iI][bB][gG][cC][rR][yY][pP][tT]/[sS][rR][cC]/[gG][lL][oO][bB][aA][lL].[cC]' ! -path './[gG][rR][uU][bB]-[cC][oO][rR][eE]/[lL][iI][bB]/[lL][iI][bB][gG][cC][rR][yY][pP][tT]/[sS][rR][cC]/[sS][eE][cC][mM][eE][mM].[cC]'  ! -path './[uU][tT][iI][lL]/[gG][rR][uU][bB]-[gG][eE][nN]-[wW][iI][dD][tT][hH][sS][pP][eE][cC].[cC]' ! -path './[uU][tT][iI][lL]/[gG][rR][uU][bB]-[gG][eE][nN]-[aA][sS][cC][iI][iI][hH].[cC]' |sort > po/POTFILES.in
+find util -name '*.[iI][nN]' ! -name Makefile.in  |sort > po/POTFILES-shell.in
 
 echo "Importing unicode..."
 ${PYTHON} util/import_unicode.py unicode/UnicodeData.txt unicode/BidiMirroring.txt unicode/ArabicShaping.txt grub-core/unidata.c
-- 
tg: (f4d35d4..) u/autogen-find-ipath (depends on: master)

^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition'
  2016-03-14 18:19       ` Jiri B
  2016-03-14 18:46         ` Andrei Borzenkov
@ 2016-03-24  3:55         ` Andrei Borzenkov
  1 sibling, 0 replies; 17+ messages in thread
From: Andrei Borzenkov @ 2016-03-24  3:55 UTC (permalink / raw)
  To: Jiri B; +Cc: bug-grub, The development of GNU GRUB

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]

14.03.2016 21:19, Jiri B пишет:
> 
>>>>> Another thing - 'INSTALL' file says >= autoconf 2.60 is needed but
>>>>> it is >= 2.62 otherwise there is:
>>>>>
>>>>>   "error: possibly undefined macro: AS_ECHO"
>>>>>
>>>>
>>>> Indeed. According to git log, AS_ECHO appeared first in 2.61a. What
>>>> version you have?
>>>
>>> IIUC it was firstly available in "normal" autoconf release in 2.62.
>>>
>>
>> This does not answer my question - what autoconf version your system
>> ships with (i.e. - do we need to change configure.ac or simply update
>> INSTALL)?
> 
> IMO it would be ok to update INSTALL file. I had following autoconf
> versions:
> 
> autoconf-2.13p3
> autoconf-2.52p5
> autoconf-2.59p4
> autoconf-2.60p4
> autoconf-2.61p4
> autoconf-2.62p1
> autoconf-2.63p0
> autoconf-2.65p0
> autoconf-2.67p0
> autoconf-2.68p0
> autoconf-2.69p1
> 

It is silly to bump version requirement in this case where AS_ECHO is
not really needed. Could you retest attached patch with 2.60?




[-- Attachment #2: no-as_echo.patch --]
[-- Type: text/x-patch, Size: 966 bytes --]

From: Andrei Borzenkov <arvidjaar@gmail.com>
Subject: [PATCH] configure: replace AS_ECHO with echo in program transform

INSTALL requires autoconf 2.60, but AS_ECHO appeared first in 2.61a. It is
used just once to transform program names; in this case arguments are known
plain string so simple `echo' is safe to use. This avoids bumping required
autoconf version without real reason.

Reported by: Jiri B <jirib@devio.us>

---
 acinclude.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 526f97a..e659b1e 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -421,5 +421,5 @@ else
 dnl Create an output variable with the transformed name of a GRUB utility
 dnl program.
 AC_DEFUN([grub_TRANSFORM],[dnl
-AC_SUBST(AS_TR_SH([$1]), [`AS_ECHO([$1]) | sed "$program_transform_name"`])dnl
+AC_SUBST(AS_TR_SH([$1]), [`echo [$1] | sed "$program_transform_name"`])dnl
 ])
-- 
tg: (f4d35d4..) u/no_as_echo (depends on: master)

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-03-24  3:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20160312165742.GR17281@wolfman.devio.us>
2016-03-12 18:29 ` [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition' Andrei Borzenkov
2016-03-12 19:54   ` Jiri B
2016-03-13  5:41     ` Andrei Borzenkov
2016-03-14 18:19       ` Jiri B
2016-03-14 18:46         ` Andrei Borzenkov
2016-03-17 10:12           ` Jiri B
2016-03-17 15:54             ` Andrei Borzenkov
2016-03-17 16:04               ` Vladimir 'phcoder' Serbinenko
2016-03-17 16:07                 ` Andrei Borzenkov
2016-03-17 20:56                   ` Jiri B
2016-03-18  3:26                     ` Andrei Borzenkov
2016-03-18 13:01                       ` Jiri B
2016-03-18 16:53                         ` Andrei Borzenkov
2016-03-18 19:48                           ` Vladimir 'phcoder' Serbinenko
2016-03-22 10:31                           ` Jiri B
2016-03-22 17:48                             ` Andrei Borzenkov
2016-03-24  3:55         ` Andrei Borzenkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).