Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1337537 > unrolled thread

[PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang

Started byArnd Bergmann <arnd@arndb.de>
First post2016-02-18 18:10 +0100
Last post2016-02-19 18:10 +0100
Articles 4 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang Arnd Bergmann <arnd@arndb.de> - 2016-02-18 18:10 +0100
    Re: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON  files with clang Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-02-18 18:40 +0100
      Re: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang Arnd Bergmann <arnd@arndb.de> - 2016-02-19 15:30 +0100
        Re: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON  files with clang Nicolas Pitre <nicolas.pitre@linaro.org> - 2016-02-19 18:10 +0100

#1337537 — [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-18 18:10 +0100
Subject[PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang
Message-ID<r3Afw-lQ-1@gated-at.bofh.it>
clang ignores the -mfpu=neon flag when building with -march=armv6:

In file included from lib/raid6/neon1.c:27:
clang/3.8.0/include/arm_neon.h:28:2: error: "NEON support not enabled"

There is no real need to build the file with -march=armv6 in a
multi-CPU enabled kernel, as nothing in here will ever get called
on an ARMv6 CPU. Adding -march=armv7 doesn't hurt and can only
improve the code quality.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/lib/Makefile | 2 +-
 lib/raid6/Makefile    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
index d8a780799506..a86c6c8e0648 100644
--- a/arch/arm/lib/Makefile
+++ b/arch/arm/lib/Makefile
@@ -35,7 +35,7 @@ $(obj)/csumpartialcopy.o:	$(obj)/csumpartialcopygeneric.S
 $(obj)/csumpartialcopyuser.o:	$(obj)/csumpartialcopygeneric.S
 
 ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
-  NEON_FLAGS			:= -mfloat-abi=softfp -mfpu=neon
+  NEON_FLAGS			:= -mfloat-abi=softfp -mfpu=neon -march=armv7-a
   CFLAGS_xor-neon.o		+= $(NEON_FLAGS)
   obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
 endif
diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
index 3b10a48fa040..4ef3e800fb39 100644
--- a/lib/raid6/Makefile
+++ b/lib/raid6/Makefile
@@ -23,7 +23,7 @@ endif
 ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
 NEON_FLAGS := -ffreestanding
 ifeq ($(ARCH),arm)
-NEON_FLAGS += -mfloat-abi=softfp -mfpu=neon
+NEON_FLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7-a
 endif
 ifeq ($(ARCH),arm64)
 CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
-- 
2.7.0

[toc] | [next] | [standalone]


#1337568 — Re: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang

FromNicolas Pitre <nicolas.pitre@linaro.org>
Date2016-02-18 18:40 +0100
SubjectRe: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang
Message-ID<r3AIy-yZ-13@gated-at.bofh.it>
In reply to#1337537
On Thu, 18 Feb 2016, Arnd Bergmann wrote:

> clang ignores the -mfpu=neon flag when building with -march=armv6:
> 
> In file included from lib/raid6/neon1.c:27:
> clang/3.8.0/include/arm_neon.h:28:2: error: "NEON support not enabled"
> 
> There is no real need to build the file with -march=armv6 in a
> multi-CPU enabled kernel, as nothing in here will ever get called
> on an ARMv6 CPU. Adding -march=armv7 doesn't hurt and can only
> improve the code quality.

Is this enough to override a previous -mfpu for gcc?


> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/lib/Makefile | 2 +-
>  lib/raid6/Makefile    | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
> index d8a780799506..a86c6c8e0648 100644
> --- a/arch/arm/lib/Makefile
> +++ b/arch/arm/lib/Makefile
> @@ -35,7 +35,7 @@ $(obj)/csumpartialcopy.o:	$(obj)/csumpartialcopygeneric.S
>  $(obj)/csumpartialcopyuser.o:	$(obj)/csumpartialcopygeneric.S
>  
>  ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
> -  NEON_FLAGS			:= -mfloat-abi=softfp -mfpu=neon
> +  NEON_FLAGS			:= -mfloat-abi=softfp -mfpu=neon -march=armv7-a
>    CFLAGS_xor-neon.o		+= $(NEON_FLAGS)
>    obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
>  endif
> diff --git a/lib/raid6/Makefile b/lib/raid6/Makefile
> index 3b10a48fa040..4ef3e800fb39 100644
> --- a/lib/raid6/Makefile
> +++ b/lib/raid6/Makefile
> @@ -23,7 +23,7 @@ endif
>  ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
>  NEON_FLAGS := -ffreestanding
>  ifeq ($(ARCH),arm)
> -NEON_FLAGS += -mfloat-abi=softfp -mfpu=neon
> +NEON_FLAGS += -mfloat-abi=softfp -mfpu=neon -march=armv7-a
>  endif
>  ifeq ($(ARCH),arm64)
>  CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
> -- 
> 2.7.0
> 
> 

[toc] | [prev] | [next] | [standalone]


#1338231

FromArnd Bergmann <arnd@arndb.de>
Date2016-02-19 15:30 +0100
Message-ID<r3Uee-6kG-17@gated-at.bofh.it>
In reply to#1337568
On Thursday 18 February 2016 12:31:35 Nicolas Pitre wrote:
> On Thu, 18 Feb 2016, Arnd Bergmann wrote:
> 
> > clang ignores the -mfpu=neon flag when building with -march=armv6:
> > 
> > In file included from lib/raid6/neon1.c:27:
> > clang/3.8.0/include/arm_neon.h:28:2: error: "NEON support not enabled"
> > 
> > There is no real need to build the file with -march=armv6 in a
> > multi-CPU enabled kernel, as nothing in here will ever get called
> > on an ARMv6 CPU. Adding -march=armv7 doesn't hurt and can only
> > improve the code quality.
> 
> Is this enough to override a previous -mfpu for gcc?

I did not see any build failures on gcc with this, so I assume it
has no effect. I could move the -march=armv7-a in front of
-mfpu=neon if you think that would be safer though.

	Arnd

[toc] | [prev] | [next] | [standalone]


#1338358 — Re: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang

FromNicolas Pitre <nicolas.pitre@linaro.org>
Date2016-02-19 18:10 +0100
SubjectRe: [PATCH 1/3] [RESEND] ARM: pass -march=armv7-a when building NEON files with clang
Message-ID<r3WJ4-8m3-9@gated-at.bofh.it>
In reply to#1338231
On Fri, 19 Feb 2016, Arnd Bergmann wrote:

> On Thursday 18 February 2016 12:31:35 Nicolas Pitre wrote:
> > On Thu, 18 Feb 2016, Arnd Bergmann wrote:
> > 
> > > clang ignores the -mfpu=neon flag when building with -march=armv6:
> > > 
> > > In file included from lib/raid6/neon1.c:27:
> > > clang/3.8.0/include/arm_neon.h:28:2: error: "NEON support not enabled"
> > > 
> > > There is no real need to build the file with -march=armv6 in a
> > > multi-CPU enabled kernel, as nothing in here will ever get called
> > > on an ARMv6 CPU. Adding -march=armv7 doesn't hurt and can only
> > > improve the code quality.
> > 
> > Is this enough to override a previous -mfpu for gcc?
> 
> I did not see any build failures on gcc with this, so I assume it
> has no effect. I could move the -march=armv7-a in front of
> -mfpu=neon if you think that would be safer though.

I don't know what's safer.  That's why I'm asking.  :-)


Nicolas

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web