Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 736264 - sys-kernel/gentoo-sources: Patch Makefile to use bfd linker?
Summary: sys-kernel/gentoo-sources: Patch Makefile to use bfd linker?
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Linux bug wranglers
URL: https://lkml.org/lkml/2019/7/16/635
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-07 13:13 UTC by Klaus Kusche
Modified: 2020-08-07 17:50 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Klaus Kusche 2020-08-07 13:13:06 UTC
As gentoo supports the gold linker as the default system linker,
but linux kernels refuse to be built with the gold linker,
could you please add a patch to gentoo sources which allows the kernel 
to be build even on systems where the gold linker is default?

I use the following:
In the kernel's main Makefile, around line 430, replace
LD              = $(CROSS_COMPILE)ld
with
LD              = $(CROSS_COMPILE)ld.bfd

I don't know if there are better ways...
Comment 1 Mike Pagano gentoo-dev 2020-08-07 15:41:56 UTC
The Gold linker has historically caused problem in the kernel.
Because of that fact, upstream stopped supporting it.

If our users start using the gold linker, then those problem become ours.

As such, we will follow upstream's lead and not support building with the gold linker in genpatches.
Comment 2 Klaus Kusche 2020-08-07 16:13:15 UTC
(In reply to Mike Pagano from comment #1)
> As such, we will follow upstream's lead and not support building with the
> gold linker in genpatches.

That's exactly what I wanted and what my patch does:
Make sure that the kernel is *always* built with the bfd linker,
even if the gold linker (or the llvm linker) is the system-wide default
(i.e. even if ld points to gold or lld).

I never wanted to build my kernel with the gold linker.

I just wanted to avoid manually editing the Makefile
every time after installing new gentoo sources
to make sure the kernel uses the bfd linker.
Comment 3 Mike Pagano gentoo-dev 2020-08-07 17:31:02 UTC
But llvm linker is supported.
But you want it not supported for everyone else ?
Comment 4 dwfreed 2020-08-07 17:50:48 UTC
This should work for you:

make LD=ld.bfd