mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Nathan Chancellor <nathan@kernel.org>, koachan@protonmail.com
Cc: "David S. Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	sparclinux@vger.kernel.org,  linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] sparc/build: Make all compiler flags also clang-compatible
Date: Sat, 22 Jun 2024 09:29:05 +0200	[thread overview]
Message-ID: <ee12bbe782e44a96f4894dfd9ab0550233014c19.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20240621185345.GA416370@thelio-3990X>

Hi Nathan,

On Fri, 2024-06-21 at 11:53 -0700, Nathan Chancellor wrote:
> I think a good amount of the reasoning below the '---' could probably
> make it into the commit message as well but I don't have much of a
> vision there, maybe one of the SPARC folks will.
> 
> I saw through the LLVM issue above that one other patch is necessary to
> fix an issue in the vDSO [1], which I applied in testing this one. I
> noticed in applying that change that you appear to be working on 6.1,
> which is fine for now, but you'll need another diff once you get to a
> newer version, as we stopped using CROSS_COMPILE to set clang's
> '--target=' value:
> 
> 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))
> 
> With those, I can successfully build a kernel with clang that boots in
> QEMU :)
> 
>   $ make -skj"$(nproc)" \
>          ARCH=sparc64 \
>          CC=clang \
>          CROSS_COMPILE=sparc64-linux-gnu- \
>          LLVM_IAS=0 \
>          mrproper defconfig all
> 
>   $ qemu-system-sparc64 \
>         -serial mon:stdio \
>         -display none \
>         -no-reboot \
>         -M sun4u \
>         -cpu 'TI UltraSparc IIi' \
>         -m 512 \
>         -append console=ttyS0 \
>         -initrd sparc64-rootfs.cpio \
>         -kernel arch/sparc/boot/image
>   ...
>   [    1.788544] Run /init as init process
>   ...
>   Linux version 6.10.0-rc4+ (nathan@thelio-3990X) (ClangBuiltLinux clang version 19.0.0git (https://github.com/llvm/llvm-project a083e50f53f0f9eb9ad0c5b65f3c627cf97043e6), GNU ld (GNU Binutils) 2.42) #1 SMP Fri Jun 21 11:36:18 MST 2024
>   ...

Wow, this is really great progress. Kudos to everyone who helped to make this happen!

Adrian

-- 
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer
`. `'   Physicist
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913

  reply	other threads:[~2024-06-22  7:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-20 15:56 Koakuma via B4 Relay
2024-06-21 18:53 ` Nathan Chancellor
2024-06-22  7:29   ` John Paul Adrian Glaubitz [this message]
2024-06-22 12:18   ` Koakuma
2024-06-24 20:14     ` Nathan Chancellor
2024-06-23 16:53 ` John Paul Adrian Glaubitz
2024-06-25  2:06   ` Koakuma
2024-06-25  7:20     ` John Paul Adrian Glaubitz
2024-06-25 16:37       ` Koakuma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee12bbe782e44a96f4894dfd9ab0550233014c19.camel@physik.fu-berlin.de \
    --to=glaubitz@physik.fu-berlin.de \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=justinstitt@google.com \
    --cc=koachan@protonmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®