diff mbox series

[v1,4/5] powerpc: Remove cpu-as-y completely

Message ID 9e43ad8b173c2fdb540e2555a8ba3e375419f3cf.1671475543.git.christophe.leroy@csgroup.eu (mailing list archive)
State Superseded
Headers show
Series [v1,1/5] powerpc/64: Set default CPU in Kconfig | expand

Commit Message

Christophe Leroy Dec. 19, 2022, 6:45 p.m. UTC
cpu-as-y is there to force assembler building options.
But there is no need for that. Gcc is passed the necessary
options and it automatically pass the appropriate option to
GAS.

GCC is given -maltivec when relevant, so no need
for -Wa,-maltivec in addition

And -Wa,-many is wrong as it will hide innapropriate
instructions. Better to detect them and handle them on a
case by case basis.
-Wa,-many was added by commit 960e30029863 ("powerpc/Makefile:
Fix PPC_BOOK3S_64 ASFLAGS") in order to fix an issue with
clang and the passed -Wa,-mpower4 option. But we have now
removed it expecting the compiler to automatically pass the
proper options and instructions based on -mcpu=power4

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
---
 arch/powerpc/Makefile | 12 ------------
 1 file changed, 12 deletions(-)

Comments

Pali Rohár Dec. 20, 2022, 8:15 p.m. UTC | #1
On Monday 19 December 2022 19:45:59 Christophe Leroy wrote:
> cpu-as-y is there to force assembler building options.
> But there is no need for that. Gcc is passed the necessary
> options and it automatically pass the appropriate option to
> GAS.
> 
> GCC is given -maltivec when relevant, so no need
> for -Wa,-maltivec in addition
> 
> And -Wa,-many is wrong as it will hide innapropriate
> instructions. Better to detect them and handle them on a
> case by case basis.
> -Wa,-many was added by commit 960e30029863 ("powerpc/Makefile:
> Fix PPC_BOOK3S_64 ASFLAGS") in order to fix an issue with
> clang and the passed -Wa,-mpower4 option. But we have now
> removed it expecting the compiler to automatically pass the
> proper options and instructions based on -mcpu=power4
> 
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>

Acked-by: Pali Rohár <pali@kernel.org>

> ---
>  arch/powerpc/Makefile | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
> index 0f9f291895cb..7e67f939a243 100644
> --- a/arch/powerpc/Makefile
> +++ b/arch/powerpc/Makefile
> @@ -201,18 +201,6 @@ KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
>  # often slow when they are implemented at all
>  KBUILD_CFLAGS		+= $(call cc-option,-mno-string)
>  
> -cpu-as-$(CONFIG_ALTIVEC)	+= $(call as-option,-Wa$(comma)-maltivec)
> -
> -# When using '-many -mpower4' gas will first try and find a matching power4
> -# mnemonic and failing that it will allow any valid mnemonic that GAS knows
> -# about. GCC will pass -many to GAS when assembling, clang does not.
> -# LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675
> -# but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway...
> -cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= $(call as-option,-Wa$(comma)-many)
> -
> -KBUILD_AFLAGS += $(cpu-as-y)
> -KBUILD_CFLAGS += $(cpu-as-y)
> -
>  KBUILD_AFLAGS += $(aflags-y)
>  KBUILD_CFLAGS += $(cflags-y)
>  
> -- 
> 2.38.1
>
Michael Ellerman Feb. 20, 2023, 6 a.m. UTC | #2
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> cpu-as-y is there to force assembler building options.
> But there is no need for that. Gcc is passed the necessary
> options and it automatically pass the appropriate option to
> GAS.
>
> GCC is given -maltivec when relevant, so no need
> for -Wa,-maltivec in addition
>
> And -Wa,-many is wrong as it will hide innapropriate
> instructions. Better to detect them and handle them on a
> case by case basis.
> -Wa,-many was added by commit 960e30029863 ("powerpc/Makefile:
> Fix PPC_BOOK3S_64 ASFLAGS") in order to fix an issue with
> clang and the passed -Wa,-mpower4 option. But we have now
> removed it expecting the compiler to automatically pass the
> proper options and instructions based on -mcpu=power4

I wanted to apply this one, but it caused a lot of breakage for big
endian Book3S-64 builds - where we build for power4 but have lots of
code that uses >= power5 instructions.

I'll try and get those all fixed and pick this up for the next merge
window.

cheers
Christophe Leroy Feb. 16, 2024, 3:25 p.m. UTC | #3
Le 20/02/2023 à 07:00, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>> cpu-as-y is there to force assembler building options.
>> But there is no need for that. Gcc is passed the necessary
>> options and it automatically pass the appropriate option to
>> GAS.
>>
>> GCC is given -maltivec when relevant, so no need
>> for -Wa,-maltivec in addition
>>
>> And -Wa,-many is wrong as it will hide innapropriate
>> instructions. Better to detect them and handle them on a
>> case by case basis.
>> -Wa,-many was added by commit 960e30029863 ("powerpc/Makefile:
>> Fix PPC_BOOK3S_64 ASFLAGS") in order to fix an issue with
>> clang and the passed -Wa,-mpower4 option. But we have now
>> removed it expecting the compiler to automatically pass the
>> proper options and instructions based on -mcpu=power4
> 
> I wanted to apply this one, but it caused a lot of breakage for big
> endian Book3S-64 builds - where we build for power4 but have lots of
> code that uses >= power5 instructions.
> 
> I'll try and get those all fixed and pick this up for the next merge
> window.
> 

ping ?
Michael Ellerman Feb. 24, 2024, 11:52 p.m. UTC | #4
Christophe Leroy <christophe.leroy@csgroup.eu> writes:
> Le 20/02/2023 à 07:00, Michael Ellerman a écrit :
>> Christophe Leroy <christophe.leroy@csgroup.eu> writes:
>>> cpu-as-y is there to force assembler building options.
>>> But there is no need for that. Gcc is passed the necessary
>>> options and it automatically pass the appropriate option to
>>> GAS.
>>>
>>> GCC is given -maltivec when relevant, so no need
>>> for -Wa,-maltivec in addition
>>>
>>> And -Wa,-many is wrong as it will hide innapropriate
>>> instructions. Better to detect them and handle them on a
>>> case by case basis.
>>> -Wa,-many was added by commit 960e30029863 ("powerpc/Makefile:
>>> Fix PPC_BOOK3S_64 ASFLAGS") in order to fix an issue with
>>> clang and the passed -Wa,-mpower4 option. But we have now
>>> removed it expecting the compiler to automatically pass the
>>> proper options and instructions based on -mcpu=power4
>> 
>> I wanted to apply this one, but it caused a lot of breakage for big
>> endian Book3S-64 builds - where we build for power4 but have lots of
>> code that uses >= power5 instructions.
>> 
>> I'll try and get those all fixed and pick this up for the next merge
>> window.
>
> ping ?

Brutal :)

There's still a few issues, I have patches for most of them I think.
Will post this week.

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
index 0f9f291895cb..7e67f939a243 100644
--- a/arch/powerpc/Makefile
+++ b/arch/powerpc/Makefile
@@ -201,18 +201,6 @@  KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
 # often slow when they are implemented at all
 KBUILD_CFLAGS		+= $(call cc-option,-mno-string)
 
-cpu-as-$(CONFIG_ALTIVEC)	+= $(call as-option,-Wa$(comma)-maltivec)
-
-# When using '-many -mpower4' gas will first try and find a matching power4
-# mnemonic and failing that it will allow any valid mnemonic that GAS knows
-# about. GCC will pass -many to GAS when assembling, clang does not.
-# LLVM IAS doesn't understand either flag: https://github.com/ClangBuiltLinux/linux/issues/675
-# but LLVM IAS only supports ISA >= 2.06 for Book3S 64 anyway...
-cpu-as-$(CONFIG_PPC_BOOK3S_64)	+= $(call as-option,-Wa$(comma)-many)
-
-KBUILD_AFLAGS += $(cpu-as-y)
-KBUILD_CFLAGS += $(cpu-as-y)
-
 KBUILD_AFLAGS += $(aflags-y)
 KBUILD_CFLAGS += $(cflags-y)