Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/firmware/efi/libstub/Makefile overwrites KBUILD_CFLAGS for x86[_64] #112

Closed
tpimh opened this issue Sep 18, 2018 · 12 comments

Comments

Projects
None yet
4 participants
@tpimh
Copy link

commented Sep 18, 2018

These repeat a lot:

./arch/x86/include/asm/processor.h:555:17: warning: taking address of packed member 'sp0' of class or structure 'x86_hw_tss' may result in
      an unaligned pointer value [-Waddress-of-packed-member]
        this_cpu_write(cpu_tss_rw.x86_tss.sp0, sp0);
                       ^~~~~~~~~~~~~~~~~~~~~~
./include/linux/percpu-defs.h:510:68: note: expanded from macro 'this_cpu_write'
#define this_cpu_write(pcp, val)        __pcpu_size_call(this_cpu_write_, pcp, val)
                                                                          ^~~
./include/linux/percpu-defs.h:377:22: note: expanded from macro '__pcpu_size_call'
        __verify_pcpu_ptr(&(variable));                                 \
                            ^~~~~~~~
./include/linux/percpu-defs.h:221:47: note: expanded from macro '__verify_pcpu_ptr'
        const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL;    \
                                                     ^~~

./arch/x86/include/asm/processor.h:572:30: warning: taking address of packed member 'sp1' of class or structure 'x86_hw_tss' may result in
      an unaligned pointer value [-Waddress-of-packed-member]
        return this_cpu_read_stable(cpu_current_top_of_stack);
                                    ^~~~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/processor.h:379:34: note: expanded from macro 'cpu_current_top_of_stack'
#define cpu_current_top_of_stack cpu_tss_rw.x86_tss.sp1
                                 ^~~~~~~~~~~~~~~~~~~~~~
./arch/x86/include/asm/percpu.h:392:59: note: expanded from macro 'this_cpu_read_stable'
#define this_cpu_read_stable(var)       percpu_stable_op("mov", var)
                                                                ^~~
./arch/x86/include/asm/percpu.h:219:16: note: expanded from macro 'percpu_stable_op'
                    : "p" (&(var)));                    \
                             ^~~
@nickdesaulniers

This comment has been minimized.

Copy link
Member

commented Sep 19, 2018

IIRC, this warning was disabled in the top level Makefile, but someone probably steamrolled KBUILD_CFLAGS. Can you post the .c file that triggered this warning? I'll bet 💵 that it's arch/x86/boot.

@tpimh

This comment has been minimized.

Copy link
Author

commented Sep 19, 2018

In file included from drivers/firmware/efi/libstub/efi-stub-helper.c:13:
…

In file included from drivers/firmware/efi/libstub/gop.c:10:
…

In file included from drivers/firmware/efi/libstub/secureboot.c:12:
…

In file included from drivers/firmware/efi/libstub/tpm.c:12:
In file included from ./include/linux/efi.h:17:
In file included from ./include/linux/time.h:6:
In file included from ./include/linux/seqlock.h:36:
In file included from ./include/linux/spinlock.h:51:
In file included from ./include/linux/preempt.h:81:
In file included from ./arch/x86/include/asm/preempt.h:7:
In file included from ./include/linux/thread_info.h:38:
In file included from ./arch/x86/include/asm/thread_info.h:53:
In file included from ./arch/x86/include/asm/cpufeature.h:5:

@tpimh tpimh added the [ARCH] x86_64 label Sep 19, 2018

@nickdesaulniers nickdesaulniers changed the title -Waddress-of-packed-member in arch/x86/include/asm/processor.h drivers/firmware/efi/libstub/Makefile overwrites KBUILD_CFLAGS for x86[_64] Sep 24, 2018

@nathanchance

This comment has been minimized.

Copy link
Member

commented Sep 25, 2018

Should we just apply commits 6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions") and bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning") to that Makefile? I know rewriting the Makefile was suggested but it seems like steamrolling the CFLAGS is intentional for x86{,_64}.

@nickdesaulniers

This comment has been minimized.

Copy link
Member

commented Sep 25, 2018

If it was intentional, I'd be curious as to know why.

@nathanchance

This comment has been minimized.

Copy link
Member

commented Sep 25, 2018

From the top of the Makefile:

# The stub may be linked into the kernel proper or into a separate boot binary,
# but in either case, it executes before the kernel does (with MMU disabled) so
# things like ftrace and stack-protector are likely to cause trouble if left
# enabled, even if doing so doesn't break the build.
#
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

I guess it could be converted to be like arm/arm64:

# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
# disable the s.tackleak plugin
cflags-$(CONFIG_ARM64)          := $(subst -pg,,$(KBUILD_CFLAGS)) -fpie \
                                   $(DISABLE_STACKLEAK_PLUGIN)
cflags-$(CONFIG_ARM)            := $(subst -pg,,$(KBUILD_CFLAGS)) \
                                   -fno-builtin -fpic -mno-single-pic-base

Not sure though, I'll dig through git history here shortly.

@nathanchance

This comment has been minimized.

Copy link
Member

commented Sep 26, 2018

That steamroll has been present since the introduction of the file in commit f4f75ad ("efi: efistub: Convert into static library"). Second paragraph I'm sure it relevant.

@nathanchance

This comment has been minimized.

Copy link
Member

commented Oct 13, 2018

Patch sent to mailing list for further discussion: https://lore.kernel.org/lkml/20181013010348.6740-1-natechancellor@gmail.com/

@nathanchance nathanchance self-assigned this Oct 13, 2018

fengguang pushed a commit to 0day-ci/linux that referenced this issue Oct 13, 2018

efi/libstub: Disable some warnings for x86{,_64}
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 bfb3898 ("kbuild: clang: Disable 'address-of-packed-member'
warning") and for x86/boot/compressed in commit 20c6c18 ("x86/boot:
Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel in commit 61163ef ("kbuild:
LLVMLinux: Add Kbuild support for building kernel with Clang") and for
x86/boot/compressed in commit 6c3b56b ("x86/boot: Disable Clang
warnings about GNU extensions").

Link: ClangBuiltLinux#112
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
@dileks

This comment has been minimized.

Copy link

commented Oct 23, 2018

OK. This is indeed a duplicate of #234. Can you please do a v2 with credits and TO/CC to maintainers (check with scripts/get_maintainer.pl)? Feel free to add my Reviewed-by/Tested-by. Thanks.

@nathanchance

This comment has been minimized.

Copy link
Member

commented Oct 23, 2018

@dileks thanks for testing! I did send it to the proper mailing lists and maintainers and since it hasn't been more than two weeks since I sent it out, I don't think a resend/v2 is necessary just yet (especially with the merge window happening right now).

Would you like me to send a email with those tags and you CC'd to the current revision then I'll carry those in any further revisions I need to do?

@dileks

This comment has been minimized.

Copy link

commented Oct 23, 2018

blissgerrit pushed a commit to Jackeagle/kernel_msm that referenced this issue Oct 25, 2018

FROMLIST: efi/libstub: Disable some warnings for x86{,_64}
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 bfb3898 ("kbuild: clang: Disable 'address-of-packed-member'
warning") and for x86/boot/compressed in commit 20c6c18 ("x86/boot:
Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel in commit 61163ef ("kbuild:
LLVMLinux: Add Kbuild support for building kernel with Clang") and for
x86/boot/compressed in commit 6c3b56b ("x86/boot: Disable Clang
warnings about GNU extensions").

Link: ClangBuiltLinux/linux#112
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
(am from https://lore.kernel.org/patchwork/patch/999058/)
(also found at https://lkml.kernel.org/r/20181013010348.6740-1-natechancellor@gmail.com)

BUG=chromium:897984
TEST=build for lakitu

Change-Id: Ibe18a22243f5c99c3ceb5b93f8a648ffaa1c7f66
Signed-off-by: Guenter Roeck <groeck@chromium.org>

bhupesh-sharma pushed a commit to bhupesh-sharma/linux that referenced this issue Nov 8, 2018

efi/libstub: Disable some warnings for x86{,_64}
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 bfb3898 ("kbuild: clang: Disable 'address-of-packed-member'
warning") and for x86/boot/compressed in commit 20c6c18 ("x86/boot:
Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel in commit 61163ef ("kbuild:
LLVMLinux: Add Kbuild support for building kernel with Clang") and for
x86/boot/compressed in commit 6c3b56b ("x86/boot: Disable Clang
warnings about GNU extensions").

Link: ClangBuiltLinux/linux#112
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

vathpela pushed a commit to vathpela/linux that referenced this issue Nov 29, 2018

efi/libstub: Disable some warnings for x86{,_64}
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 bfb3898 ("kbuild: clang: Disable 'address-of-packed-member'
warning") and for x86/boot/compressed in commit 20c6c18 ("x86/boot:
Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel in commit 61163ef ("kbuild:
LLVMLinux: Add Kbuild support for building kernel with Clang") and for
x86/boot/compressed in commit 6c3b56b ("x86/boot: Disable Clang
warnings about GNU extensions").

Link: ClangBuiltLinux#112
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

sean-jc pushed a commit to sean-jc/linux that referenced this issue Dec 4, 2018

efi/libstub: Disable some warnings for x86{,_64}
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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>

woodsts pushed a commit to woodsts/linux-stable that referenced this issue Jan 26, 2019

efi/libstub: Disable some warnings for x86{,_64}
[ Upstream commit 3db5e0b ]

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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux/linux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

Whissi pushed a commit to Whissi/linux-stable that referenced this issue Jan 26, 2019

efi/libstub: Disable some warnings for x86{,_64}
[ Upstream commit 3db5e0b ]

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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux/linux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

isjerryxiao added a commit to archlinux-jerry/Amlogic_s905-kernel that referenced this issue Jan 26, 2019

efi/libstub: Disable some warnings for x86{,_64}
[ Upstream commit 3db5e0ba8b8f4aee631d7ee04b7a11c56cfdc213 ]

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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux/linux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>

mseaster-wr pushed a commit to WindRiver-Labs/linux-yocto-4.18 that referenced this issue Apr 1, 2019

efi/libstub: Disable some warnings for x86{,_64}
commit 3db5e0ba8b8f4aee631d7ee04b7a11c56cfdc213 upstream.

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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux/linux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Staars added a commit to Staars/linux-stable that referenced this issue May 11, 2019

efi/libstub: Disable some warnings for x86{,_64}
[ Upstream commit 3db5e0b ]

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 and for
the early boot code in these commits:

  bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c18 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]

Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Arend van Spriel <arend.vanspriel@broadcom.com>
Cc: Bhupesh Sharma <bhsharma@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Eric Snowberg <eric.snowberg@oracle.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Joe Perches <joe@perches.com>
Cc: Jon Hunter <jonathanh@nvidia.com>
Cc: Julien Thierry <julien.thierry@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Matt Fleming <matt@codeblueprint.co.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: YiFei Zhu <zhuyifei1999@gmail.com>
Cc: linux-efi@vger.kernel.org
Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org
Link: ClangBuiltLinux/linux#112
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.