From: Nathan Chancellor <natechancellor@gmail.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org,
Nick Desaulniers <ndesaulniers@google.com>,
Sedat Dilek <sedat.dilek@gmail.com>
Subject: Re: [PATCH] efi/libstub: Disable some warnings for x86{,_64}
Date: Tue, 23 Oct 2018 10:53:09 -0700 [thread overview]
Message-ID: <20181023175309.GA3384@flashbox> (raw)
In-Reply-To: <20181013010348.6740-1-natechancellor@gmail.com>
On Fri, Oct 12, 2018 at 06:03:49PM -0700, Nathan Chancellor wrote:
> When building the kernel with Clang, some disabled warnings appear
> because this Makefile overrides KBUILD_CFLAGS for x86{,_64}. Add them to
> this list so that the build is clean again.
>
> -Wpointer-sign was disabled for the whole kernel before the beginning
> of git history.
>
> -Waddress-of-packed-member was disabled for the whole kernel in
> commit bfb38988c51e ("kbuild: clang: Disable 'address-of-packed-member'
> warning") and for x86/boot/compressed in commit 20c6c1890455 ("x86/boot:
> Disable the address-of-packed-member compiler warning").
>
> -Wgnu was disabled for the whole kernel in commit 61163efae020 ("kbuild:
> LLVMLinux: Add Kbuild support for building kernel with Clang") and for
> x86/boot/compressed in commit 6c3b56b19730 ("x86/boot: Disable Clang
> warnings about GNU extensions").
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/112
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
> ---
>
> Nick expressed concern that this Makefile is overwriting KBUILD_CFLAGS
> and suggested potentially rewriting the x86 portion of this Makefile to
> behave like the arm/arm64 one where problematic flags are filtered out.
> While that comes to fruition, it would be nice for this folder to behave
> like the rest of the kernel when it comes to this warnings so that the
> build is cleaner, thus this patch.
>
> drivers/firmware/efi/libstub/Makefile | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile
> index c51627660dbb..d9845099635e 100644
> --- a/drivers/firmware/efi/libstub/Makefile
> +++ b/drivers/firmware/efi/libstub/Makefile
> @@ -9,7 +9,10 @@ cflags-$(CONFIG_X86_32) := -march=i386
> cflags-$(CONFIG_X86_64) := -mcmodel=small
> cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
> -fPIC -fno-strict-aliasing -mno-red-zone \
> - -mno-mmx -mno-sse -fshort-wchar
> + -mno-mmx -mno-sse -fshort-wchar \
> + -Wno-pointer-sign \
> + $(call cc-disable-warning, address-of-packed-member) \
> + $(call cc-disable-warning, gnu)
>
> # arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
> # disable the stackleak plugin
> --
> 2.19.1
>
+ Sedat for review/testing.
next prev parent reply other threads:[~2018-10-23 17:53 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-13 1:03 [PATCH] efi/libstub: Disable some warnings for x86{,_64} Nathan Chancellor
2018-10-15 19:40 ` Nick Desaulniers
2018-10-15 19:46 ` Nathan Chancellor
2018-10-15 20:16 ` Nick Desaulniers
2018-10-23 17:53 ` Nathan Chancellor [this message]
2018-10-24 7:22 ` Sedat Dilek
2018-11-05 12:52 ` Ard Biesheuvel
2018-11-06 13:15 ` Sedat Dilek
2018-11-06 14:16 ` Ard Biesheuvel
2018-11-08 20:42 ` Nick Desaulniers
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=20181023175309.GA3384@flashbox \
--to=natechancellor@gmail.com \
--cc=ard.biesheuvel@linaro.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=sedat.dilek@gmail.com \
/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