linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Nathan Chancellor <natechancellor@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	x86@kernel.org, "H.J. Lu" <hjl.tools@gmail.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	linux-kbuild@vger.kernel.org
Subject: Re: kbuild: Fail if gold linker is detected
Date: Tue, 16 Jul 2019 20:59:45 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1907162059200.1767@nanos.tec.linutronix.de> (raw)
In-Reply-To: <20190716170606.GA38406@archlinux-threadripper>

On Tue, 16 Jul 2019, Nathan Chancellor wrote:
> On Tue, Jul 16, 2019 at 02:47:56PM +0200, Thomas Gleixner wrote:
> > The gold linker has known issues of failing the build in random and
> > predictible ways. H.J. stated:
> > 
> >   "Since building a workable kernel for different kernel configurations
> >    isn't a requirement for gold, I don't recommend gold for kernel."
> > 
> > So instead of dealing with attempts to duct tape gold support without
> > understanding the root cause, fail the build when gold is detected.
> > 
> > Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
> > Link: https://lore.kernel.org/r/CAMe9rOqMqkQ0LNpm25yE_Yt0FKp05WmHOrwc0aRDb53miFKM+w@mail.gmail.com
> > ---
> >  scripts/Kconfig.include |    3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > --- a/scripts/Kconfig.include
> > +++ b/scripts/Kconfig.include
> > @@ -35,5 +35,8 @@ ld-option = $(success,$(LD) -v $(1))
> >  $(error-if,$(failure,command -v $(CC)),compiler '$(CC)' not found)
> >  $(error-if,$(failure,command -v $(LD)),linker '$(LD)' not found)
> >  
> > +# Fail if the linker is gold as it's not capable of linking the kernel proper
> > +$(error-if,$(success, command -v $(LD) -v | grep -q gold), gold linker '$(LD)' not supported)
> 
> Why are there two '-v' flags here? The second one is ignored since
> command -v just prints out the path of the binary that is being used,
> which would work in most cases but not if gold is the default system
> linker.
> 
> $ command -v ld.gold -v
> /usr/bin/ld.gold
> 
> $ command -v ld.gold
> /usr/bin/ld.gold
> 
> $ command ld.gold -v
> GNU gold (GNU Binutils 2.32) 1.16
> 
> Thus, wouldn't it be better to just call $(LD) directly, like
> CC_IS_GCC and CC_IS_CLANG in init/Kconfig?
> 
> $(success, $(LD) -v | grep -q gold)

Right you are. Copy and paste without brain ....

  reply	other threads:[~2019-07-16 18:59 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 12:47 kbuild: Fail if gold linker is detected Thomas Gleixner
2019-07-16 12:54 ` Peter Zijlstra
2019-07-16 14:40 ` Ingo Molnar
2019-07-16 15:59   ` Thomas Gleixner
2019-07-16 18:13     ` Ingo Molnar
2019-07-16 18:46       ` Linus Torvalds
2019-07-16 18:52       ` Theodore Y. Ts'o
2019-07-29 17:06     ` Bernd Petrovitsch
2019-07-16 17:06 ` Nathan Chancellor
2019-07-16 18:59   ` Thomas Gleixner [this message]
2019-07-16 19:47     ` [PATCH v2] " Thomas Gleixner
2019-07-16 19:59       ` Nathan Chancellor
2019-07-16 21:20         ` Mike Lothian
2019-07-16 22:25           ` Thomas Gleixner
2019-07-16 23:37             ` Theodore Y. Ts'o
2019-07-17  6:54       ` Masahiro Yamada
2019-07-17  7:57         ` Thomas Gleixner
2019-07-20  9:12           ` Mike Lothian
2019-07-20  9:34             ` Thomas Gleixner
2019-07-20 10:13               ` Mike Lothian
2019-07-20 10:54                 ` Thomas Gleixner
2019-07-20 10:59                   ` Mike Lothian
2019-07-23  1:30             ` Masahiro Yamada
2019-07-23  6:41               ` Thomas Gleixner
2019-07-23  8:17                 ` Thomas Gleixner
2019-07-29  2:27                   ` Masahiro Yamada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.21.1907162059200.1767@nanos.tec.linutronix.de \
    --to=tglx@linutronix.de \
    --cc=hjl.tools@gmail.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=natechancellor@gmail.com \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).