linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Donnellan <ajd@linux.ibm.com>
To: Benjamin Gray <bgray@linux.ibm.com>, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v1] powerpc: Error on assembly warnings
Date: Tue, 02 Apr 2024 15:09:05 +1100	[thread overview]
Message-ID: <ad4c59257e4133d3b99248c89745f569308b8de3.camel@linux.ibm.com> (raw)
In-Reply-To: <20240326044420.577031-1-bgray@linux.ibm.com>

On Tue, 2024-03-26 at 15:44 +1100, Benjamin Gray wrote:
> We currently enable -Werror on the arch/powerpc subtree. However this
> only catches C warnings. Assembly warnings are logged, but the make
> invocation will still succeed. This can allow incorrect syntax such
> as
> 
>   ori r3, r4, r5
> 
> to be compiled without catching that the assembler is treating r5
> as the immediate value 5.
> 
> To prevent this in assembly files and inline assembly, add the
> -fatal-warnings option to assembler invocations.
> 
> Signed-off-by: Benjamin Gray <bgray@linux.ibm.com>

Seems like a good idea to me!

Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com>
Tested-by: Andrew Donnellan <ajd@linux.ibm.com>

> ---
>  arch/powerpc/Kbuild | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/Kbuild b/arch/powerpc/Kbuild
> index 22cd0d55a892..da862e9558bc 100644
> --- a/arch/powerpc/Kbuild
> +++ b/arch/powerpc/Kbuild
> @@ -1,5 +1,6 @@
>  # SPDX-License-Identifier: GPL-2.0
> -subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror
> +subdir-ccflags-$(CONFIG_PPC_WERROR) := -Werror -Wa,-fatal-warnings
> +subdir-asflags-$(CONFIG_PPC_WERROR) := -Wa,-fatal-warnings
>  
>  obj-y += kernel/
>  obj-y += mm/

-- 
Andrew Donnellan    OzLabs, ADL Canberra
ajd@linux.ibm.com   IBM Australia Limited

  reply	other threads:[~2024-04-02  4:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26  4:44 [PATCH v1] powerpc: Error on assembly warnings Benjamin Gray
2024-04-02  4:09 ` Andrew Donnellan [this message]
2024-04-22  8:16 ` Michael Ellerman

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=ad4c59257e4133d3b99248c89745f569308b8de3.camel@linux.ibm.com \
    --to=ajd@linux.ibm.com \
    --cc=bgray@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.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).