diff mbox series

[1/2] LoongArch: vDSO: Use CLANG_FLAGS instead of filtering out '--target='

Message ID 20230627130122.1491765-2-kernel@xen0n.name (mailing list archive)
State New, archived
Headers show
Series Fix cross-compilation issues with Clang | expand

Commit Message

WANG Xuerui June 27, 2023, 1:01 p.m. UTC
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>
---
 arch/loongarch/vdso/Makefile | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Nathan Chancellor June 27, 2023, 4:24 p.m. UTC | #1
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
>
Huacai Chen June 28, 2023, 4:22 a.m. UTC | #2
Queued for loongarch-next, thanks.

Huacai

On Wed, Jun 28, 2023 at 12:24 AM Nathan Chancellor <nathan@kernel.org> wrote:
>
> 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
> >
diff mbox series

Patch

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