[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200423171807.29713-4-natechancellor@gmail.com>
Date: Thu, 23 Apr 2020 10:18:07 -0700
From: Nathan Chancellor <natechancellor@...il.com>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
Masahiro Yamada <masahiroy@...nel.org>
Cc: linux-mips@...r.kernel.org, linux-kernel@...r.kernel.org,
clang-built-linux@...glegroups.com, linux-kbuild@...r.kernel.org,
Nick Desaulniers <ndesaulniers@...gle.com>,
Sami Tolvanen <samitolvanen@...gle.com>,
Dmitry Golovin <dima@...ovin.in>,
Sedat Dilek <sedat.dilek@...il.com>,
Nathan Chancellor <natechancellor@...il.com>
Subject: [PATCH v3 4/4] MIPS: VDSO: Allow ld.lld to link the VDSO
Currently, when linking with ld.lld, this warning pops up:
arch/mips/vdso/Makefile:70: MIPS VDSO requires binutils >= 2.25
CONFIG_LD_VERSION is set with scripts/ld-version.sh, which is specific
to GNU ld. It returns 0 for ld.lld so CONFIG_MIPS_LD_CAN_LINK_VDSO does
not set.
ld.lld has a completely different versioning scheme (as it follows
LLVM's versioning) and it does not have the issue mentioned in the
comment block so it should be allowed to link the VDSO.
With this patch, the VDSO successfully links and shows P_MIPS_PC32 in
vgettimeofday.o.
$ llvm-objdump -Dr arch/mips/vdso/vgettimeofday.o | grep R_MIPS_PC32
00000024: R_MIPS_PC32 _start
000000b0: R_MIPS_PC32 _start
000002bc: R_MIPS_PC32 _start
0000036c: R_MIPS_PC32 _start
00000468: R_MIPS_PC32 _start
Reported-by: Dmitry Golovin <dima@...ovin.in>
Signed-off-by: Nathan Chancellor <natechancellor@...il.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/785
Link: https://github.com/llvm/llvm-project/commit/e364e2e9ce50c12eb2bf093560e1a1a8544d455a
---
v2 -> v3:
* No changes.
v1 -> v2:
* Move into Kconfig so that the warning does not happen.
arch/mips/vdso/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/vdso/Kconfig b/arch/mips/vdso/Kconfig
index 36a52158d849b..7aec721398d59 100644
--- a/arch/mips/vdso/Kconfig
+++ b/arch/mips/vdso/Kconfig
@@ -12,7 +12,7 @@
# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
config MIPS_LD_CAN_LINK_VDSO
- def_bool LD_VERSION >= 225000000
+ def_bool LD_VERSION >= 225000000 || LD_IS_LLD
config MIPS_DISABLE_VDSO
def_bool CPU_MICROMIPS || (!CPU_MIPSR6 && !MIPS_LD_CAN_LINK_VDSO)
--
2.26.2
Powered by blists - more mailing lists