From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f65.google.com ([209.85.128.65]:54504 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728366AbfGPUAD (ORCPT ); Tue, 16 Jul 2019 16:00:03 -0400 Date: Tue, 16 Jul 2019 12:59:57 -0700 From: Nathan Chancellor Subject: Re: [PATCH v2] kbuild: Fail if gold linker is detected Message-ID: <20190716195957.GA38495@archlinux-threadripper> References: <20190716170606.GA38406@archlinux-threadripper> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Thomas Gleixner Cc: LKML , Linus Torvalds , x86@kernel.org, "H.J. Lu" , Masahiro Yamada , linux-kbuild@vger.kernel.org, "Theodore Y. Ts'o" , Mike Lothian On Tue, Jul 16, 2019 at 09:47:27PM +0200, Thomas Gleixner wrote: > 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 Based on the crude little testing script I wrote below: Reviewed-by: Nathan Chancellor Tested-by: Nathan Chancellor $ cat test.sh #!/bin/bash # ld.bfd (expected to pass) make distclean defconfig || exit ${?} # ld.gold explicitly (expected to fail) make LD=ld.gold distclean defconfig && exit ${?} # ld.gold as if it were the system linker (expected to fail) ln -fs /usr/bin/ld.gold ld PATH=${PWD}:${PATH} make distclean defconfig && exit ${?} # ld.lld (expected to pass) make LD=ld.lld distclean defconfig || exit ${?}