Created attachment 387152 [details] build.log Sys-boot/grub-0.97-r14 does not compile on amd64: checking for i686-pc-linux-gnu-gcc... x86_64-pc-linux-gnu-gcc -m32 checking for i686-pc-linux-gnu-gcc... (cached) x86_64-pc-linux-gnu-gcc -m32 checking whether the C compiler works... no configure: error: in `/var/tmp/portage/sys-boot/grub-0.97-r14/work/grub-0.97': configure: error: C compiler cannot create executables
Created attachment 387154 [details] config.log
Created attachment 387156 [details] emerge --info
Confirmed with GCC 4.8.3.
(In reply to Jeroen Roovers from comment #3) > Confirmed with GCC 4.8.3. is this only on i686? also does it work with gcc 4.7?
The -fuse-ld option was added in gcc-4.8. It generates an error with gcc-4.7.
Also, have a look at sys-boot/grub:2 for a more compatible solution. Snippets below. pkg_pretend() { if [[ ${MERGE_TYPE} != binary ]]; then # Bug 439082 if ! version_is_at_least 4.8 "$(gcc-version)" && $(tc-getLD) --version | grep -q "GNU gold"; then eerror "GRUB does not function correctly when built with the gold linker." eerror "Please select the bfd linker with binutils-config." die "GNU gold detected" fi fi } src_configure() { ... if version_is_at_least 4.8 "$(gcc-version)"; then export TARGET_LDFLAGS+=" -fuse-ld=bfd" fi ... }
Apologies -- next time I try and fix a system package I will do a lot more testing (including more than one toolchain version) before committing. @@ -4,0 +5,4 @@ + 22 Oct 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org> grub-0.97-r14.ebuild: + grub:0 - Only apply -fuse-ld=bfd when gcc is new enough to support it, bug + 526348 +
you shouldn't test gcc versions. this is why we have test-flags-CC. append-ldflags $(test-flags-CC -fuse-ld=bfd)
+ 22 Oct 2014; Mike Gilbert <floppym@gentoo.org> grub-2.02_beta2-r2.ebuild, + grub-9999-r1.ebuild: + Use test-flags-CC instead of gcc-version check, thanks to vapier.
+ 22 Oct 2014; Ian Stakenvicius (_AxS_) <axs@gentoo.org> + -files/grub-0.97-force-ld.bfd.patch, grub-0.97-r14.ebuild: + grub:0 - undid the ugly patch-based hacks for forcing ld.bfd, thanks to vapier + and floppym
Commit message: Use new toolchain helpers for selecting the bfd linker http://sources.gentoo.org/sys-boot/grub/grub-0.97-r14.ebuild?r1=1.6&r2=1.7 http://sources.gentoo.org/sys-boot/grub/grub-2.00_p5107-r2.ebuild?r1=1.9&r2=1.10 http://sources.gentoo.org/sys-boot/grub/grub-2.02_beta2-r3.ebuild?r1=1.5&r2=1.6 http://sources.gentoo.org/sys-boot/grub/grub-2.02_beta2-r6.ebuild?r1=1.3&r2=1.4 http://sources.gentoo.org/sys-boot/grub/grub-2.02_beta2-r7.ebuild?r1=1.6&r2=1.7 http://sources.gentoo.org/sys-boot/grub/grub-9999-r1.ebuild?r1=1.29&r2=1.30