summaryrefslogtreecommitdiff
path: root/arch/x86
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2021-04-11 12:21:57 +0300
committerTom Rini <trini@konsulko.com>2021-04-20 14:31:12 +0300
commit1598c83ecec64619379834ec21de8efe2536ac3d (patch)
tree6db09e95354b6486841b39bb6a7ec0ecb3525cc1 /arch/x86
parent1b8897c63e4c4eedd55f69f9728cd49f2a1cddba (diff)
downloadu-boot-1598c83ecec64619379834ec21de8efe2536ac3d.tar.xz
x86: correct usage of CFLAGS_NON_EFI
The current usage of the variable CFLAGS_NON_EFI on the x86 architecture deviates from other architectures. Variable CFLAGS_NON_EFI is the list of compiler flags to be removed when building UEFI applications. It is not a list of flags to be added anywhere. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/config.mk10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/config.mk b/arch/x86/config.mk
index 27d8412661..3067702858 100644
--- a/arch/x86/config.mk
+++ b/arch/x86/config.mk
@@ -39,10 +39,10 @@ LDFLAGS_EFI_PAYLOAD := -Bsymbolic -Bsymbolic-functions -shared --no-undefined -s
OBJCOPYFLAGS_EFI := -j .text -j .sdata -j .data -j .dynamic -j .dynsym \
-j .rel -j .rela -j .reloc
-ifeq ($(IS_32BIT),y)
-CFLAGS_NON_EFI := -mregparm=3
-endif
+# Compiler flags to be added when building UEFI applications
CFLAGS_EFI := -fpic -fshort-wchar
+# Compiler flags to be removed when building UEFI applications
+CFLAGS_NON_EFI := -mregparm=3
ifeq ($(CONFIG_EFI_STUB_64BIT),)
CFLAGS_EFI += $(call cc-option, -mno-red-zone)
@@ -70,7 +70,9 @@ LDSCRIPT := $(LDSCRIPT_EFI)
else
-PLATFORM_CPPFLAGS += $(CFLAGS_NON_EFI)
+ifeq ($(IS_32BIT),y)
+PLATFORM_CPPFLAGS += -mregparm=3
+endif
KBUILD_LDFLAGS += --emit-relocs
LDFLAGS_FINAL += --gc-sections $(if $(CONFIG_SPL_BUILD),,-pie)