* [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS
@ 2023-01-04 19:54 Nathan Chancellor
2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Nathan Chancellor @ 2023-01-04 19:54 UTC (permalink / raw)
To: masahiroy, ndesaulniers
Cc: nicolas, trix, linux-kbuild, llvm, Nathan Chancellor,
kernel test robot, tglx, mingo, bp, dave.hansen, x86, tsbogend,
linux-mips, mpe, npiggin, christophe.leroy, linuxppc-dev, hca,
gor, agordeev, borntraeger, svens, linux-s390, harry.wentland,
sunpeng.li, Rodrigo.Siqueira, alexander.deucher, christian.koenig,
Xinhui.Pan, amd-gfx, dri-devel
Hi all,
Clang can emit a few different warnings when it encounters a flag that it
recognizes but does not support internally. These warnings are elevated to
errors within {as,cc}-option via -Werror to catch unsupported flags that should
not be added to KBUILD_{A,C}FLAGS; see commit c3f0d0bc5b01 ("kbuild, LLVMLinux:
Add -Werror to cc-option to support clang").
If an unsupported flag is unconditionally to KBUILD_{A,C}FLAGS, all subsequent
{as,cc}-option will always fail, preventing supported and even potentially
necessary flags from getting adding to the tool flags.
One would expect these warnings to be visible in the kernel build logs since
they are added to KBUILD_{A,C}FLAGS but unfortunately, these warnings are
hidden with clang's -Qunused-arguments flag, which is added to KBUILD_CPPFLAGS
and used for both compiling and assembling files.
Patches 1-4 address the internal inconsistencies of invoking the assembler
within kbuild by using KBUILD_AFLAGS consistently and using '-x
assembler-with-cpp' over '-x assembler'. This matches how assembly files are
built across the kernel and helps avoid problems in situations where macro
definitions or warning flags are present in KBUILD_AFLAGS, which cause
instances of -Wunused-command-line-argument when the preprocessor is not called
to consume them. There were a couple of places in architecture code where this
change would break things so those are fixed first.
Patches 5-12 clean up warnings that will show up when -Qunused-argument is
dropped. I hope none of these are controversial.
Patch 13 turns two warnings into errors so that the presence of unused flags
cannot be easily ignored.
Patch 14 drops -Qunused-argument. This is done last so that it can be easily
reverted if need be.
This series has seen my personal test framework, which tests several different
configurations and architectures, with LLVM tip of tree (16.0.0). I have done
defconfig, allmodconfig, and allnoconfig builds for arm, arm64, i386, mips,
powerpc, riscv, s390, and x86_64 with GCC 12.2.0 as well but I am hoping the
rest of the test infrastructure will catch any lurking problems.
I would like this series to stay together so that there is no opportunity for
breakage so please consider giving acks so that this can be carried via the
kbuild tree.
---
Nathan Chancellor (12):
MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT
MIPS: Prefer cc-option for additions to cflags
powerpc: Remove linker flag from KBUILD_AFLAGS
powerpc/vdso: Remove unused '-s' flag from ASFLAGS
powerpc/vdso: Improve linker flags
powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang
s390/vdso: Drop unused '-s' flag from KBUILD_AFLAGS_64
s390/vdso: Drop '-shared' from KBUILD_CFLAGS_64
s390/purgatory: Remove unused '-MD' and unnecessary '-c' flags
drm/amd/display: Do not add '-mhard-float' to dml_ccflags for clang
kbuild: Turn a couple more of clang's unused option warnings into errors
kbuild: Stop using '-Qunused-arguments' with clang
Nick Desaulniers (2):
x86/boot/compressed: prefer cc-option for CFLAGS additions
kbuild: Update assembler calls to use proper flags and language target
Makefile | 1 -
arch/mips/Makefile | 13 ++-------
arch/mips/include/asm/asmmacro-32.h | 4 +--
arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++---------------
arch/mips/include/asm/fpregdef.h | 14 ----------
arch/mips/include/asm/mipsregs.h | 20 +++-----------
arch/mips/kernel/genex.S | 2 +-
arch/mips/kernel/r2300_fpu.S | 4 +--
arch/mips/kernel/r4k_fpu.S | 12 ++++-----
arch/mips/kvm/fpu.S | 6 ++---
arch/mips/loongson2ef/Platform | 2 +-
arch/powerpc/Makefile | 2 +-
arch/powerpc/kernel/vdso/Makefile | 25 +++++++++++------
arch/s390/kernel/vdso64/Makefile | 4 +--
arch/s390/purgatory/Makefile | 2 +-
arch/x86/boot/compressed/Makefile | 2 +-
drivers/gpu/drm/amd/display/dc/dml/Makefile | 3 ++-
scripts/Kconfig.include | 2 +-
scripts/Makefile.clang | 2 ++
scripts/Makefile.compiler | 8 +++---
scripts/as-version.sh | 2 +-
21 files changed, 74 insertions(+), 98 deletions(-)
---
base-commit: 88603b6dc419445847923fcb7fe5080067a30f98
change-id: 20221228-drop-qunused-arguments-0c5c7dae54fb
Best regards,
--
Nathan Chancellor <nathan@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread* [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT 2023-01-04 19:54 [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Nathan Chancellor @ 2023-01-04 19:54 ` Nathan Chancellor 2023-01-09 21:18 ` Nick Desaulniers ` (2 more replies) 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor 2023-01-05 8:00 ` [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Heiko Carstens 2 siblings, 3 replies; 10+ messages in thread From: Nathan Chancellor @ 2023-01-04 19:54 UTC (permalink / raw) To: masahiroy, ndesaulniers Cc: nicolas, trix, linux-kbuild, llvm, Nathan Chancellor, kernel test robot, tsbogend, linux-mips -Wa,-msoft-float is tested with as-option, which will be a problem for clang with an upcoming change to move as-option to use KBUILD_AFLAGS instead of KBUILD_CFLAGS due to a lack of '-mno-abicalls' in KBUILD_AFLAGS at the point that this check occurs; $(cflags-y) is added to KBUILD_AFLAGS towards the end of this file. clang: error: ignoring '-fno-PIE' option as it cannot be used with implicit usage of -mabicalls and the N64 ABI [-Werror,-Woption-ignored] This could be resolved by switching to a cc-option check but '$(cflags-y)' would need to be added so that '-mno-abicalls' is present for the test. However, this check is no longer necessary, as -msoft-float is supported by all supported assembler versions (GNU as 2.25+ and LLVM 11+). Eliminate GAS_HAS_SET_HARDFLOAT and all of its uses, inlining SET_HARDFLOAT where necessary. Link: https://lore.kernel.org/202209101939.bvk64Fok-lkp@intel.com/ Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Nathan Chancellor <nathan@kernel.org> --- Cc: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org --- arch/mips/Makefile | 11 +--------- arch/mips/include/asm/asmmacro-32.h | 4 ++-- arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++++++------------------- arch/mips/include/asm/fpregdef.h | 14 ------------- arch/mips/include/asm/mipsregs.h | 20 ++++-------------- arch/mips/kernel/genex.S | 2 +- arch/mips/kernel/r2300_fpu.S | 4 ++-- arch/mips/kernel/r4k_fpu.S | 12 +++++------ arch/mips/kvm/fpu.S | 6 +++--- 9 files changed, 40 insertions(+), 75 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index 490dea07d4e0..a00a6d94e16f 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -95,7 +95,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz # crossformat linking we rely on the elf2ecoff tool for format conversion. # cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -cflags-y += -msoft-float +cflags-y += -msoft-float -Wa,-msoft-float LDFLAGS_vmlinux += -G 0 -static -n -nostdlib KBUILD_AFLAGS_MODULE += -mlong-calls KBUILD_CFLAGS_MODULE += -mlong-calls @@ -104,15 +104,6 @@ ifeq ($(CONFIG_RELOCATABLE),y) LDFLAGS_vmlinux += --emit-relocs endif -# -# pass -msoft-float to GAS if it supports it. However on newer binutils -# (specifically newer than 2.24.51.20140728) we then also need to explicitly -# set ".set hardfloat" in all files which manipulate floating point registers. -# -ifneq ($(call as-option,-Wa$(comma)-msoft-float,),) - cflags-y += -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float -endif - cflags-y += -ffreestanding cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h index 1c08c1f7903c..83a4940b7c89 100644 --- a/arch/mips/include/asm/asmmacro-32.h +++ b/arch/mips/include/asm/asmmacro-32.h @@ -15,7 +15,7 @@ .macro fpu_save_single thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat cfc1 \tmp, fcr31 s.d $f0, THREAD_FPR0(\thread) s.d $f2, THREAD_FPR2(\thread) @@ -39,7 +39,7 @@ .macro fpu_restore_single thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat lw \tmp, THREAD_FCR31(\thread) l.d $f0, THREAD_FPR0(\thread) l.d $f2, THREAD_FPR2(\thread) diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h index ca83ada7015f..1c4438f3f2ab 100644 --- a/arch/mips/include/asm/asmmacro.h +++ b/arch/mips/include/asm/asmmacro.h @@ -83,7 +83,7 @@ .macro fpu_save_16even thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat cfc1 \tmp, fcr31 sdc1 $f0, THREAD_FPR0(\thread) sdc1 $f2, THREAD_FPR2(\thread) @@ -109,7 +109,7 @@ .set push .set mips64r2 .set fp=64 - SET_HARDFLOAT + .set hardfloat sdc1 $f1, THREAD_FPR1(\thread) sdc1 $f3, THREAD_FPR3(\thread) sdc1 $f5, THREAD_FPR5(\thread) @@ -142,7 +142,7 @@ .macro fpu_restore_16even thread tmp=t0 .set push - SET_HARDFLOAT + .set hardfloat lw \tmp, THREAD_FCR31(\thread) ldc1 $f0, THREAD_FPR0(\thread) ldc1 $f2, THREAD_FPR2(\thread) @@ -168,7 +168,7 @@ .set push .set mips64r2 .set fp=64 - SET_HARDFLOAT + .set hardfloat ldc1 $f1, THREAD_FPR1(\thread) ldc1 $f3, THREAD_FPR3(\thread) ldc1 $f5, THREAD_FPR5(\thread) @@ -373,7 +373,7 @@ .macro _cfcmsa rd, cs .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x787e0059 | (\cs << 11) insn32_if_mm 0x587e0056 | (\cs << 11) move \rd, $1 @@ -383,7 +383,7 @@ .macro _ctcmsa cd, rs .set push .set noat - SET_HARDFLOAT + .set hardfloat move $1, \rs insn_if_mips 0x783e0819 | (\cd << 6) insn32_if_mm 0x583e0816 | (\cd << 6) @@ -393,7 +393,7 @@ .macro ld_b wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000820 | (\wd << 6) insn32_if_mm 0x58000807 | (\wd << 6) @@ -403,7 +403,7 @@ .macro ld_h wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000821 | (\wd << 6) insn32_if_mm 0x58000817 | (\wd << 6) @@ -413,7 +413,7 @@ .macro ld_w wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000822 | (\wd << 6) insn32_if_mm 0x58000827 | (\wd << 6) @@ -423,7 +423,7 @@ .macro ld_d wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000823 | (\wd << 6) insn32_if_mm 0x58000837 | (\wd << 6) @@ -433,7 +433,7 @@ .macro st_b wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000824 | (\wd << 6) insn32_if_mm 0x5800080f | (\wd << 6) @@ -443,7 +443,7 @@ .macro st_h wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000825 | (\wd << 6) insn32_if_mm 0x5800081f | (\wd << 6) @@ -453,7 +453,7 @@ .macro st_w wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000826 | (\wd << 6) insn32_if_mm 0x5800082f | (\wd << 6) @@ -463,7 +463,7 @@ .macro st_d wd, off, base .set push .set noat - SET_HARDFLOAT + .set hardfloat PTR_ADDU $1, \base, \off insn_if_mips 0x78000827 | (\wd << 6) insn32_if_mm 0x5800083f | (\wd << 6) @@ -473,7 +473,7 @@ .macro copy_s_w ws, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x78b00059 | (\n << 16) | (\ws << 11) insn32_if_mm 0x58b00056 | (\n << 16) | (\ws << 11) .set pop @@ -482,7 +482,7 @@ .macro copy_s_d ws, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x78b80059 | (\n << 16) | (\ws << 11) insn32_if_mm 0x58b80056 | (\n << 16) | (\ws << 11) .set pop @@ -491,7 +491,7 @@ .macro insert_w wd, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x79300819 | (\n << 16) | (\wd << 6) insn32_if_mm 0x59300816 | (\n << 16) | (\wd << 6) .set pop @@ -500,7 +500,7 @@ .macro insert_d wd, n .set push .set noat - SET_HARDFLOAT + .set hardfloat insn_if_mips 0x79380819 | (\n << 16) | (\wd << 6) insn32_if_mm 0x59380816 | (\n << 16) | (\wd << 6) .set pop @@ -553,7 +553,7 @@ st_d 29, THREAD_FPR29 - FPR_BASE_OFFS, FPR_BASE st_d 30, THREAD_FPR30 - FPR_BASE_OFFS, FPR_BASE st_d 31, THREAD_FPR31 - FPR_BASE_OFFS, FPR_BASE - SET_HARDFLOAT + .set hardfloat _cfcmsa $1, MSA_CSR sw $1, THREAD_MSA_CSR(\thread) .set pop @@ -562,7 +562,7 @@ .macro msa_restore_all thread .set push .set noat - SET_HARDFLOAT + .set hardfloat lw $1, THREAD_MSA_CSR(\thread) _ctcmsa MSA_CSR, $1 #ifdef TOOLCHAIN_SUPPORTS_MSA @@ -618,7 +618,7 @@ .macro msa_init_all_upper .set push .set noat - SET_HARDFLOAT + .set hardfloat not $1, zero msa_init_upper 0 msa_init_upper 1 diff --git a/arch/mips/include/asm/fpregdef.h b/arch/mips/include/asm/fpregdef.h index f184ba088532..429481f9028d 100644 --- a/arch/mips/include/asm/fpregdef.h +++ b/arch/mips/include/asm/fpregdef.h @@ -14,20 +14,6 @@ #include <asm/sgidefs.h> -/* - * starting with binutils 2.24.51.20140729, MIPS binutils warn about mixing - * hardfloat and softfloat object files. The kernel build uses soft-float by - * default, so we also need to pass -msoft-float along to GAS if it supports it. - * But this in turn causes assembler errors in files which access hardfloat - * registers. We detect if GAS supports "-msoft-float" in the Makefile and - * explicitly put ".set hardfloat" where floating point registers are touched. - */ -#ifdef GAS_HAS_SET_HARDFLOAT -#define SET_HARDFLOAT .set hardfloat -#else -#define SET_HARDFLOAT -#endif - #if _MIPS_SIM == _MIPS_SIM_ABI32 /* diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 99eeafe6dcab..2d53704d9f24 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h @@ -2367,7 +2367,7 @@ do { \ /* * Macros to access the floating point coprocessor control registers */ -#define _read_32bit_cp1_register(source, gas_hardfloat) \ +#define read_32bit_cp1_register(source) \ ({ \ unsigned int __res; \ \ @@ -2377,36 +2377,24 @@ do { \ " # gas fails to assemble cfc1 for some archs, \n" \ " # like Octeon. \n" \ " .set mips1 \n" \ - " "STR(gas_hardfloat)" \n" \ + " .set hardfloat \n" \ " cfc1 %0,"STR(source)" \n" \ " .set pop \n" \ : "=r" (__res)); \ __res; \ }) -#define _write_32bit_cp1_register(dest, val, gas_hardfloat) \ +#define write_32bit_cp1_register(dest, val) \ do { \ __asm__ __volatile__( \ " .set push \n" \ " .set reorder \n" \ - " "STR(gas_hardfloat)" \n" \ + " .set hardfloat \n" \ " ctc1 %0,"STR(dest)" \n" \ " .set pop \n" \ : : "r" (val)); \ } while (0) -#ifdef GAS_HAS_SET_HARDFLOAT -#define read_32bit_cp1_register(source) \ - _read_32bit_cp1_register(source, .set hardfloat) -#define write_32bit_cp1_register(dest, val) \ - _write_32bit_cp1_register(dest, val, .set hardfloat) -#else -#define read_32bit_cp1_register(source) \ - _read_32bit_cp1_register(source, ) -#define write_32bit_cp1_register(dest, val) \ - _write_32bit_cp1_register(dest, val, ) -#endif - #ifdef TOOLCHAIN_SUPPORTS_DSP #define rddsp(mask) \ ({ \ diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index 3425df6019c0..b6de8e88c1bd 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S @@ -480,7 +480,7 @@ NESTED(nmi_handler, PT_SIZE, sp) .set push /* gas fails to assemble cfc1 for some archs (octeon).*/ \ .set mips1 - SET_HARDFLOAT + .set hardfloat cfc1 a1, fcr31 .set pop .endm diff --git a/arch/mips/kernel/r2300_fpu.S b/arch/mips/kernel/r2300_fpu.S index 2748c55820c2..6c745aa9e825 100644 --- a/arch/mips/kernel/r2300_fpu.S +++ b/arch/mips/kernel/r2300_fpu.S @@ -64,7 +64,7 @@ LEAF(_restore_fp) */ LEAF(_save_fp_context) .set push - SET_HARDFLOAT + .set hardfloat li v0, 0 # assume success cfc1 t1, fcr31 EX2(s.d $f0, 0(a0)) @@ -98,7 +98,7 @@ LEAF(_save_fp_context) */ LEAF(_restore_fp_context) .set push - SET_HARDFLOAT + .set hardfloat li v0, 0 # assume success EX(lw t0, (a1)) EX2(l.d $f0, 0(a0)) diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 2e687c60bc4f..4e8c98517d9d 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S @@ -26,7 +26,7 @@ .macro EX insn, reg, src .set push - SET_HARDFLOAT + .set hardfloat .set nomacro .ex\@: \insn \reg, \src .set pop @@ -98,14 +98,14 @@ LEAF(_init_msa_upper) */ LEAF(_save_fp_context) .set push - SET_HARDFLOAT + .set hardfloat cfc1 t1, fcr31 .set pop #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) .set push - SET_HARDFLOAT + .set hardfloat #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) .set mips32r2 .set fp=64 @@ -135,7 +135,7 @@ LEAF(_save_fp_context) #endif .set push - SET_HARDFLOAT + .set hardfloat /* Store the 16 even double precision registers */ EX sdc1 $f0, 0(a0) EX sdc1 $f2, 16(a0) @@ -173,7 +173,7 @@ LEAF(_restore_fp_context) #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) .set push - SET_HARDFLOAT + .set hardfloat #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) .set mips32r2 .set fp=64 @@ -201,7 +201,7 @@ LEAF(_restore_fp_context) 1: .set pop #endif .set push - SET_HARDFLOAT + .set hardfloat EX ldc1 $f0, 0(a0) EX ldc1 $f2, 16(a0) EX ldc1 $f4, 32(a0) diff --git a/arch/mips/kvm/fpu.S b/arch/mips/kvm/fpu.S index 16f17c6390dd..eb2e8cc3532f 100644 --- a/arch/mips/kvm/fpu.S +++ b/arch/mips/kvm/fpu.S @@ -22,7 +22,7 @@ LEAF(__kvm_save_fpu) .set push - SET_HARDFLOAT + .set hardfloat .set fp=64 mfc0 t0, CP0_STATUS sll t0, t0, 5 # is Status.FR set? @@ -66,7 +66,7 @@ LEAF(__kvm_save_fpu) LEAF(__kvm_restore_fpu) .set push - SET_HARDFLOAT + .set hardfloat .set fp=64 mfc0 t0, CP0_STATUS sll t0, t0, 5 # is Status.FR set? @@ -110,7 +110,7 @@ LEAF(__kvm_restore_fpu) LEAF(__kvm_restore_fcsr) .set push - SET_HARDFLOAT + .set hardfloat lw t0, VCPU_FCR31(a0) /* * The ctc1 must stay at this offset in __kvm_restore_fcsr. -- 2.39.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor @ 2023-01-09 21:18 ` Nick Desaulniers 2023-01-10 7:45 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Nick Desaulniers @ 2023-01-09 21:18 UTC (permalink / raw) To: Nathan Chancellor Cc: masahiroy, nicolas, trix, linux-kbuild, llvm, kernel test robot, tsbogend, linux-mips On Wed, Jan 4, 2023 at 11:54 AM Nathan Chancellor <nathan@kernel.org> wrote: > > -Wa,-msoft-float is tested with as-option, which will be a problem for > clang with an upcoming change to move as-option to use KBUILD_AFLAGS > instead of KBUILD_CFLAGS due to a lack of '-mno-abicalls' in > KBUILD_AFLAGS at the point that this check occurs; $(cflags-y) is added > to KBUILD_AFLAGS towards the end of this file. > > clang: error: ignoring '-fno-PIE' option as it cannot be used with implicit usage of -mabicalls and the N64 ABI [-Werror,-Woption-ignored] > > This could be resolved by switching to a cc-option check but > '$(cflags-y)' would need to be added so that '-mno-abicalls' is present > for the test. However, this check is no longer necessary, as > -msoft-float is supported by all supported assembler versions (GNU as > 2.25+ and LLVM 11+). Eliminate GAS_HAS_SET_HARDFLOAT and all of its > uses, inlining SET_HARDFLOAT where necessary. > > Link: https://lore.kernel.org/202209101939.bvk64Fok-lkp@intel.com/ > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Nathan Chancellor <nathan@kernel.org> Thanks for the patch! Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 11 +--------- > arch/mips/include/asm/asmmacro-32.h | 4 ++-- > arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++++++------------------- > arch/mips/include/asm/fpregdef.h | 14 ------------- > arch/mips/include/asm/mipsregs.h | 20 ++++-------------- > arch/mips/kernel/genex.S | 2 +- > arch/mips/kernel/r2300_fpu.S | 4 ++-- > arch/mips/kernel/r4k_fpu.S | 12 +++++------ > arch/mips/kvm/fpu.S | 6 +++--- > 9 files changed, 40 insertions(+), 75 deletions(-) > > diff --git a/arch/mips/Makefile b/arch/mips/Makefile > index 490dea07d4e0..a00a6d94e16f 100644 > --- a/arch/mips/Makefile > +++ b/arch/mips/Makefile > @@ -95,7 +95,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlinuz > # crossformat linking we rely on the elf2ecoff tool for format conversion. > # > cflags-y += -G 0 -mno-abicalls -fno-pic -pipe > -cflags-y += -msoft-float > +cflags-y += -msoft-float -Wa,-msoft-float > LDFLAGS_vmlinux += -G 0 -static -n -nostdlib > KBUILD_AFLAGS_MODULE += -mlong-calls > KBUILD_CFLAGS_MODULE += -mlong-calls > @@ -104,15 +104,6 @@ ifeq ($(CONFIG_RELOCATABLE),y) > LDFLAGS_vmlinux += --emit-relocs > endif > > -# > -# pass -msoft-float to GAS if it supports it. However on newer binutils > -# (specifically newer than 2.24.51.20140728) we then also need to explicitly > -# set ".set hardfloat" in all files which manipulate floating point registers. > -# > -ifneq ($(call as-option,-Wa$(comma)-msoft-float,),) > - cflags-y += -DGAS_HAS_SET_HARDFLOAT -Wa,-msoft-float > -endif > - > cflags-y += -ffreestanding > > cflags-$(CONFIG_CPU_BIG_ENDIAN) += -EB > diff --git a/arch/mips/include/asm/asmmacro-32.h b/arch/mips/include/asm/asmmacro-32.h > index 1c08c1f7903c..83a4940b7c89 100644 > --- a/arch/mips/include/asm/asmmacro-32.h > +++ b/arch/mips/include/asm/asmmacro-32.h > @@ -15,7 +15,7 @@ > > .macro fpu_save_single thread tmp=t0 > .set push > - SET_HARDFLOAT > + .set hardfloat > cfc1 \tmp, fcr31 > s.d $f0, THREAD_FPR0(\thread) > s.d $f2, THREAD_FPR2(\thread) > @@ -39,7 +39,7 @@ > > .macro fpu_restore_single thread tmp=t0 > .set push > - SET_HARDFLOAT > + .set hardfloat > lw \tmp, THREAD_FCR31(\thread) > l.d $f0, THREAD_FPR0(\thread) > l.d $f2, THREAD_FPR2(\thread) > diff --git a/arch/mips/include/asm/asmmacro.h b/arch/mips/include/asm/asmmacro.h > index ca83ada7015f..1c4438f3f2ab 100644 > --- a/arch/mips/include/asm/asmmacro.h > +++ b/arch/mips/include/asm/asmmacro.h > @@ -83,7 +83,7 @@ > > .macro fpu_save_16even thread tmp=t0 > .set push > - SET_HARDFLOAT > + .set hardfloat > cfc1 \tmp, fcr31 > sdc1 $f0, THREAD_FPR0(\thread) > sdc1 $f2, THREAD_FPR2(\thread) > @@ -109,7 +109,7 @@ > .set push > .set mips64r2 > .set fp=64 > - SET_HARDFLOAT > + .set hardfloat > sdc1 $f1, THREAD_FPR1(\thread) > sdc1 $f3, THREAD_FPR3(\thread) > sdc1 $f5, THREAD_FPR5(\thread) > @@ -142,7 +142,7 @@ > > .macro fpu_restore_16even thread tmp=t0 > .set push > - SET_HARDFLOAT > + .set hardfloat > lw \tmp, THREAD_FCR31(\thread) > ldc1 $f0, THREAD_FPR0(\thread) > ldc1 $f2, THREAD_FPR2(\thread) > @@ -168,7 +168,7 @@ > .set push > .set mips64r2 > .set fp=64 > - SET_HARDFLOAT > + .set hardfloat > ldc1 $f1, THREAD_FPR1(\thread) > ldc1 $f3, THREAD_FPR3(\thread) > ldc1 $f5, THREAD_FPR5(\thread) > @@ -373,7 +373,7 @@ > .macro _cfcmsa rd, cs > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > insn_if_mips 0x787e0059 | (\cs << 11) > insn32_if_mm 0x587e0056 | (\cs << 11) > move \rd, $1 > @@ -383,7 +383,7 @@ > .macro _ctcmsa cd, rs > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > move $1, \rs > insn_if_mips 0x783e0819 | (\cd << 6) > insn32_if_mm 0x583e0816 | (\cd << 6) > @@ -393,7 +393,7 @@ > .macro ld_b wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000820 | (\wd << 6) > insn32_if_mm 0x58000807 | (\wd << 6) > @@ -403,7 +403,7 @@ > .macro ld_h wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000821 | (\wd << 6) > insn32_if_mm 0x58000817 | (\wd << 6) > @@ -413,7 +413,7 @@ > .macro ld_w wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000822 | (\wd << 6) > insn32_if_mm 0x58000827 | (\wd << 6) > @@ -423,7 +423,7 @@ > .macro ld_d wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000823 | (\wd << 6) > insn32_if_mm 0x58000837 | (\wd << 6) > @@ -433,7 +433,7 @@ > .macro st_b wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000824 | (\wd << 6) > insn32_if_mm 0x5800080f | (\wd << 6) > @@ -443,7 +443,7 @@ > .macro st_h wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000825 | (\wd << 6) > insn32_if_mm 0x5800081f | (\wd << 6) > @@ -453,7 +453,7 @@ > .macro st_w wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000826 | (\wd << 6) > insn32_if_mm 0x5800082f | (\wd << 6) > @@ -463,7 +463,7 @@ > .macro st_d wd, off, base > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > PTR_ADDU $1, \base, \off > insn_if_mips 0x78000827 | (\wd << 6) > insn32_if_mm 0x5800083f | (\wd << 6) > @@ -473,7 +473,7 @@ > .macro copy_s_w ws, n > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > insn_if_mips 0x78b00059 | (\n << 16) | (\ws << 11) > insn32_if_mm 0x58b00056 | (\n << 16) | (\ws << 11) > .set pop > @@ -482,7 +482,7 @@ > .macro copy_s_d ws, n > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > insn_if_mips 0x78b80059 | (\n << 16) | (\ws << 11) > insn32_if_mm 0x58b80056 | (\n << 16) | (\ws << 11) > .set pop > @@ -491,7 +491,7 @@ > .macro insert_w wd, n > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > insn_if_mips 0x79300819 | (\n << 16) | (\wd << 6) > insn32_if_mm 0x59300816 | (\n << 16) | (\wd << 6) > .set pop > @@ -500,7 +500,7 @@ > .macro insert_d wd, n > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > insn_if_mips 0x79380819 | (\n << 16) | (\wd << 6) > insn32_if_mm 0x59380816 | (\n << 16) | (\wd << 6) > .set pop > @@ -553,7 +553,7 @@ > st_d 29, THREAD_FPR29 - FPR_BASE_OFFS, FPR_BASE > st_d 30, THREAD_FPR30 - FPR_BASE_OFFS, FPR_BASE > st_d 31, THREAD_FPR31 - FPR_BASE_OFFS, FPR_BASE > - SET_HARDFLOAT > + .set hardfloat > _cfcmsa $1, MSA_CSR > sw $1, THREAD_MSA_CSR(\thread) > .set pop > @@ -562,7 +562,7 @@ > .macro msa_restore_all thread > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > lw $1, THREAD_MSA_CSR(\thread) > _ctcmsa MSA_CSR, $1 > #ifdef TOOLCHAIN_SUPPORTS_MSA > @@ -618,7 +618,7 @@ > .macro msa_init_all_upper > .set push > .set noat > - SET_HARDFLOAT > + .set hardfloat > not $1, zero > msa_init_upper 0 > msa_init_upper 1 > diff --git a/arch/mips/include/asm/fpregdef.h b/arch/mips/include/asm/fpregdef.h > index f184ba088532..429481f9028d 100644 > --- a/arch/mips/include/asm/fpregdef.h > +++ b/arch/mips/include/asm/fpregdef.h > @@ -14,20 +14,6 @@ > > #include <asm/sgidefs.h> > > -/* > - * starting with binutils 2.24.51.20140729, MIPS binutils warn about mixing > - * hardfloat and softfloat object files. The kernel build uses soft-float by > - * default, so we also need to pass -msoft-float along to GAS if it supports it. > - * But this in turn causes assembler errors in files which access hardfloat > - * registers. We detect if GAS supports "-msoft-float" in the Makefile and > - * explicitly put ".set hardfloat" where floating point registers are touched. > - */ > -#ifdef GAS_HAS_SET_HARDFLOAT > -#define SET_HARDFLOAT .set hardfloat > -#else > -#define SET_HARDFLOAT > -#endif > - > #if _MIPS_SIM == _MIPS_SIM_ABI32 > > /* > diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h > index 99eeafe6dcab..2d53704d9f24 100644 > --- a/arch/mips/include/asm/mipsregs.h > +++ b/arch/mips/include/asm/mipsregs.h > @@ -2367,7 +2367,7 @@ do { \ > /* > * Macros to access the floating point coprocessor control registers > */ > -#define _read_32bit_cp1_register(source, gas_hardfloat) \ > +#define read_32bit_cp1_register(source) \ > ({ \ > unsigned int __res; \ > \ > @@ -2377,36 +2377,24 @@ do { \ > " # gas fails to assemble cfc1 for some archs, \n" \ > " # like Octeon. \n" \ > " .set mips1 \n" \ > - " "STR(gas_hardfloat)" \n" \ > + " .set hardfloat \n" \ > " cfc1 %0,"STR(source)" \n" \ > " .set pop \n" \ > : "=r" (__res)); \ > __res; \ > }) > > -#define _write_32bit_cp1_register(dest, val, gas_hardfloat) \ > +#define write_32bit_cp1_register(dest, val) \ > do { \ > __asm__ __volatile__( \ > " .set push \n" \ > " .set reorder \n" \ > - " "STR(gas_hardfloat)" \n" \ > + " .set hardfloat \n" \ > " ctc1 %0,"STR(dest)" \n" \ > " .set pop \n" \ > : : "r" (val)); \ > } while (0) > > -#ifdef GAS_HAS_SET_HARDFLOAT > -#define read_32bit_cp1_register(source) \ > - _read_32bit_cp1_register(source, .set hardfloat) > -#define write_32bit_cp1_register(dest, val) \ > - _write_32bit_cp1_register(dest, val, .set hardfloat) > -#else > -#define read_32bit_cp1_register(source) \ > - _read_32bit_cp1_register(source, ) > -#define write_32bit_cp1_register(dest, val) \ > - _write_32bit_cp1_register(dest, val, ) > -#endif > - > #ifdef TOOLCHAIN_SUPPORTS_DSP > #define rddsp(mask) \ > ({ \ > diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S > index 3425df6019c0..b6de8e88c1bd 100644 > --- a/arch/mips/kernel/genex.S > +++ b/arch/mips/kernel/genex.S > @@ -480,7 +480,7 @@ NESTED(nmi_handler, PT_SIZE, sp) > .set push > /* gas fails to assemble cfc1 for some archs (octeon).*/ \ > .set mips1 > - SET_HARDFLOAT > + .set hardfloat > cfc1 a1, fcr31 > .set pop > .endm > diff --git a/arch/mips/kernel/r2300_fpu.S b/arch/mips/kernel/r2300_fpu.S > index 2748c55820c2..6c745aa9e825 100644 > --- a/arch/mips/kernel/r2300_fpu.S > +++ b/arch/mips/kernel/r2300_fpu.S > @@ -64,7 +64,7 @@ LEAF(_restore_fp) > */ > LEAF(_save_fp_context) > .set push > - SET_HARDFLOAT > + .set hardfloat > li v0, 0 # assume success > cfc1 t1, fcr31 > EX2(s.d $f0, 0(a0)) > @@ -98,7 +98,7 @@ LEAF(_save_fp_context) > */ > LEAF(_restore_fp_context) > .set push > - SET_HARDFLOAT > + .set hardfloat > li v0, 0 # assume success > EX(lw t0, (a1)) > EX2(l.d $f0, 0(a0)) > diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S > index 2e687c60bc4f..4e8c98517d9d 100644 > --- a/arch/mips/kernel/r4k_fpu.S > +++ b/arch/mips/kernel/r4k_fpu.S > @@ -26,7 +26,7 @@ > > .macro EX insn, reg, src > .set push > - SET_HARDFLOAT > + .set hardfloat > .set nomacro > .ex\@: \insn \reg, \src > .set pop > @@ -98,14 +98,14 @@ LEAF(_init_msa_upper) > */ > LEAF(_save_fp_context) > .set push > - SET_HARDFLOAT > + .set hardfloat > cfc1 t1, fcr31 > .set pop > > #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ > defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) > .set push > - SET_HARDFLOAT > + .set hardfloat > #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) > .set mips32r2 > .set fp=64 > @@ -135,7 +135,7 @@ LEAF(_save_fp_context) > #endif > > .set push > - SET_HARDFLOAT > + .set hardfloat > /* Store the 16 even double precision registers */ > EX sdc1 $f0, 0(a0) > EX sdc1 $f2, 16(a0) > @@ -173,7 +173,7 @@ LEAF(_restore_fp_context) > #if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPSR2) || \ > defined(CONFIG_CPU_MIPSR5) || defined(CONFIG_CPU_MIPSR6) > .set push > - SET_HARDFLOAT > + .set hardfloat > #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR5) > .set mips32r2 > .set fp=64 > @@ -201,7 +201,7 @@ LEAF(_restore_fp_context) > 1: .set pop > #endif > .set push > - SET_HARDFLOAT > + .set hardfloat > EX ldc1 $f0, 0(a0) > EX ldc1 $f2, 16(a0) > EX ldc1 $f4, 32(a0) > diff --git a/arch/mips/kvm/fpu.S b/arch/mips/kvm/fpu.S > index 16f17c6390dd..eb2e8cc3532f 100644 > --- a/arch/mips/kvm/fpu.S > +++ b/arch/mips/kvm/fpu.S > @@ -22,7 +22,7 @@ > > LEAF(__kvm_save_fpu) > .set push > - SET_HARDFLOAT > + .set hardfloat > .set fp=64 > mfc0 t0, CP0_STATUS > sll t0, t0, 5 # is Status.FR set? > @@ -66,7 +66,7 @@ LEAF(__kvm_save_fpu) > > LEAF(__kvm_restore_fpu) > .set push > - SET_HARDFLOAT > + .set hardfloat > .set fp=64 > mfc0 t0, CP0_STATUS > sll t0, t0, 5 # is Status.FR set? > @@ -110,7 +110,7 @@ LEAF(__kvm_restore_fpu) > > LEAF(__kvm_restore_fcsr) > .set push > - SET_HARDFLOAT > + .set hardfloat > lw t0, VCPU_FCR31(a0) > /* > * The ctc1 must stay at this offset in __kvm_restore_fcsr. > > -- > 2.39.0 -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor 2023-01-09 21:18 ` Nick Desaulniers @ 2023-01-10 7:45 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Philippe Mathieu-Daudé @ 2023-01-10 7:45 UTC (permalink / raw) To: Nathan Chancellor, masahiroy, ndesaulniers Cc: nicolas, trix, linux-kbuild, llvm, kernel test robot, tsbogend, linux-mips On 4/1/23 20:54, Nathan Chancellor wrote: > -Wa,-msoft-float is tested with as-option, which will be a problem for > clang with an upcoming change to move as-option to use KBUILD_AFLAGS > instead of KBUILD_CFLAGS due to a lack of '-mno-abicalls' in > KBUILD_AFLAGS at the point that this check occurs; $(cflags-y) is added > to KBUILD_AFLAGS towards the end of this file. > > clang: error: ignoring '-fno-PIE' option as it cannot be used with implicit usage of -mabicalls and the N64 ABI [-Werror,-Woption-ignored] > > This could be resolved by switching to a cc-option check but > '$(cflags-y)' would need to be added so that '-mno-abicalls' is present > for the test. However, this check is no longer necessary, as > -msoft-float is supported by all supported assembler versions (GNU as > 2.25+ and LLVM 11+). Eliminate GAS_HAS_SET_HARDFLOAT and all of its > uses, inlining SET_HARDFLOAT where necessary. > > Link: https://lore.kernel.org/202209101939.bvk64Fok-lkp@intel.com/ > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Nathan Chancellor <nathan@kernel.org> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 11 +--------- > arch/mips/include/asm/asmmacro-32.h | 4 ++-- > arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++++++------------------- > arch/mips/include/asm/fpregdef.h | 14 ------------- > arch/mips/include/asm/mipsregs.h | 20 ++++-------------- > arch/mips/kernel/genex.S | 2 +- > arch/mips/kernel/r2300_fpu.S | 4 ++-- > arch/mips/kernel/r4k_fpu.S | 12 +++++------ > arch/mips/kvm/fpu.S | 6 +++--- > 9 files changed, 40 insertions(+), 75 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor 2023-01-09 21:18 ` Nick Desaulniers 2023-01-10 7:45 ` Philippe Mathieu-Daudé @ 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Thomas Bogendoerfer @ 2023-01-10 8:30 UTC (permalink / raw) To: Nathan Chancellor Cc: masahiroy, ndesaulniers, nicolas, trix, linux-kbuild, llvm, kernel test robot, linux-mips On Wed, Jan 04, 2023 at 12:54:19PM -0700, Nathan Chancellor wrote: > -Wa,-msoft-float is tested with as-option, which will be a problem for > clang with an upcoming change to move as-option to use KBUILD_AFLAGS > instead of KBUILD_CFLAGS due to a lack of '-mno-abicalls' in > KBUILD_AFLAGS at the point that this check occurs; $(cflags-y) is added > to KBUILD_AFLAGS towards the end of this file. > > clang: error: ignoring '-fno-PIE' option as it cannot be used with implicit usage of -mabicalls and the N64 ABI [-Werror,-Woption-ignored] > > This could be resolved by switching to a cc-option check but > '$(cflags-y)' would need to be added so that '-mno-abicalls' is present > for the test. However, this check is no longer necessary, as > -msoft-float is supported by all supported assembler versions (GNU as > 2.25+ and LLVM 11+). Eliminate GAS_HAS_SET_HARDFLOAT and all of its > uses, inlining SET_HARDFLOAT where necessary. > > Link: https://lore.kernel.org/202209101939.bvk64Fok-lkp@intel.com/ > Reported-by: kernel test robot <lkp@intel.com> > Signed-off-by: Nathan Chancellor <nathan@kernel.org> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 11 +--------- > arch/mips/include/asm/asmmacro-32.h | 4 ++-- > arch/mips/include/asm/asmmacro.h | 42 ++++++++++++++++++------------------- > arch/mips/include/asm/fpregdef.h | 14 ------------- > arch/mips/include/asm/mipsregs.h | 20 ++++-------------- > arch/mips/kernel/genex.S | 2 +- > arch/mips/kernel/r2300_fpu.S | 4 ++-- > arch/mips/kernel/r4k_fpu.S | 12 +++++------ > arch/mips/kvm/fpu.S | 6 +++--- > 9 files changed, 40 insertions(+), 75 deletions(-) Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags 2023-01-04 19:54 [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Nathan Chancellor 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor @ 2023-01-04 19:54 ` Nathan Chancellor 2023-01-09 21:21 ` Nick Desaulniers ` (2 more replies) 2023-01-05 8:00 ` [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Heiko Carstens 2 siblings, 3 replies; 10+ messages in thread From: Nathan Chancellor @ 2023-01-04 19:54 UTC (permalink / raw) To: masahiroy, ndesaulniers Cc: nicolas, trix, linux-kbuild, llvm, Nathan Chancellor, kernel test robot, tsbogend, linux-mips A future change will switch as-option to use KBUILD_AFLAGS instead of KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause issues if the flag being tested requires a flag previously added to KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions so that the flags are tested properly. Signed-off-by: Nathan Chancellor <nathan@kernel.org> --- Cc: tsbogend@alpha.franken.de Cc: linux-mips@vger.kernel.org --- arch/mips/Makefile | 2 +- arch/mips/loongson2ef/Platform | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/mips/Makefile b/arch/mips/Makefile index a00a6d94e16f..04e46ec24319 100644 --- a/arch/mips/Makefile +++ b/arch/mips/Makefile @@ -143,7 +143,7 @@ cflags-y += -fno-stack-check # # Avoid this by explicitly disabling that assembler behaviour. # -cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) +cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) # # CPU-dependent compiler/assembler options for optimization. diff --git a/arch/mips/loongson2ef/Platform b/arch/mips/loongson2ef/Platform index eebabf9df6ac..c6f7a4b95997 100644 --- a/arch/mips/loongson2ef/Platform +++ b/arch/mips/loongson2ef/Platform @@ -25,7 +25,7 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f # binutils does not merge support for the flag then we can revisit & remove # this later - for now it ensures vendor toolchains don't cause problems. # -cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) +cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) # Enable the workarounds for Loongson2f ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS -- 2.39.0 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor @ 2023-01-09 21:21 ` Nick Desaulniers 2023-01-10 7:42 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Nick Desaulniers @ 2023-01-09 21:21 UTC (permalink / raw) To: Nathan Chancellor Cc: masahiroy, nicolas, trix, linux-kbuild, llvm, kernel test robot, tsbogend, linux-mips On Wed, Jan 4, 2023 at 11:54 AM Nathan Chancellor <nathan@kernel.org> wrote: > > A future change will switch as-option to use KBUILD_AFLAGS instead of > KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause > issues if the flag being tested requires a flag previously added to > KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions > so that the flags are tested properly. > > Signed-off-by: Nathan Chancellor <nathan@kernel.org> We don't need the trailing comma in the `call`, but it's not worth a v2 IMO. Thanks for the patch. Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 2 +- > arch/mips/loongson2ef/Platform | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/Makefile b/arch/mips/Makefile > index a00a6d94e16f..04e46ec24319 100644 > --- a/arch/mips/Makefile > +++ b/arch/mips/Makefile > @@ -143,7 +143,7 @@ cflags-y += -fno-stack-check > # > # Avoid this by explicitly disabling that assembler behaviour. > # > -cflags-y += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) > +cflags-y += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) > > # > # CPU-dependent compiler/assembler options for optimization. > diff --git a/arch/mips/loongson2ef/Platform b/arch/mips/loongson2ef/Platform > index eebabf9df6ac..c6f7a4b95997 100644 > --- a/arch/mips/loongson2ef/Platform > +++ b/arch/mips/loongson2ef/Platform > @@ -25,7 +25,7 @@ cflags-$(CONFIG_CPU_LOONGSON2F) += -march=loongson2f > # binutils does not merge support for the flag then we can revisit & remove > # this later - for now it ensures vendor toolchains don't cause problems. > # > -cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) > +cflags-$(CONFIG_CPU_LOONGSON2EF) += $(call cc-option,-Wa$(comma)-mno-fix-loongson3-llsc,) > > # Enable the workarounds for Loongson2f > ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS > > -- > 2.39.0 -- Thanks, ~Nick Desaulniers ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor 2023-01-09 21:21 ` Nick Desaulniers @ 2023-01-10 7:42 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Philippe Mathieu-Daudé @ 2023-01-10 7:42 UTC (permalink / raw) To: Nathan Chancellor, masahiroy, ndesaulniers Cc: nicolas, trix, linux-kbuild, llvm, kernel test robot, tsbogend, linux-mips On 4/1/23 20:54, Nathan Chancellor wrote: > A future change will switch as-option to use KBUILD_AFLAGS instead of > KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause > issues if the flag being tested requires a flag previously added to > KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions > so that the flags are tested properly. > > Signed-off-by: Nathan Chancellor <nathan@kernel.org> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 2 +- > arch/mips/loongson2ef/Platform | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor 2023-01-09 21:21 ` Nick Desaulniers 2023-01-10 7:42 ` Philippe Mathieu-Daudé @ 2023-01-10 8:30 ` Thomas Bogendoerfer 2 siblings, 0 replies; 10+ messages in thread From: Thomas Bogendoerfer @ 2023-01-10 8:30 UTC (permalink / raw) To: Nathan Chancellor Cc: masahiroy, ndesaulniers, nicolas, trix, linux-kbuild, llvm, kernel test robot, linux-mips On Wed, Jan 04, 2023 at 12:54:20PM -0700, Nathan Chancellor wrote: > A future change will switch as-option to use KBUILD_AFLAGS instead of > KBUILD_CFLAGS to allow clang to drop -Qunused-arguments, which may cause > issues if the flag being tested requires a flag previously added to > KBUILD_CFLAGS but not KBUILD_AFLAGS. Use cc-option for cflags additions > so that the flags are tested properly. > > Signed-off-by: Nathan Chancellor <nathan@kernel.org> > --- > Cc: tsbogend@alpha.franken.de > Cc: linux-mips@vger.kernel.org > --- > arch/mips/Makefile | 2 +- > arch/mips/loongson2ef/Platform | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de> -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS 2023-01-04 19:54 [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Nathan Chancellor 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor @ 2023-01-05 8:00 ` Heiko Carstens 2 siblings, 0 replies; 10+ messages in thread From: Heiko Carstens @ 2023-01-05 8:00 UTC (permalink / raw) To: Nathan Chancellor Cc: masahiroy, ndesaulniers, nicolas, trix, linux-kbuild, llvm, kernel test robot, tglx, mingo, bp, dave.hansen, x86, tsbogend, linux-mips, mpe, npiggin, christophe.leroy, linuxppc-dev, gor, agordeev, borntraeger, svens, linux-s390, harry.wentland, sunpeng.li, Rodrigo.Siqueira, alexander.deucher, christian.koenig, Xinhui.Pan, amd-gfx, dri-devel On Wed, Jan 04, 2023 at 12:54:18PM -0700, Nathan Chancellor wrote: > Hi all, ... > This series has seen my personal test framework, which tests several different > configurations and architectures, with LLVM tip of tree (16.0.0). I have done > defconfig, allmodconfig, and allnoconfig builds for arm, arm64, i386, mips, > powerpc, riscv, s390, and x86_64 with GCC 12.2.0 as well but I am hoping the > rest of the test infrastructure will catch any lurking problems. > > I would like this series to stay together so that there is no opportunity for > breakage so please consider giving acks so that this can be carried via the > kbuild tree. ... > s390/vdso: Drop unused '-s' flag from KBUILD_AFLAGS_64 > s390/vdso: Drop '-shared' from KBUILD_CFLAGS_64 > s390/purgatory: Remove unused '-MD' and unnecessary '-c' flags ... > arch/s390/kernel/vdso64/Makefile | 4 +-- > arch/s390/purgatory/Makefile | 2 +- For the s390 bits: Acked-by: Heiko Carstens <hca@linux.ibm.com> ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2023-01-10 16:35 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-01-04 19:54 [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Nathan Chancellor 2023-01-04 19:54 ` [PATCH 02/14] MIPS: Always use -Wa,-msoft-float and eliminate GAS_HAS_SET_HARDFLOAT Nathan Chancellor 2023-01-09 21:18 ` Nick Desaulniers 2023-01-10 7:45 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2023-01-04 19:54 ` [PATCH 03/14] MIPS: Prefer cc-option for additions to cflags Nathan Chancellor 2023-01-09 21:21 ` Nick Desaulniers 2023-01-10 7:42 ` Philippe Mathieu-Daudé 2023-01-10 8:30 ` Thomas Bogendoerfer 2023-01-05 8:00 ` [PATCH 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Heiko Carstens
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).