this patch allow sys-boot/grub-2.02_beta2-r2 to compile and run under gentoo over musl Reproducible: Always
Created attachment 389420 [details, diff] patch
Could you please send a patch upstream? This is not a Gentoo-specific issue. https://lists.gnu.org/mailman/listinfo/grub-devel
Also, this patch is incomplete; the same condition is used at the top of the file to conditionally include linux/unistd.h.
(In reply to Mike Gilbert from comment #2) > Could you please send a patch upstream? This is not a Gentoo-specific issue. > > https://lists.gnu.org/mailman/listinfo/grub-devel I don't think they will accept this as there is no way to know one is compiling grub under musl (no __MUSL_LIBC__ like define) (In reply to Mike Gilbert from comment #3) > Also, this patch is incomplete; the same condition is used at the top of the > file to conditionally include linux/unistd.h. seems that it compiles well without the upper part, if I disable it, I might hit undefine code bits.
(In reply to DaggyStyle from comment #4) > (In reply to Mike Gilbert from comment #2) > > Could you please send a patch upstream? This is not a Gentoo-specific issue. > > > > https://lists.gnu.org/mailman/listinfo/grub-devel > > I don't think they will accept this as there is no way to know one is > compiling grub under musl (no __MUSL_LIBC__ like define) I'm not going to carry a patch for this that will never land upstream. Especially if you never make the attempt.
(In reply to DaggyStyle from comment #4) > (In reply to Mike Gilbert from comment #3) > > Also, this patch is incomplete; the same condition is used at the top of the > > file to conditionally include linux/unistd.h. > > seems that it compiles well without the upper part, if I disable it, I might > hit undefine code bits. Please test this.
Compiles also fine with the include removed. In fact, <linux/unistd.h> does not have _llseek as the comment claims. If grub does not support glibc <2.1 anymore, all that code could be removed. Otherwise at least the !defined(__GLIBC__) should be removed.
Right. My suggestion would be to drop both #ifdefs; LFS has been around for a long time.
it's got a configure script, so it could probe for functionality instead of sticking glibc-specific defines in like that or just make LFS a hard requirement per POSIX
(In reply to Mike Gilbert from comment #8) > Right. My suggestion would be to drop both #ifdefs; LFS has been around for > a long time. you mean that is we drop the #ifdefs, it should compile on glibc without any problems?
(In reply to DaggyStyle from comment #10) > you mean that is we drop the #ifdefs, it should compile on glibc without any > problems? Yes, on any reasonably recent glibc it should work fine.
Created attachment 390024 [details, diff] patch there, removed the lines and tested it. I'm posting it up to upstream.
(In reply to DaggyStyle from comment #12) Thanks!
Created attachment 393604 [details, diff] patch against hardened musl branch
Fixed upstream as of: http://git.savannah.gnu.org/cgit/grub.git/commit/?id=3bac4caa2bc64db313aaee54fffb90383e118517
Thanks. I'll backport it.
+*grub-2.02_beta2-r7 (01 Feb 2015) + + 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.