Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 668462

Summary: sys-devel/gcc add DEFAULT_LINKER="gold bfd" use flags
Product: Gentoo Linux Reporter: C. Wijtmans <cj.wijtmans>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED NEEDINFO    
Severity: enhancement CC: jstein, slyfox
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=496760
Whiteboard:
Package list:
Runtime testing required: ---

Description C. Wijtmans 2018-10-12 13:24:07 UTC
add these use flags so its easy to switch linker. 
also enable gold by default on linux profiles.
Comment 1 Sergei Trofimovich (RETIRED) gentoo-dev 2018-10-13 15:19:49 UTC
1. There are already a few ways to switch linker:
- 'binutils-config --linker ld.gold' on binutils level.
- CFLAGS/CXXFLAGS=-fuse-ld=gold

2. What is DEFAULT_LINKER="gold bfd"? Something you pass to configure?

   In gcc/doc/install.texi only see --with-ld= option. It accepts single linker name, not a list of linkers. And assignd is to DEFAULT_LINKR variable in gcc/configure.ac.

   You can pass EXTRA_ECONF=--with-ld=${CTARGET}-ld.gold to get the similar effect.

Why another mechanism is needed?

Enabling gold by default will need extensive testing. But we can think of it if new mechanism is needed at all.
Comment 2 C. Wijtmans 2019-01-27 16:05:20 UTC
Had 0 issues with gold. It creates smaller binaries and makes compiling faster. It should be a use flag that is enabled by default in profile.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2019-01-27 17:34:39 UTC
Please answer questions in #comment1.