[PATCH v2 2/2] sparc/build: Add SPARC target flags for compiling with clang

Koakuma via B4 Relay posted 2 patches 1 year, 5 months ago
There is a newer version of this series
[PATCH v2 2/2] sparc/build: Add SPARC target flags for compiling with clang
Posted by Koakuma via B4 Relay 1 year, 5 months ago
From: Koakuma <koachan@protonmail.com>

clang only supports building 64-bit kernel, so we use the
sparc64-linux-gnu target.

See also: https://lore.kernel.org/lkml/e26PTXUXEz8OYXmaeKn4Mpuejr4IOlFfFwdB5vpsluXlYiqDdlyQTYcDtdAny_o4gO4SfPeQCCN2qpyT6e0nog5EaP3xk2SeUPTrF54p1gM=@protonmail.com/T/#m068e010dcf8b99d3510a90d7532bcdb70e2e2c6b

Signed-off-by: Koakuma <koachan@protonmail.com>
---
 scripts/Makefile.clang | 1 +
 1 file changed, 1 insertion(+)

diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
index 6c23c6af797f..2435efae67f5 100644
--- a/scripts/Makefile.clang
+++ b/scripts/Makefile.clang
@@ -10,6 +10,7 @@ CLANG_TARGET_FLAGS_mips		:= mipsel-linux-gnu
 CLANG_TARGET_FLAGS_powerpc	:= powerpc64le-linux-gnu
 CLANG_TARGET_FLAGS_riscv	:= riscv64-linux-gnu
 CLANG_TARGET_FLAGS_s390		:= s390x-linux-gnu
+CLANG_TARGET_FLAGS_sparc	:= sparc64-linux-gnu
 CLANG_TARGET_FLAGS_x86		:= x86_64-linux-gnu
 CLANG_TARGET_FLAGS_um		:= $(CLANG_TARGET_FLAGS_$(SUBARCH))
 CLANG_TARGET_FLAGS		:= $(CLANG_TARGET_FLAGS_$(SRCARCH))

-- 
2.45.2
Re: [PATCH v2 2/2] sparc/build: Add SPARC target flags for compiling with clang
Posted by Masahiro Yamada 1 year, 4 months ago
On Thu, Jul 18, 2024 at 1:12 AM Koakuma via B4 Relay
<devnull+koachan.protonmail.com@kernel.org> wrote:
>
> From: Koakuma <koachan@protonmail.com>
>
> clang only supports building 64-bit kernel, so we use the
> sparc64-linux-gnu target.
>
> See also: https://lore.kernel.org/lkml/e26PTXUXEz8OYXmaeKn4Mpuejr4IOlFfFwdB5vpsluXlYiqDdlyQTYcDtdAny_o4gO4SfPeQCCN2qpyT6e0nog5EaP3xk2SeUPTrF54p1gM=@protonmail.com/T/#m068e010dcf8b99d3510a90d7532bcdb70e2e2c6b
>
> Signed-off-by: Koakuma <koachan@protonmail.com>



Acked-by: Masahiro Yamada <masahiroy@kernel.org>


(I assume this will go through the sparc subsystem)




-- 
Best Regards
Masahiro Yamada
Re: [PATCH v2 2/2] sparc/build: Add SPARC target flags for compiling with clang
Posted by Nathan Chancellor 1 year, 4 months ago
Hi Koakuma,

On Wed, Jul 17, 2024 at 11:10:16PM +0700, Koakuma wrote:
> clang only supports building 64-bit kernel, so we use the
> sparc64-linux-gnu target.

It should not really matter which sparc target you pick (32-bit or
64-bit), as the comment at the top of the file mentions that
architectures should use the command line options to control word size
and endianness, which arch/sparc does. Not that I really think it is
worth correcting, just thought I would mention :)

> See also: https://lore.kernel.org/lkml/e26PTXUXEz8OYXmaeKn4Mpuejr4IOlFfFwdB5vpsluXlYiqDdlyQTYcDtdAny_o4gO4SfPeQCCN2qpyT6e0nog5EaP3xk2SeUPTrF54p1gM=@protonmail.com/T/#m068e010dcf8b99d3510a90d7532bcdb70e2e2c6b
> 
> Signed-off-by: Koakuma <koachan@protonmail.com>

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

Thanks for all the work you have done driving this, it is pretty cool to
see :)

> ---
>  scripts/Makefile.clang | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
> index 6c23c6af797f..2435efae67f5 100644
> --- a/scripts/Makefile.clang
> +++ b/scripts/Makefile.clang
> @@ -10,6 +10,7 @@ CLANG_TARGET_FLAGS_mips		:= mipsel-linux-gnu
>  CLANG_TARGET_FLAGS_powerpc	:= powerpc64le-linux-gnu
>  CLANG_TARGET_FLAGS_riscv	:= riscv64-linux-gnu
>  CLANG_TARGET_FLAGS_s390		:= s390x-linux-gnu
> +CLANG_TARGET_FLAGS_sparc	:= sparc64-linux-gnu
>  CLANG_TARGET_FLAGS_x86		:= x86_64-linux-gnu
>  CLANG_TARGET_FLAGS_um		:= $(CLANG_TARGET_FLAGS_$(SUBARCH))
>  CLANG_TARGET_FLAGS		:= $(CLANG_TARGET_FLAGS_$(SRCARCH))
> 
> -- 
> 2.45.2
>