Help regarding Building x86_64 BSP

Karel Gardas karel at functional.vision
Sun Mar 19 22:18:40 UTC 2023


On 3/8/23 11:08, Frank Kühndel wrote:
> The build failures all happen when `building: 
> grub2-2.06-x86_64-linux-gnu-1` which is the last build step. There are 
> several similar errors. These are two of them taken from the build log:
> 
> cc1: all warnings being treated as errors
> util/mkimage.c: In function ‘grub_install_generate_image’:
> util/mkimage.c:1386:41: error: dangling pointer to ‘tmp_’ may be used 
> [-Werror=d
> angling-pointer=]
>   1386 |         PE_OHDR (o32, o64, header_size) = grub_host_to_target32 
> (header_
> size);
> util/mkimage.c:857:28: note: ‘tmp_’ declared here
>    857 |   __typeof__((o64)->field) tmp_;                \
>        |                            ^~~~
> util/mkimage.c:1386:9: note: in expansion of macro ‘PE_OHDR’
>   1386 |         PE_OHDR (o32, o64, header_size) = grub_host_to_target32 
> (header_
> size);
>        |         ^~~~~~~
> util/mkimage.c:1387:40: error: dangling pointer to ‘tmp_’ may be used 
> [-Werror=d
> angling-pointer=]
>   1387 |         PE_OHDR (o32, o64, entry_addr) = grub_host_to_target32 
> (layout.s
> tart_address);
> util/mkimage.c:857:28: note: ‘tmp_’ declared here
>    857 |   __typeof__((o64)->field) tmp_;                \
>        |                            ^~~~
> util/mkimage.c:1387:9: note: in expansion of macro ‘PE_OHDR’
>   1387 |         PE_OHDR (o32, o64, entry_addr) = grub_host_to_target32 
> (layout.s
> tart_address);
>        |         ^~~~~~~
> 
> Maybe one needs a new version of grub sources for gcc 12?

GRUB 2.06 is the last available release. The release cadence is 2 years 
and next version should be released around this summer. I would not like 
to go to git version in the meantime, but rather stick to released version.

Possible and working (tested on Fedora 37 and Ubuntu 20.04) workaround 
is to use --disable-werror as all the related errors are just warnings.

The patch already sent, testing and reporting from your side would be 
highly appreciated.

Thanks,
Karel



More information about the devel mailing list