LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch
User Name
Password
Linux From Scratch This Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.

Notices


Reply
  Search this Thread
Old 03-17-2015, 09:16 AM   #1
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Rep: Reputation: 38
Using gold as the default linker


Hi,
Has anyone here had success with using ld.gold? If yes, it'd be great if I could get a few pointers:

1. I primarily use the CLFS book to set-up an x86_64-64 build. Would I need to add gold support in the temporary toolchain as well? In chapter 10.18 of the book, I configured binutils with "--enable-gold" and it compiled fine. I linked /usr/bin/ld to ld.gold and proceeded to compile gcc. But I get this error:
Code:
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../../../x86_64-unknown-linux-gnu/bin/ld: /tmp/ccWICiMC.ltrans0.ltrans.o: relocation R_X86_64_PC32 against undefined symbol `__do_global_dtors_aux' can not be used when making a shared object; recompile with -fPIC
/tools/lib/gcc/x86_64-unknown-linux-gnu/4.8.4/../../../../x86_64-unknown-linux-gnu/bin/ld: final link failed: Bad value
So, at this stage, is the ld from the temp toolchain being used or the one in /usr/bin? If the former is true, then linking to gold was futile, and gold support should have been added earlier?

2. Is it alright to use the LFS book instead of CLFS, for x86_64-64, when both host and target arch are the same? I ask this because I had been advised to use the CLFS book for 64-bit, supposedly because it produced a more stable build.

Thanks in advance.
 
Old 03-17-2015, 01:11 PM   #2
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
tuxbg recompiles his slackware and uses ld gold.
There is some stuff you find find in this topic:
http://www.linuxquestions.org/questi...648/page3.html

Before trying LFS, I recbuild archlinux, slackware and created hybrids of slackware, 0linux, ...
 
Old 03-17-2015, 02:23 PM   #3
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Hmmm...That looked to me like the stock slackbuild for binutils, only with the default linker switched to gold. My question, though, was whether I need to compile the temporary toolchain with support for gold as well. In the error code I cited above, the linker failed with a suggestion to compile with PIC, despite not having enabled -pie -fPIE or even partial relro.
 
Old 03-17-2015, 02:26 PM   #4
hendrickxm
Member
 
Registered: Feb 2014
Posts: 344

Rep: Reputation: Disabled
Quote:
Originally Posted by corbis_demon View Post
Hmmm...That looked to me like the stock slackbuild for binutils, only with the default linker switched to gold. My question, though, was whether I need to compile the temporary toolchain with support for gold as well. In the error code I cited above, the linker failed with a suggestion to compile with PIC, despite not having enabled -pie -fPIE or even partial relro.
I have no experience myself but I do not think your temporary toolchain needs support for gold.
 
Old 03-17-2015, 02:38 PM   #5
corbis_demon
Member
 
Registered: Jun 2004
Distribution: CLFS
Posts: 523

Original Poster
Rep: Reputation: 38
Ok, thank you for your input. I'll start an experimental setup over the weekend, first building a CLFS system with support for gold, and then building an LFS system with the CLFS build as the host. Will try out different things, especially some toolchain hardening with Gentoo's patches and see how that works out. I'll keep this post open until after a successful build. Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Your Computer Junk is gold is Gold to Reglue LXer Syndicated Linux News 0 08-01-2013 09:20 AM
-libnetlink and c linker alaios Programming 2 06-19-2013 07:30 PM
[SOLVED] cryptic linker error (i really dont like linker errors); smeezekitty Programming 2 09-19-2009 02:21 AM
LXer: Sacred Gold is now, well, gold! LXer Syndicated Linux News 0 03-08-2009 04:20 PM
Wireless - Linksys No gold Orinoco Gold YES 1kyle SUSE / openSUSE 0 02-07-2007 12:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Linux From Scratch

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration