Created attachment 399298 [details, diff] fix compilation against musl there are two issues preventing the stable grub from compiling against musl. thankfully, the first (relating to a funky ifdef block for if-linux-but-not-glibc that i can only assume works for uclibc and nothing else) is already solved in the unstable marked ebuild, so i used that as a base. the second issue is that musl doesn't provide an error.h header. a patch is included against the hardened-dev musl branch. my previous bugs submitted for pciutils, efivar, and efibootmgr are required for using grub in an efi environment. i've tested building with only the pc and efi-32 targets.
my fix for a missing error.h here is a bit... icky. i add a check for the header to configure.ac and if not found, do an ugly define. you might want to do code review on this, but it works and that's currently good enough for me. ;)
In the git repo, the error.h include has just been removed: http://git.savannah.gnu.org/cgit/grub.git/commit/grub-core/kern/emu/misc.c?id=989af025829b20a19f4d3ee01e86f4ee9de7cf1e It is not possible to do the same with the version you are using? I'll send a patch for kern/emu/hostdisk.c upstream. (Some time ago I've sent a similar patch for osdep/unix/hostdisk.c.)
Actually the code from kern/emu/hostdisk.c had moved to osdep/unix/hostdisk.c. So for grub-9999 none of these patches should be necessary.
I could backport 989af025829b20a19f4d3ee01e86f4ee9de7cf1e to replace grub-2.02-musl-no-error.h.patch. It seems like you based grub-2.00_musl.patch on some much older version of grub, and that patch is now unnecessary. I already backported Felix's version of the same patch.
(In reply to Mike Gilbert from comment #4) > I could backport 989af025829b20a19f4d3ee01e86f4ee9de7cf1e to replace > grub-2.02-musl-no-error.h.patch. > > It seems like you based grub-2.00_musl.patch on some much older version of > grub, and that patch is now unnecessary. I already backported Felix's > version of the same patch. Mike, what version of grub has the fix?
The ChangeLog says grub-2.02_beta2-r7 has a (partial?) fix. 01 Feb 2015; Mike Gilbert <floppym@gentoo.org> +grub-2.02_beta2-r7.ebuild: Add patches for XFS v5 superblocks, bug 525682. Fix build on musl, bug 529356. I don't believe I ever backported 989af025829b20a19f4d3ee01e86f4ee9de7cf1e. I can do that shortly.
has the backport been done?
+ 06 Aug 2015; Mike Gilbert <floppym@gentoo.org> grub-2.02_beta2-r7.ebuild: + Backport another build fix for musl, bug 543840.