Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 466536 - sys-boot/grub-0.97-r13: build fails when using gold
Summary: sys-boot/grub-0.97-r13: build fails when using gold
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-gold
  Show dependency tree
 
Reported: 2013-04-20 07:39 UTC by Franz Trischberger
Modified: 2015-03-16 21:39 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (1366442844-install-sys-boot_grub-0.97-r13:0::gentoo.out,106.36 KB, text/plain)
2013-04-20 07:39 UTC, Franz Trischberger
Details
Force ld.bfd via --fuse-ld CFLAG (grub-2.00-r3-gold-workaround.patch,899 bytes, patch)
2013-07-13 15:50 UTC, Cosmin Giradu
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Franz Trischberger 2013-04-20 07:39:28 UTC
Created attachment 346066 [details]
build.log

0.97 fails (tried r10-r13) to build with ld.gold.

x86_64-pc-linux-gnu-gcc -m32 -Os -fno-stack-protector -fno-strict-aliasing -march=i686 -fno-reorder-functions -fno-builtin -nostdinc  -DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DSUPPORT_GRAPHICS=1 -DNO_DECOMPRESSION=1 -DSTAGE1_5=1 -DFSYS_EXT2FS=1 -DNO_BLOCK_FILES=1 -g -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000 -Wl,-O1 -Wl,--as-needed -Wl,--build-id=none -o e2fs_stage1_5.exec e2fs_stage1_5_exec-start.o e2fs_stage1_5_exec-asm.o e2fs_stage1_5_exec-common.o e2fs_stage1_5_exec-char_io.o e2fs_stage1_5_exec-disk_io.o e2fs_stage1_5_exec-stage1_5.o e2fs_stage1_5_exec-fsys_ext2fs.o e2fs_stage1_5_exec-bios.o  
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: fatal error: -Ttext: invalid option value (expected an integer): 7C00
collect2: ld returned 1 exit status
make[3]: *** [start_eltorito.exec] Error 1
Comment 1 Cosmin Giradu 2013-07-13 15:50:05 UTC
Created attachment 353222 [details, diff]
Force ld.bfd via --fuse-ld CFLAG

Would it make more sense to « append-cflags "-fuse-ld=bfd" », instead of complaining about gold usage, until the bug is resolved upstream?
Comment 2 Cosmin Giradu 2013-07-15 06:37:44 UTC
Comment on attachment 353222 [details, diff]
Force ld.bfd via --fuse-ld CFLAG

Whoops! Added the patch on the wrong BUG (the patch is for - as stated by the name - grub-2
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2014-10-20 15:53:10 UTC
So the bug actually has two parts.  Firstly, ld.gold seems to assume that -Wl,-Ttext arguments are integers, instead of hex.  Looks like this can be fixed by prepending '0x' but i'll confirm after I test.

Secondly, there's actually a check in ./configure to see if the linker can link using these -Ttext addresses , but for whatever reason that check is always cached and so it never fails.  I've got a patch that will un-cache this check, so at least it fails at configure time in a more-obvious fashion.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2014-10-20 17:23:01 UTC
OK. So, grub:0 fails to work when being linked with ld.gold, looks like forcing ld.bfd is the best option.

Somehow i missed that we are forcing the 'cached' value of yes for the link test in our ebuild, so there's no need for that patch, either.

"Fixed" in grub-0.97-r14