Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: WANG Xuerui <kernel@xen0n.name>
Cc: Huacai Chen <chenhuacai@kernel.org>,
	WANG Rui <wangrui@loongson.cn>, Xi Ruoyao <xry111@xry111.site>,
	loongarch@lists.linux.dev, linux-kbuild@vger.kernel.org,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
	WANG Xuerui <git@xen0n.name>
Subject: Re: [PATCH 1/2] LoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target='
Date: Tue, 27 Jun 2023 09:24:56 -0700	[thread overview]
Message-ID: <20230627162456.GA223742@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230627130122.1491765-2-kernel@xen0n.name>

On Tue, Jun 27, 2023 at 09:01:21PM +0800, WANG Xuerui wrote:
> From: WANG Xuerui <git@xen0n.name>
> 
> This is a port of commit 76d7fff22be3e ("MIPS: VDSO: Use CLANG_FLAGS
> instead of filtering out '--target='") to arch/loongarch, for fixing
> cross-compilation with Clang.
> 
> Reported-by: Nathan Chancellor <nathan@kernel.org>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1787#issuecomment-1608306002
> Signed-off-by: WANG Xuerui <git@xen0n.name>

Thanks for the patch!

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

> ---
>  arch/loongarch/vdso/Makefile | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/arch/loongarch/vdso/Makefile b/arch/loongarch/vdso/Makefile
> index 3f9df4d9930f..a50308b6fc25 100644
> --- a/arch/loongarch/vdso/Makefile
> +++ b/arch/loongarch/vdso/Makefile
> @@ -12,12 +12,9 @@ ccflags-vdso := \
>  	$(filter -E%,$(KBUILD_CFLAGS)) \
>  	$(filter -march=%,$(KBUILD_CFLAGS)) \
>  	$(filter -m%-float,$(KBUILD_CFLAGS)) \
> +	$(CLANG_FLAGS) \
>  	-D__VDSO__
>  
> -ifeq ($(cc-name),clang)
> -ccflags-vdso += $(filter --target=%,$(KBUILD_CFLAGS))
> -endif
> -
>  cflags-vdso := $(ccflags-vdso) \
>  	-isystem $(shell $(CC) -print-file-name=include) \
>  	$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
> -- 
> 2.40.0
> 

  reply	other threads:[~2023-06-27 16:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 13:01 [PATCH 0/2] Fix cross-compilation issues with Clang WANG Xuerui
2023-06-27 13:01 ` [PATCH 1/2] LoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target=' WANG Xuerui
2023-06-27 16:24   ` Nathan Chancellor [this message]
2023-06-28  4:22     ` Huacai Chen
2023-06-27 13:01 ` [PATCH 2/2] LoongArch: Include KBUILD_CPPFLAGS in CHECKFLAGS invocation WANG Xuerui
2023-06-27 16:25   ` Nathan Chancellor
2023-06-28  4:22     ` Huacai Chen
2023-06-27 16:32 ` [PATCH 0/2] Fix cross-compilation issues with Clang Nathan Chancellor

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=20230627162456.GA223742@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=chenhuacai@kernel.org \
    --cc=git@xen0n.name \
    --cc=kernel@xen0n.name \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=loongarch@lists.linux.dev \
    --cc=wangrui@loongson.cn \
    --cc=xry111@xry111.site \
    /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