diff mbox series

[v10,2/3] x86: correct usage of CFLAGS_NON_EFI

Message ID 20210411092158.5244-3-xypron.glpk@gmx.de
State Accepted
Commit 1598c83ecec64619379834ec21de8efe2536ac3d
Delegated to: Tom Rini
Headers show
Series Add support for stack-protector | expand

Commit Message

Heinrich Schuchardt April 11, 2021, 9:21 a.m. UTC
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>
---
v10:
	new patch
---
 arch/x86/config.mk | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--
2.30.2

Comments

Simon Glass April 14, 2021, 7:38 p.m. UTC | #1
Hi Heinrich,

On Sun, 11 Apr 2021 at 10:23, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> 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>
> ---
> v10:
>         new patch
> ---
>  arch/x86/config.mk | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)

Well it used to be the flags to add when not building EFI apps... I
suppose it doesn't matter so long as it works.

Regards,
Simon
Tom Rini April 20, 2021, 2:21 p.m. UTC | #2
On Sun, Apr 11, 2021 at 11:21:57AM +0200, Heinrich Schuchardt wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

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)