Glenn Washburn <developm...@efficientek.com> writes: > 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 gnulib > GRUB uses to be a compiler defined trap. While this is fine for user space > code where the kernel can be expected to cleanup after a process when this > happens, the firmware may not be good at doing this. > > GRUB does have a grub_abort(), with the same function signature that can be > used instead. So instead define gnulib's abort() implementation to be > grub_abort(). This provides consistency of behavior regardless of whether > the abort happens in gnulib code or in GRUB code. > > Because we want to avoid patching gnulib again and gnulib expects that > abort(), now grub_abort(), is defined externally, we must provide a > prototype in the config.h. This is complicated by the fact that config.h > is included in many GRUB compilation units as well as grub/misc.h which > already declares grub_abort(). A macro, GNULIB, is provided only to > compilation units using gnulib code, so that the grub_abort() prototype > is only included in those compilation units where it is lacking.
This approach is nice. > Also, export grub_abort() so that it can now be used within modules. > > Signed-off-by: Glenn Washburn <developm...@efficientek.com> Reviewed-by: Robbie Harwood <rharw...@redhat.com> Be well, --Robbie
signature.asc
Description: PGP signature
_______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel