]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
efi/libstub: Add $(CLANG_FLAGS) to x86 flags
authorNathan Chancellor <nathan@kernel.org>
Fri, 26 Mar 2021 00:04:35 +0000 (17:04 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 19 May 2021 08:32:00 +0000 (10:32 +0200)
commit168fba28188eefc620ae78c109c86b70bc23cc80
tree4d328976ea8734c2b9897d4521c8c36055f46b81
parente20a7b31bf98f5eb4bd2a77aea6bcb189da04c96
efi/libstub: Add $(CLANG_FLAGS) to x86 flags

BugLink: https://bugs.launchpad.net/bugs/1928857
[ Upstream commit 58d746c119dfa28e72fc35aacaf3d2a3ac625cd0 ]

When cross compiling x86 on an ARM machine with clang, there are several
errors along the lines of:

  arch/x86/include/asm/page_64.h:52:7: error: invalid output constraint '=D' in asm

This happens because the x86 flags in the EFI stub are not derived from
KBUILD_CFLAGS like the other architectures are and the clang flags that
set the target architecture ('--target=') and the path to the GNU cross
tools ('--prefix=') are not present, meaning that the host architecture
is targeted.

These flags are available as $(CLANG_FLAGS) from the main Makefile so
add them to the cflags for x86 so that cross compiling works as expected.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lkml.kernel.org/r/20210326000435.4785-4-nathan@kernel.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/firmware/efi/libstub/Makefile