Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dynamically changing the linker [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1599

PostPosted: Thu May 07, 2020 11:19 am    Post subject: dynamically changing the linker [solved] Reply with quote

I will stick this in "Kernel and Hardware" as that represents the first place I encountered the problem. :)

Recently upgrade binutils, and noticed the default-gold USE flag. After a bit of reading about the gold linker, I decided to enable it (please let me know if anyone considers that a questionable decision or an "absolutely don't go there" decision. I did miss the fact that the kernel doesn't support the gold linker (oops).

Trying to update (just) the kernel configuration (for now), when I first discovered that I might have an issue. :)

Code:

# make menuconfig
  UPD     scripts/kconfig/mconf-cfg
  HOSTCC  scripts/kconfig/mconf.o
  HOSTCC  scripts/kconfig/lxdialog/checklist.o
  HOSTCC  scripts/kconfig/lxdialog/inputbox.o
  HOSTCC  scripts/kconfig/lxdialog/menubox.o
  HOSTCC  scripts/kconfig/lxdialog/textbox.o
  HOSTCC  scripts/kconfig/lxdialog/util.o
  HOSTCC  scripts/kconfig/lxdialog/yesno.o
  HOSTLD  scripts/kconfig/mconf
scripts/kconfig/mconf  Kconfig
scripts/Kconfig.include:39:  gold linker 'ld' not supported
make[1]: *** [scripts/kconfig/Makefile:33: menuconfig] Error 1
make: *** [Makefile:567: menuconfig] Error 2


That didn't seem so bad (at first), as surely some way has to exist to temporarily switch back and forth between the linkers. I did some searching and found:

https://forums.gentoo.org/viewtopic-t-1088356-start-0.html

Cuong Nguyen wrote:

Code:

binutils-config --linker ld.bfd



That did not work:

Code:

# binutils-config --linker ld.bfd
 * binutils-config: invalid switch!  Try '--help'.


I thought I would just type "LD=ld.bfd make menuconfig" but that gave the same error message as before. Surely some way exists to change the linker. Can someone enlighten me? Thank you in advance.


Last edited by curmudgeon on Thu May 07, 2020 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message
Ionen
l33t
l33t


Joined: 06 Dec 2018
Posts: 782

PostPosted: Thu May 07, 2020 11:53 am    Post subject: Reply with quote

Use make LD=ld.bfd ... for kernel.

Edit: and about gold, Google is no longer pushing that linker (kinda abandoned albeit still maintained by binutils) and it doesn't see all that much widespread testing unlike bfd which can lead to potential issues (gentoo does force-disable gold in a few ebuilds already). It might be nice when testing large projects that you want to be linked faster (or not.. not sure how's the performance difference nowadays) or actually using some gold-specific features, but system-wide I don't see much reasons.


Last edited by Ionen on Thu May 07, 2020 12:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
fedeliallalinea
Bodhisattva
Bodhisattva


Joined: 08 Mar 2003
Posts: 24193
Location: here

PostPosted: Thu May 07, 2020 12:01 pm    Post subject: Reply with quote

I think correct command is make LD=ld.bfd menuconfig

EDIT: Ionen has already answered
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
curmudgeon
Veteran
Veteran


Joined: 08 Aug 2003
Posts: 1599

PostPosted: Thu May 07, 2020 12:42 pm    Post subject: Reply with quote

Yes, that worked. Thank you both.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum