Re: [PATCH v2] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+

2021-02-09 Thread Will Deacon
On Mon, 8 Feb 2021 17:57:20 -0700, Nathan Chancellor wrote:
> Similar to commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN
> depends on !LD_IS_LLD"), ld.lld prior to 13.0.0 does not properly
> support aarch64 big endian, leading to the following build error when
> CONFIG_CPU_BIG_ENDIAN is selected:
> 
> ld.lld: error: unknown emulation: aarch64linuxb
> 
> [...]

Applied to arm64 (for-next/misc), thanks!

[1/1] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+
  https://git.kernel.org/arm64/c/e9c6deee00e9

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev


Re: [PATCH v2] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+

2021-02-08 Thread Nick Desaulniers
On Mon, Feb 8, 2021 at 4:58 PM Nathan Chancellor  wrote:
>
> Similar to commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN
> depends on !LD_IS_LLD"), ld.lld prior to 13.0.0 does not properly
> support aarch64 big endian, leading to the following build error when
> CONFIG_CPU_BIG_ENDIAN is selected:
>
> ld.lld: error: unknown emulation: aarch64linuxb
>
> This has been resolved in LLVM 13. To avoid errors like this, only allow
> CONFIG_CPU_BIG_ENDIAN to be selected if using ld.bfd or ld.lld 13.0.0
> and newer.
>
> While we are here, the indentation of this symbol used spaces since its
> introduction in commit a872013d6d03 ("arm64: kconfig: allow
> CPU_BIG_ENDIAN to be selected"). Change it to tabs to be consistent with
> kernel coding style.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/380
> Link: https://github.com/ClangBuiltLinux/linux/issues/1288
> Link: 
> https://github.com/llvm/llvm-project/commit/7605a9a009b5fa3bdac07e3131c8d82f6d08feb7
> Link: 
> https://github.com/llvm/llvm-project/commit/eea34aae2e74e9b6fbdd5b95f479bc7f397bf387
> Reported-by: Arnd Bergmann 
> Signed-off-by: Nathan Chancellor 

LGTM, thanks for implementing BE support for aarch64 in LLD, Fangrui!
(And Nathan for the kernel patch+testing)
Reviewed-by: Nick Desaulniers 

> ---
>
> v1 -> v2:
>
> * Conditionally disable CONFIG_CPU_BIG_ENDIAN for older versions of
>   ld.lld now that proper support has been added to ld.lld 13+ (thanks to
>   the quick work of Fangrui Song).
>
>  arch/arm64/Kconfig | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
> index f39568b28ec1..912da4e2ab59 100644
> --- a/arch/arm64/Kconfig
> +++ b/arch/arm64/Kconfig
> @@ -952,8 +952,9 @@ choice
>   that is selected here.
>
>  config CPU_BIG_ENDIAN
> -   bool "Build big-endian kernel"
> -   help
> +   bool "Build big-endian kernel"
> +   depends on !LD_IS_LLD || LLD_VERSION >= 13
> +   help
>   Say Y if you plan on running a kernel with a big-endian userspace.
>
>  config CPU_LITTLE_ENDIAN
>
> base-commit: 92bf22614b21a2706f4993b278017e437f7785b3
> --
> 2.30.1
>


-- 
Thanks,
~Nick Desaulniers


[PATCH v2] arm64: Make CPU_BIG_ENDIAN depend on ld.bfd or ld.lld 13.0.0+

2021-02-08 Thread Nathan Chancellor
Similar to commit 28187dc8ebd9 ("ARM: 9025/1: Kconfig: CPU_BIG_ENDIAN
depends on !LD_IS_LLD"), ld.lld prior to 13.0.0 does not properly
support aarch64 big endian, leading to the following build error when
CONFIG_CPU_BIG_ENDIAN is selected:

ld.lld: error: unknown emulation: aarch64linuxb

This has been resolved in LLVM 13. To avoid errors like this, only allow
CONFIG_CPU_BIG_ENDIAN to be selected if using ld.bfd or ld.lld 13.0.0
and newer.

While we are here, the indentation of this symbol used spaces since its
introduction in commit a872013d6d03 ("arm64: kconfig: allow
CPU_BIG_ENDIAN to be selected"). Change it to tabs to be consistent with
kernel coding style.

Link: https://github.com/ClangBuiltLinux/linux/issues/380
Link: https://github.com/ClangBuiltLinux/linux/issues/1288
Link: 
https://github.com/llvm/llvm-project/commit/7605a9a009b5fa3bdac07e3131c8d82f6d08feb7
Link: 
https://github.com/llvm/llvm-project/commit/eea34aae2e74e9b6fbdd5b95f479bc7f397bf387
Reported-by: Arnd Bergmann 
Signed-off-by: Nathan Chancellor 
---

v1 -> v2:

* Conditionally disable CONFIG_CPU_BIG_ENDIAN for older versions of
  ld.lld now that proper support has been added to ld.lld 13+ (thanks to
  the quick work of Fangrui Song).

 arch/arm64/Kconfig | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig
index f39568b28ec1..912da4e2ab59 100644
--- a/arch/arm64/Kconfig
+++ b/arch/arm64/Kconfig
@@ -952,8 +952,9 @@ choice
  that is selected here.
 
 config CPU_BIG_ENDIAN
-   bool "Build big-endian kernel"
-   help
+   bool "Build big-endian kernel"
+   depends on !LD_IS_LLD || LLD_VERSION >= 13
+   help
  Say Y if you plan on running a kernel with a big-endian userspace.
 
 config CPU_LITTLE_ENDIAN

base-commit: 92bf22614b21a2706f4993b278017e437f7785b3
-- 
2.30.1