[v4,3/4] ARM: only use -mtp=cp15 for the compiler

Message ID 20221014201354.3190007-4-ndesaulniers@google.com
State New
Headers
Series pass -march= only to compiler |

Commit Message

Nick Desaulniers Oct. 14, 2022, 8:13 p.m. UTC
  Avoids an error from the assembler for CONFIG_THUMB2 kernels:

clang-15: error: hardware TLS register is not supported for the thumbv4t
sub-architecture

This flag only makes sense to pass to the compiler, not the assembler.

Perhaps CFLAGS_ABI can be renamed to CPPFLAGS_ABI to reflect that they
will be passed to both the compiler and assembler for sources that
require pre-processing.

Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 arch/arm/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Nathan Chancellor Oct. 14, 2022, 9:20 p.m. UTC | #1
On Fri, Oct 14, 2022 at 01:13:53PM -0700, Nick Desaulniers wrote:
> Avoids an error from the assembler for CONFIG_THUMB2 kernels:
> 
> clang-15: error: hardware TLS register is not supported for the thumbv4t
> sub-architecture
> 
> This flag only makes sense to pass to the compiler, not the assembler.
> 
> Perhaps CFLAGS_ABI can be renamed to CPPFLAGS_ABI to reflect that they
> will be passed to both the compiler and assembler for sources that
> require pre-processing.
> 
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

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

> ---
>  arch/arm/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/Makefile b/arch/arm/Makefile
> index 8dd943b50b7d..ee888070b2ff 100644
> --- a/arch/arm/Makefile
> +++ b/arch/arm/Makefile
> @@ -111,7 +111,7 @@ CFLAGS_ABI	+= -meabi gnu
>  endif
>  
>  ifeq ($(CONFIG_CURRENT_POINTER_IN_TPIDRURO),y)
> -CFLAGS_ABI	+= -mtp=cp15
> +KBUILD_CFLAGS	+= -mtp=cp15
>  endif
>  
>  # Accept old syntax despite ".syntax unified"
> -- 
> 2.38.0.413.g74048e4d9e-goog
>
  

Patch

diff --git a/arch/arm/Makefile b/arch/arm/Makefile
index 8dd943b50b7d..ee888070b2ff 100644
--- a/arch/arm/Makefile
+++ b/arch/arm/Makefile
@@ -111,7 +111,7 @@  CFLAGS_ABI	+= -meabi gnu
 endif
 
 ifeq ($(CONFIG_CURRENT_POINTER_IN_TPIDRURO),y)
-CFLAGS_ABI	+= -mtp=cp15
+KBUILD_CFLAGS	+= -mtp=cp15
 endif
 
 # Accept old syntax despite ".syntax unified"