Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1304222ybi; Tue, 16 Jul 2019 12:49:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/PXEXacWPWUPtRLbYn4n9sO6YlB+yAl9nUA3qftXkR08JiQ8O5/miWR5k5LOcP5F3KGAA X-Received: by 2002:a17:90a:2567:: with SMTP id j94mr39106127pje.121.1563306573598; Tue, 16 Jul 2019 12:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563306573; cv=none; d=google.com; s=arc-20160816; b=0KqDiv41w0ZxdmsvvpR1umVyXx1DwsKYhz+vB0idawmRRvvwgZY5N/mXbq2i6obkcH +WcyoaISQ8/C14e8euxJLR2DJq75+nr0QiY7uwwtBUKbo0+XzsI7s0jSH3HkOpvRJ0Ku Q21fSyzjqhycrRoxvNwvc8HaripE9ndC6CEC3IDoODYuHG9Xae4dds0aMporExP1n4Ho VUods8k6UmXq5yEeW+bRKCJhIhT7wgFoqvjS75umum+dTE77oVKbPmgp7/8G3M4dvAH2 mNSx4Wp9xO+Ln13MIpUe5pJS9lBxuaIUU2SgAdWhUhbq8vSmoAChJGgHJlsEXTw0Y/6I nj9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=hNHjCLzBdP6laieuY5RUnGOK7xz6UWsWLmfkLRchzd0=; b=fpO1bICMC9M2je0EW2xi3fx6I9w9ER1Tt+J3A3lTs223lDK/fuIHiyYAVb29l7nZAF sijJc6hswU+xkPV1BAH8JGHOXYCaMbtOjc4ZcmGZ8kKW9U7RGLOIXTKIMWlEW4ZZrKBU L/4baSHwQkMvavlJsrBAusNnmPZgbBVtDdg1pdBFvpEo7Yd9hQrW34fTzsU5JBnyukKE 7EhQGrgRWhO5SjCmJKHtcY4oqSe9yBDgst4T5O2ZHgfdBUjLNp8NmVvmPQlHSuVhAeDb U1Pjw7tWks0onXnnhWIkc2SitCNjlRYsCDFugaSE+BaGJjmc6PDmU/J6NTOlJp2jDbKj bXQg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si19098796plt.355.2019.07.16.12.49.17; Tue, 16 Jul 2019 12:49:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728781AbfGPTrf (ORCPT + 99 others); Tue, 16 Jul 2019 15:47:35 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:51032 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726213AbfGPTre (ORCPT ); Tue, 16 Jul 2019 15:47:34 -0400 Received: from pd9ef1cb8.dip0.t-ipconnect.de ([217.239.28.184] helo=nanos) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1hnTQ8-0001mu-Qj; Tue, 16 Jul 2019 21:47:28 +0200 Date: Tue, 16 Jul 2019 21:47:27 +0200 (CEST) From: Thomas Gleixner To: Nathan Chancellor cc: LKML , Linus Torvalds , x86@kernel.org, "H.J. Lu" , Masahiro Yamada , linux-kbuild@vger.kernel.org, "Theodore Y. Ts'o" , Mike Lothian Subject: [PATCH v2] kbuild: Fail if gold linker is detected In-Reply-To: Message-ID: References: <20190716170606.GA38406@archlinux-threadripper> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The gold linker has known issues of failing the build both in random and in predictible ways: - The x86/X32 VDSO build fails with: arch/x86/entry/vdso/vclock_gettime-x32.o:vclock_gettime.c:function do_hres: error: relocation overflow: reference to 'hvclock_page' That's a known issue for years and the usual workaround is to disable CONFIG_X86_32 - A recent build failure is caused by turning a relocation into an absolute one for unknown reasons. See link below. - There are a couple of gold workarounds applied already, but reports about broken builds with ld.gold keep coming in on a regular base and in most cases the root cause is unclear. In context of the most recent fail 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 and without support from the gold folks, fail the build when gold is detected. Signed-off-by: Thomas Gleixner Acked-by: Peter Zijlstra (Intel) Link: https://lore.kernel.org/r/CAMe9rOqMqkQ0LNpm25yE_Yt0FKp05WmHOrwc0aRDb53miFKM+w@mail.gmail.com --- V2: Better changelog Use the proper check as pointed out by Nathan --- 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, $(LD) -v | grep -q gold), gold linker '$(LD)' not supported) + # gcc version including patch level gcc-version := $(shell,$(srctree)/scripts/gcc-version.sh $(CC))