linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] MIPS: generic: Support linking with LLVM ld.lld
@ 2021-03-21 13:18 Paul Cercueil
  2021-03-22 12:04 ` Alexander Lobakin
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Cercueil @ 2021-03-21 13:18 UTC (permalink / raw)
  To: Paul Burton, Thomas Bogendoerfer, Nathan Chancellor, Nick Desaulniers
  Cc: od, linux-mips, linux-kernel, clang-built-linux, Paul Cercueil

LLVM's ld.lld chokes on the 64-bit sign-extended load addresses. Use
32-bit addresses if the linker is LLVM's ld.lld.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 arch/mips/generic/Platform | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/mips/generic/Platform b/arch/mips/generic/Platform
index b871af16b5b6..19b7d92a4ca7 100644
--- a/arch/mips/generic/Platform
+++ b/arch/mips/generic/Platform
@@ -12,8 +12,8 @@
 cflags-$(CONFIG_MACH_INGENIC_SOC)	+= -I$(srctree)/arch/mips/include/asm/mach-ingenic
 cflags-$(CONFIG_MIPS_GENERIC)	+= -I$(srctree)/arch/mips/include/asm/mach-generic
 
-load-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff80100000
-zload-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff81000000
+load-$(CONFIG_MIPS_GENERIC)		+= $(if $(CONFIG_LD_IS_LLD),0x80100000,0xffffffff80100000)
+zload-$(CONFIG_MIPS_GENERIC)	+= $(if $(CONFIG_LD_IS_LLD),0x81000000,0xffffffff81000000)
 all-$(CONFIG_MIPS_GENERIC)	:= vmlinux.gz.itb
 
 its-y					:= vmlinux.its.S
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] MIPS: generic: Support linking with LLVM ld.lld
  2021-03-21 13:18 [PATCH] MIPS: generic: Support linking with LLVM ld.lld Paul Cercueil
@ 2021-03-22 12:04 ` Alexander Lobakin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Lobakin @ 2021-03-22 12:04 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: Alexander Lobakin, Paul Burton, Thomas Bogendoerfer,
	Nathan Chancellor, Nick Desaulniers, od, linux-mips,
	linux-kernel, clang-built-linux

From: Paul Cercueil <paul@crapouillou.net>
Date: Sun, 21 Mar 2021 13:18:05 +0000

> LLVM's ld.lld chokes on the 64-bit sign-extended load addresses. Use
> 32-bit addresses if the linker is LLVM's ld.lld.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
>  arch/mips/generic/Platform | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/mips/generic/Platform b/arch/mips/generic/Platform
> index b871af16b5b6..19b7d92a4ca7 100644
> --- a/arch/mips/generic/Platform
> +++ b/arch/mips/generic/Platform
> @@ -12,8 +12,8 @@
>  cflags-$(CONFIG_MACH_INGENIC_SOC)	+= -I$(srctree)/arch/mips/include/asm/mach-ingenic
>  cflags-$(CONFIG_MIPS_GENERIC)	+= -I$(srctree)/arch/mips/include/asm/mach-generic
>
> -load-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff80100000
> -zload-$(CONFIG_MIPS_GENERIC)	+= 0xffffffff81000000
> +load-$(CONFIG_MIPS_GENERIC)		+= $(if $(CONFIG_LD_IS_LLD),0x80100000,0xffffffff80100000)
> +zload-$(CONFIG_MIPS_GENERIC)	+= $(if $(CONFIG_LD_IS_LLD),0x81000000,0xffffffff81000000)
>  all-$(CONFIG_MIPS_GENERIC)	:= vmlinux.gz.itb

For load-y, it's handled in arch/mips/Makefile:289 arch-wide.
For zload-y, it's not handled at all, but the proper way to do this
is to add a similar to load-ld logics in
arch/mips/boot/compressed/Makefile.

>  its-y					:= vmlinux.its.S
> --
> 2.30.2

Thanks,
Al


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-22 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-21 13:18 [PATCH] MIPS: generic: Support linking with LLVM ld.lld Paul Cercueil
2021-03-22 12:04 ` Alexander Lobakin

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).