linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: LKML <linux-kernel@vger.kernel.org>
Cc: 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: kbuild: Fail if gold linker is detected
Date: Tue, 16 Jul 2019 14:47:56 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1907161434260.1767@nanos.tec.linutronix.de> (raw)

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)
+
 # gcc version including patch level
 gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))

             reply	other threads:[~2019-07-16 12:48 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-16 12:47 Thomas Gleixner [this message]
2019-07-16 12:54 ` kbuild: Fail if gold linker is detected 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
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.1907161434260.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=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).