linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: trix@redhat.com, dave.hansen@linux.intel.com,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
	linux-s390@vger.kernel.org, "kernel test robot" <lkp@intel.com>,
	x86@kernel.org, mingo@redhat.com, llvm@lists.linux.dev,
	nicolas@fjasle.eu, linux-kbuild@vger.kernel.org,
	"Heiko Carstens" <hca@linux.ibm.com>,
	npiggin@gmail.com, bp@alien8.de, tglx@linutronix.de,
	"Thomas Bogendoerfer" <tsbogend@alpha.franken.de>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>,
	ndesaulniers@google.com, linux-mips@vger.kernel.org,
	"Sven Schnelle" <svens@linux.ibm.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS
Date: Mon, 23 Jan 2023 02:28:32 +0900	[thread overview]
Message-ID: <CAK7LNAQ-HmyKYAWbF2MHEU1FzBzKOvE2DU7Js6tntszLrtUkDg@mail.gmail.com> (raw)
In-Reply-To: <20221228-drop-qunused-arguments-v2-0-9adbddd20d86@kernel.org>

On Thu, Jan 12, 2023 at 12:05 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> 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 (and many thanks to the people who have already provided such
> tags).


All applied to linux-kbuild. Thanks.

I left small comments in 07/14.








> ---
> Changes in v2:
> - Pick up tags where provided (thank you everyone!)
> - Patch 6 and 9: Clarify that '-s' is a compiler flag that is only relevant to
>   the linking phase and remove all mention of the assembler's '-s' flag, as the
>   assembler is never directly invoked (Nick, Segher)
> - Patch 7: Move '-z noexecstack' into new ldflags-y variable (Nick)
> - Patch 8: Reword commit message to explain the problem in a clearer manner
>   (Nick)
> - Link to v1: https://lore.kernel.org/r/20221228-drop-qunused-arguments-v1-0-658cbc8fc592@kernel.org
>
> ---
> 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>
>


--
Best Regards
Masahiro Yamada

  parent reply	other threads:[~2023-01-22 17:30 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-12  3:04 [PATCH v2 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Nathan Chancellor
2023-01-12  3:05 ` [PATCH v2 05/14] powerpc: Remove linker flag from KBUILD_AFLAGS Nathan Chancellor
2023-01-25  4:11   ` Michael Ellerman
2023-01-26  1:29     ` Masahiro Yamada
2023-01-26  2:07       ` Nathan Chancellor
2023-01-26  4:22         ` Masahiro Yamada
2023-01-26 10:05           ` Michael Ellerman
2023-01-12  3:05 ` [PATCH v2 06/14] powerpc/vdso: Remove unused '-s' flag from ASFLAGS Nathan Chancellor
2023-01-25  4:12   ` Michael Ellerman
2023-01-12  3:05 ` [PATCH v2 07/14] powerpc/vdso: Improve linker flags Nathan Chancellor
2023-01-12 18:02   ` Sedat Dilek
2023-01-12 18:21     ` Nathan Chancellor
2023-01-12 18:47       ` Sedat Dilek
2023-01-22 17:27       ` Masahiro Yamada
2023-01-22 18:01         ` Nathan Chancellor
2023-01-23 15:07   ` Segher Boessenkool
2023-01-24 16:14     ` Nathan Chancellor
2023-01-24 16:30       ` Segher Boessenkool
2023-01-12  3:05 ` [PATCH v2 08/14] powerpc/vdso: Remove an unsupported flag from vgettimeofday-32.o with clang Nathan Chancellor
2023-01-22 17:28 ` Masahiro Yamada [this message]
2023-01-23 13:58 ` [PATCH v2 00/14] Remove clang's -Qunused-arguments from KBUILD_CPPFLAGS Naresh Kamboju
2023-01-23 16:11   ` Nathan Chancellor
2023-01-24 15:29     ` Naresh Kamboju

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAK7LNAQ-HmyKYAWbF2MHEU1FzBzKOvE2DU7Js6tntszLrtUkDg@mail.gmail.com \
    --to=masahiroy@kernel.org \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hca@linux.ibm.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=nicolas@fjasle.eu \
    --cc=npiggin@gmail.com \
    --cc=philmd@linaro.org \
    --cc=svens@linux.ibm.com \
    --cc=tglx@linutronix.de \
    --cc=trix@redhat.com \
    --cc=tsbogend@alpha.franken.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).