Skip to content

Commit 5435f73

Browse files
nivedita76ardbiesheuvel
authored andcommitted
efi/x86: Fix build with gcc 4
Commit bbf8e8b ("efi/libstub: Optimize for size instead of speed") changed the optimization level for the EFI stub to -Os from -O2. Andrey Ignatov reports that this breaks the build with gcc 4.8.5. Testing on godbolt.org, the combination of -Os, -fno-asynchronous-unwind-tables, and ms_abi functions doesn't work, failing with the error: sorry, unimplemented: ms_abi attribute requires -maccumulate-outgoing-args or subtarget optimization implying it This does appear to work with gcc 4.9 onwards. Add -maccumulate-outgoing-args explicitly to unbreak the build with pre-4.9 versions of gcc. Reported-by: Andrey Ignatov <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]>
1 parent b3a9e3b commit 5435f73

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/firmware/efi/libstub/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# enabled, even if doing so doesn't break the build.
77
#
88
cflags-$(CONFIG_X86_32) := -march=i386
9-
cflags-$(CONFIG_X86_64) := -mcmodel=small
9+
cflags-$(CONFIG_X86_64) := -mcmodel=small \
10+
$(call cc-option,-maccumulate-outgoing-args)
1011
cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ \
1112
-fPIC -fno-strict-aliasing -mno-red-zone \
1213
-mno-mmx -mno-sse -fshort-wchar \

0 commit comments

Comments
 (0)