]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: vdso32: Allow ld.lld to properly link the VDSO
authorNathan Chancellor <natechancellor@gmail.com>
Tue, 20 Oct 2020 01:14:07 +0000 (18:14 -0700)
committerWill Deacon <will@kernel.org>
Mon, 26 Oct 2020 13:17:41 +0000 (13:17 +0000)
commit0ce0341400c861ccf01bdfea71600653b0650297
tree199eec2b40d37fc9d2eb1e93e9f52fcc02eb1fa9
parenta1fe7c755400af92f0070a66f48f00b659aeacac
arm64: vdso32: Allow ld.lld to properly link the VDSO

As it stands now, the vdso32 Makefile hardcodes the linker to ld.bfd
using -fuse-ld=bfd with $(CC). This was taken from the arm vDSO
Makefile, as the comment notes, done in commit 0af99124b1da ("ARM:
8384/1: VDSO: force use of BFD linker").

Commit 30d27ffb6e0b ("ARM: 8858/1: vdso: use $(LD) instead of $(CC) to
link VDSO") changed that Makefile to use $(LD) directly instead of
through $(CC), which matches how the rest of the kernel operates. Since
then, LD=ld.lld means that the arm vDSO will be linked with ld.lld,
which has shown no problems so far.

Allow ld.lld to link this vDSO as we do the regular arm vDSO. To do
this, we need to do a few things:

* Add a LD_COMPAT variable, which defaults to $(CROSS_COMPILE_COMPAT)ld
  with gcc and $(LD) if LLVM is 1, which will be ld.lld, or
  $(CROSS_COMPILE_COMPAT)ld if not, which matches the logic of the main
  Makefile. It is overrideable for further customization and avoiding
  breakage.

* Eliminate cc32-ldoption, which matches commit 56b84bf93899 ("kbuild:
  drop support for cc-ldoption").

With those, we can use $(LD_COMPAT) in cmd_ldvdso and change the flags
from compiler linker flags to linker flags directly. We eliminate
-mfloat-abi=soft because it is not handled by the linker.

Reported-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Link: https://github.com/ClangBuiltLinux/linux/issues/1033
Link: https://lore.kernel.org/r/20201020011406.1818918-1-natechancellor@gmail.com
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/kernel/vdso32/Makefile