Re: [PATCH 0/5] Configure cleanups and a fix

2022-03-24 Thread Daniel Kiper
On Fri, Mar 18, 2022 at 01:41:34AM -0500, Glenn Washburn wrote: > The first patch is a fix to bring configure inline with the INSTALL > documentation which says that HOST_* variables supercede their unprefixed > counterparts. In fact, prior to this change the HOST_CC variable was > ignored and set

Re: [PATCH 1/5] configure: Allow HOST_CC to override CC

2022-03-24 Thread Daniel Kiper
On Fri, Mar 18, 2022 at 01:41:35AM -0500, Glenn Washburn wrote: > According to the INSTALL, "The HOST_* variables override not prefixed > variables". This change makes it so, instead of previous behavior, which > was to ignore the HOST_CC environment variable. > > Signed-off-by: Glenn Washburn > -

Re: [PATCH] docs: Add information on using --build when cross-compiling

2022-03-24 Thread Daniel Kiper
On Fri, Mar 18, 2022 at 01:43:46AM -0500, Glenn Washburn wrote: > The autoconf 2.65 manual[1] strongly recommends specifying the --build > option when the --host is used. Add this to the example and add a note > that this is recommended. > > [1] > https://www.gnu.org/software/autoconf/manual/autoc

Re: [PATCH 2/6] loader/i386/bsd: Initialize ptr variable in grub_bsd_add_meta()

2022-03-24 Thread Daniel Kiper
On Fri, Mar 18, 2022 at 02:21:23PM -0500, Glenn Washburn wrote: > On Fri, 18 Mar 2022 08:57:27 +0100 > Paul Menzel wrote: > > > Dear Daniel, > > > > > > Am 11.03.22 um 00:35 schrieb Daniel Kiper: > > > Latest GCC may complain in that way: > > > > Just for the record, what is the latest GCC for you

Re: [PATCH 04/19] mm: assert that we preserve header vs region alignment

2022-03-24 Thread Daniel Kiper
On Wed, Mar 23, 2022 at 04:47:51PM +1100, Daniel Axtens wrote: > > s/struct grub_mm_region/grub_mm_region_t/ > > s/struct grub_mm_header/grub_mm_header_t/ > > The problem is that grub_mm_{region,header}_t is a pointer type, not a > struct type. So sizeof (grub_mm_region_t) == sizeof(void *). You al

Re: [PATCH v5 0/3] search: new --efidisk-only option on EFI systems

2022-03-24 Thread Daniel Kiper
On Mon, Mar 07, 2022 at 11:06:17AM +0100, Renaud Métrich wrote: > When using 'search' on EFI systems, we sometimes want to exclude devices > that are not EFI disks (e.g. md, lvm). > This is typically used when wanting to chainload when having a software > raid (md) for EFI partition: > with no opti

Re: [PATCH] util/grub.d/10_linux: Improve initramfs detection

2022-03-24 Thread Daniel Kiper
On Wed, Mar 16, 2022 at 11:21:51PM -0500, Oskari Pirhonen wrote: > Prefer using a *.old initramfs for *.old kernels if it exists. Otherwise > look for an initramfs without the suffix. > > Also add detection for initramfs of the form *.img.old. For example, > Gentoo's sys-kernel/genkernel installs i

[PATCH] misc: Make grub_min() and grub_max() more resilient.

2022-03-24 Thread Peter Jones
grub_min(a,b) and grub_max(a,b) use a relatively naive implementation which leads to several problems: - they evaluate their parameters more than once - the naive way to address this, to declare temporary variables in a statement-expression, isn't resilient against nested uses, because MIN(a,MI

Re: [PATCH] misc: Make grub_min() and grub_max() more resilient.

2022-03-24 Thread Robbie Harwood
Peter Jones writes: > grub_min(a,b) and grub_max(a,b) use a relatively naive implementation > which leads to several problems: > - they evaluate their parameters more than once > - the naive way to address this, to declare temporary variables in a > statement-expression, isn't resilient against

[PATCH] configure: Fix default -O2 being added when CFLAGS not set

2022-03-24 Thread Glenn Washburn
Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS was defaulted to "" early in configure to prevent this. Apparently something changed in autoconf and now AC_USE_SYSTEM_EXTENSIONS, which is before the default setting of CFLAGS, will pull in this check. Move the default set

[PATCH] gnulib: Handle aborts in gnulib more gracefully

2022-03-24 Thread Glenn Washburn
Gnulib does not define abort(), but expects it to be defined, usually by a libc implementation. However, GRUB has no libc and does not have an abort() function. Until recently GRUB had patched out abort() in gnulib, effectively making it a noop. This changed with a recent update of the version of g

Re: [PATCH 11/19] efi: mm: Extract function to add memory regions

2022-03-24 Thread Daniel Axtens
>>/* Prepare a memory region to store two memory maps. */ >>memory_map = grub_efi_allocate_any_pages (2 * BYTES_TO_PAGES >> (MEMORY_MAP_SIZE)); >>if (! memory_map) >> -grub_fatal ("cannot allocate memory"); >> +return grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate memory

Re: [PATCH] configure: Fix default -O2 being added when CFLAGS not set

2022-03-24 Thread Paul Menzel
Dear Glenn, Thank you for your tireless awesome work on GRUB. Am 24.03.22 um 23:31 schrieb Glenn Washburn: Autoconf will set a default CFLAGS of "-g -O2" if CFLAGS is not set. CFLAGS was defaulted to "" early in configure to prevent this. Apparently something changed in autoconf and now AC_USE