From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1aerpW-0002t9-LI for mharc-grub-devel@gnu.org; Sat, 12 Mar 2016 17:16:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35152) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aepcU-0003ML-29 for grub-devel@gnu.org; Sat, 12 Mar 2016 14:54:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aepcS-0001ZG-NC for grub-devel@gnu.org; Sat, 12 Mar 2016 14:54:37 -0500 Received: from wolfman.devio.us ([98.142.108.75]:17151) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aepcN-0001YW-Tj; Sat, 12 Mar 2016 14:54:32 -0500 Received: from localhost (localhost [127.0.0.1]) by wolfman.devio.us (Postfix) with ESMTP id 05D70201DEE; Sat, 12 Mar 2016 14:54:26 -0500 (EST) X-Virus-Scanned: amavisd-new at devio.us Received: from wolfman.devio.us ([127.0.0.1]) by localhost (wolfman.devio.us [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id knBdJMZBnX84; Sat, 12 Mar 2016 14:54:23 -0500 (EST) Received: by wolfman.devio.us (Postfix, from userid 2589) id E68EA201DEC; Sat, 12 Mar 2016 14:54:23 -0500 (EST) Date: Sat, 12 Mar 2016 14:54:23 -0500 From: Jiri B To: Andrei Borzenkov Subject: Re: [openbsd] 2.02-beta3: build fails - getroot.c:(.text+0x2b): undefined reference to `getrawpartition' Message-ID: <20160312195423.GS17281@wolfman.devio.us> References: <20160312165742.GR17281@wolfman.devio.us> <56E45FFB.3070807@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <56E45FFB.3070807@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: OpenBSD 4.x-5.x X-Received-From: 98.142.108.75 X-Mailman-Approved-At: Sat, 12 Mar 2016 17:16:13 -0500 Cc: bug-grub@gnu.org, The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Mar 2016 19:54:39 -0000 On Sat, Mar 12, 2016 at 09:29:15PM +0300, Andrei Borzenkov wrote: > > cc -Wall -W -Wshadow -Wpointer-arith -Wundef -Wchar-subscripts -Wcommen= t -Wdeprecated-declarations -Wdisabled-optimization -Wdiv-by-zero -Wfloat-e= qual -Wformat-extra-args -Wformat-security -Wformat-y2k -Wimplicit -Wimplic= it-function-declaration -Wimplicit-int -Wmain -Wmissing-braces -Wmissing-fo= rmat-attribute -Wmultichar -Wparentheses -Wreturn-type -Wsequence-point -Ws= hadow -Wsign-compare -Wswitch -Wtrigraphs -Wunknown-pragmas -Wunused -Wunus= ed-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-vari= able -Wwrite-strings -Wnested-externs -Wstrict-prototypes -Wcast-align -We= xtra -Wattributes -Wendif-labels -Winit-self -Wint-to-pointer-cast -Winvali= d-pch -Wmissing-field-initializers -Wnonnull -Woverflow -Wvla -Wpointer-to-= int-cast -Wstrict-aliasing -Wvariadic-macros -Wvolatile-register-var -Wpoin= ter-sign -Wmissing-include-dirs -Wmissing-prototypes -Wmissing-declarations= -Wformat=3D2 -Wno-undef -Wno-sign-compare -Wno-unused -Wno-unused-paramete= r -Wno-redundant-decls -Wno > - > unreachable-code -Wno-conversion -O2 -pipe -o grub-macbless util/gru= b_macbless-grub-macbless.o grub-core/osdep/grub_macbless-init.o grub-core/k= ern/emu/grub_macbless-argp_common.o libgrubmods.a libgrubgcry.a libgrubker= n.a grub-core/gnulib/libgnu.a /usr/local/lib/libintl.so.6.0 -L/usr/local/li= b /usr/local/lib/libiconv.so.6.0 -lc -Wl,-rpath,/usr/local/lib =20 > > libgrubkern.a(libgrubkern_a-hostdisk.o): In function `read_device_map': > > hostdisk.c:(.text+0x7ab): warning: warning: strcpy() is almost always m= isused, 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, ple= ase use snprintf() > > libgrubkern.a(libgrubkern_a-getroot.o): In function `grub_util_part_to_= disk': > > getroot.c:(.text+0x2b): undefined reference to `getrawpartition' > >=20 >=20 > 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 =3D { > ldadd =3D libgrubgcry.a; > ldadd =3D libgrubkern.a; > ldadd =3D grub-core/gnulib/libgnu.a; > - ldadd =3D '$(LIBINTL) $(LIBDEVMAPPER) $(LIBZFS) $(LIBNVPAIR) $(LIBGEOM= )'; > + ldadd =3D '$(LIBINTL) $(LIBDEVMAPPER) $(LIBUTIL) $(LIBZFS) $(LIBNVPAIR= ) $(LIBGEOM)'; > }; > =20 > data =3D { 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 | gre= p lzma_decompress -r-xr-xr-x 1 root bin 3904 Jan 1 1970 lib/grub/i386-pc/lzm= a_decompress.image -r--r--r-- 1 root bin 134480024 Jan 1 1970 lib/grub/i386-pc/lzm= a_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' ! -ip= ath './grub-core/lib/libgcrypt/src/global.c' ! -ipath './grub-core/lib/libg= crypt/src/secmem.c' ! -ipath './util/grub-gen-widthspec.c' ! -ipath './uti= l/grub-gen-asciih.c' |sort > po/POTFILES.in > > +find . -iname '*.[ch]' ! -path './grub-core/lib/libgcrypt-grub/*' ! -p= ath './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= =2Ein > > =20 >=20 > 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 >=3D autoconf 2.60 is needed but > > it is >=3D 2.62 otherwise there is: > >=20 > > "error: possibly undefined macro: AS_ECHO" > >=20 >=20 > 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. > >=20 >=20 > 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.