Skip to content

Commit bc24381

Browse files
nathanchancegregkh
authored andcommitted
efi/libstub: Add $(CLANG_FLAGS) to x86 flags
[ Upstream commit 58d746c ] 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>
1 parent 8829b6c commit bc24381

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎drivers/firmware/efi/libstub/Makefile‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
1313
-Wno-pointer-sign \
1414
$(call cc-disable-warning, address-of-packed-member) \
1515
$(call cc-disable-warning, gnu) \
16-
-fno-asynchronous-unwind-tables
16+
-fno-asynchronous-unwind-tables \
17+
$(CLANG_FLAGS)
1718

1819
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
1920
# disable the stackleak plugin

0 commit comments

Comments
 (0)