grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v8 1/1] plainmount: Support plain encryption mode


From: Maxim Fomin
Subject: Re: [PATCH v8 1/1] plainmount: Support plain encryption mode
Date: Sat, 14 Jan 2023 12:07:20 +0000

------- Original Message -------
On Tuesday, January 10th, 2023 at 6:19 PM, Glenn Washburn 
<development@efficientek.com> wrote:
>
> On Wed, 28 Dec 2022 18:05:11 +0000
> Maxim Fomin maxim@fomin.one wrote:
>
> > ------- Original Message -------
> > On Saturday, December 24th, 2022 at 2:09 AM, Glenn Washburn
> > development@efficientek.com wrote:
> >
> > > On Fri, 23 Dec 2022 19:54:47 -0600
> > > Glenn Washburn development@efficientek.com wrote:
> > >
> > > > On Fri, 02 Dec 2022 17:11:23 +0000
> > > > Maxim Fomin maxim@fomin.one wrote:
> > > >
> > > > > ------- Original Message -------
> > > > > On Friday, December 2nd, 2022 at 0:00, Glenn Washburn
> > > > > development@efficientek.com wrote:
> > > > >
> > > > > > I'm now compiling this patch and found a few compile issues
> > > > > > below. You're compile testing this right?
> > > > >
> > > > > First versions of the patch were tested in pure grub src
> > > > > directory. Later I switched to directly making and installing
> > > > > GRUB package for my distro using its source script syntax. It
> > > > > seems this process was affected by environment options which
> > > > > hided these errors/warnings.
> > > > >
> > > > > I test the patch on my two old laptops - one with UEFI BIOS
> > > > > (x86_64-efi) and one is pre-UEFI (i386-pc). I was compiling
> > > > > i386-pc target too, because otherwise the second laptop was
> > > > > unbootable. During i386-pc compilation I noticed some warnings
> > > > > related to 'PRIuGRUB_XXX' macros which were absent during efi
> > > > > target compilation. I noticed that there are similar warnings
> > > > > in other modules and decided that there are issues with
> > > > > 'PRIuGRUB_XXX' macros at i386-pc platform at global level. In
> > > > > any case, these issues didn't cause compilation fail in my
> > > > > working environment because I would not be able to compile and
> > > > > boot pre-UEFI lap. Do you use -Werror?
> > > >
> > > > I didn't see this until just now. In case you're still
> > > > interested, no I don't use -Werror or any special compiler flags.
> > > > And I'm using gcc version 10.2.1 from a Debian 11 container.
> > >
> > > Correction, -Werror is being used. Perhaps that's a default compiler
> > > flag on Debian systems.
> > >
> > > Glenn
> >
> > This explains why you have found these issues. However, it does not
> > explain how you can compile grub with -Werror because currently there
> > are following warnings in x86_64-efi mode:
> > grub-core/lib/libgcrypt-grub/mpi/mpi-internal.h:150:24: warning:
> > variable ‘_ql’ set but not used [-Wunused-but-set-variable]
> > grub-core/lib/libgcrypt-grub/mpi/mpih-div.c:53:9: warning: variable
> > ‘dummy’ set but not used [-Wunused-but-set-variable]
>
>
> Ok I looked at this a little more, I'm getting these warnings when
> compiling the speedtest module. They are not being treated as errors.
> By default GRUB will use -Werror when building the target, unless
> --disable-werror is specified. However, the gcc command for the
> speedtest module doesn't have -Werror but a bunch of -W* and does not
> include -Wunused-but-set-variable, which is why the compile doesn't
> error. So it seems that -Werror is being changed to constituent -W*
> options and some -W* are left out in my case (haven't found where this
> happens yet). I'm not setting any CFLAGS that might affect this, are
> you? Since, I've not seen anyone else complaining about it here, I
> suspect this is something odd about your build environment.
>
> What is your build environment? (distro, GCC version)

It has two steps. Firstly I compile GRUB sources in local git folder
to see errors and warnings. Then I make GRUB package for my linux
distro. Until October I was building GRUB package with custom archlinux
PKGBUILD which approximately follows this script:
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=grub-luks-keyfile-git

CFLAGS in local makepkg.conf were CFLAGS="-march=sandybridge -mtune=generic
-O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat 
-Werror=format-security
-fstack-clash-protection -fcf-protection"

Since October I used a local copy of this gentoo ebuild to build GRUB:
https://gitweb.gentoo.org/repo/gentoo.git/tree/sys-boot/grub/grub-9999.ebuild

CFLAGS in make.conf is set to "-O2 -pipe -march=sandybridge"

In both local scripts src uri was changed from mainstream to local git repo
which hosted plainmount commits. Both scripts enable --disable-Werror
configure option, which means several warnings (including 'libgcrypt-grub/mpi/')
were ignored.

gcc -v on current build environment:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/12/lto-wrapper
Target: x86_64-pc-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.2.1 20221231 (Gentoo 12.2.1_p20221231 p8)

> > When I was working with the patch earlier this year I remember having
> > these and several more warnings which prevented me from using
> > -Werror. Back then I have removed the switch and have forgotten about
> > this issue completely.
>
>
> Did you remove the switch by using the --disable-werror configure
> option? If not, how?
>
> Glenn

In my build environment --disable-werror is set in local src folder and
in GRUB package scripts.

It seems I have these mpi warnings because in my build environment some
macros are left undefined which makes variables '_ql' and 'dummy' left
unused. I did not investigate these warnings deeper.

Best regards,
Maxim Fomin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]