diff mbox series

[kvm-unit-tests,v2,21/23] x86: Move x86_64-specific EFI CFLAGS to x86_64 Makefile

Message ID 20220506205605.359830-22-nikos.nikoleris@arm.com (mailing list archive)
State New, archived
Headers show
Series EFI and ACPI support for arm64 | expand

Commit Message

Nikos Nikoleris May 6, 2022, 8:56 p.m. UTC
Compiler flag -macculate-outgoing-args is only needed by the x86_64
ABI. Move it to the relevant Makefile.

Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
---
 Makefile            | 4 ----
 x86/Makefile.x86_64 | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Ricardo Koller June 21, 2022, 10:45 p.m. UTC | #1
On Fri, May 06, 2022 at 09:56:03PM +0100, Nikos Nikoleris wrote:
> Compiler flag -macculate-outgoing-args is only needed by the x86_64
> ABI. Move it to the relevant Makefile.
> 
> Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
> ---
>  Makefile            | 4 ----
>  x86/Makefile.x86_64 | 4 ++++
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 6ed5dea..307bc29 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -40,14 +40,10 @@ OBJDIRS += $(LIBFDT_objdir)
>  
>  # EFI App
>  ifeq ($(CONFIG_EFI),y)
> -EFI_ARCH = x86_64

Should this be moved to the x86 Makefile as well? (just in case)

>  EFI_CFLAGS := -DCONFIG_EFI
>  # The following CFLAGS and LDFLAGS come from:
>  #   - GNU-EFI/Makefile.defaults
>  #   - GNU-EFI/apps/Makefile
> -# Function calls must include the number of arguments passed to the functions
> -# More details: https://wiki.osdev.org/GNU-EFI
> -EFI_CFLAGS += -maccumulate-outgoing-args
>  # GCC defines wchar to be 32 bits, but EFI expects 16 bits
>  EFI_CFLAGS += -fshort-wchar
>  # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed
> diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64
> index f18c1e2..ac588ed 100644
> --- a/x86/Makefile.x86_64
> +++ b/x86/Makefile.x86_64
> @@ -2,6 +2,10 @@ cstart.o = $(TEST_DIR)/cstart64.o
>  bits = 64
>  ldarch = elf64-x86-64
>  ifeq ($(CONFIG_EFI),y)
> +# Function calls must include the number of arguments passed to the functions
> +# More details: https://wiki.osdev.org/GNU-EFI
> +CFLAGS += -maccumulate-outgoing-args
> +
>  exe = efi
>  bin = so
>  FORMAT = efi-app-x86_64
> -- 
> 2.25.1
> 

Reviewed-by: Ricardo Koller <ricarkol@google.com>
Nikos Nikoleris June 22, 2022, 1:47 p.m. UTC | #2
Hi Ricardo,

On 21/06/2022 23:45, Ricardo Koller wrote:
> On Fri, May 06, 2022 at 09:56:03PM +0100, Nikos Nikoleris wrote:
>> Compiler flag -macculate-outgoing-args is only needed by the x86_64
>> ABI. Move it to the relevant Makefile.
>>
>> Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
>> ---
>>   Makefile            | 4 ----
>>   x86/Makefile.x86_64 | 4 ++++
>>   2 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/Makefile b/Makefile
>> index 6ed5dea..307bc29 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -40,14 +40,10 @@ OBJDIRS += $(LIBFDT_objdir)
>>   
>>   # EFI App
>>   ifeq ($(CONFIG_EFI),y)
>> -EFI_ARCH = x86_64
> 
> Should this be moved to the x86 Makefile as well? (just in case)

I searched for uses of EFI_ARCH and I couldn't find any. It would be 
good if people more familiar with x86 would approve this though.

Thanks,

Nikos

> 
>>   EFI_CFLAGS := -DCONFIG_EFI
>>   # The following CFLAGS and LDFLAGS come from:
>>   #   - GNU-EFI/Makefile.defaults
>>   #   - GNU-EFI/apps/Makefile
>> -# Function calls must include the number of arguments passed to the functions
>> -# More details: https://wiki.osdev.org/GNU-EFI
>> -EFI_CFLAGS += -maccumulate-outgoing-args
>>   # GCC defines wchar to be 32 bits, but EFI expects 16 bits
>>   EFI_CFLAGS += -fshort-wchar
>>   # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed
>> diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64
>> index f18c1e2..ac588ed 100644
>> --- a/x86/Makefile.x86_64
>> +++ b/x86/Makefile.x86_64
>> @@ -2,6 +2,10 @@ cstart.o = $(TEST_DIR)/cstart64.o
>>   bits = 64
>>   ldarch = elf64-x86-64
>>   ifeq ($(CONFIG_EFI),y)
>> +# Function calls must include the number of arguments passed to the functions
>> +# More details: https://wiki.osdev.org/GNU-EFI
>> +CFLAGS += -maccumulate-outgoing-args
>> +
>>   exe = efi
>>   bin = so
>>   FORMAT = efi-app-x86_64
>> -- 
>> 2.25.1
>>
> 
> Reviewed-by: Ricardo Koller <ricarkol@google.com>
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 6ed5dea..307bc29 100644
--- a/Makefile
+++ b/Makefile
@@ -40,14 +40,10 @@  OBJDIRS += $(LIBFDT_objdir)
 
 # EFI App
 ifeq ($(CONFIG_EFI),y)
-EFI_ARCH = x86_64
 EFI_CFLAGS := -DCONFIG_EFI
 # The following CFLAGS and LDFLAGS come from:
 #   - GNU-EFI/Makefile.defaults
 #   - GNU-EFI/apps/Makefile
-# Function calls must include the number of arguments passed to the functions
-# More details: https://wiki.osdev.org/GNU-EFI
-EFI_CFLAGS += -maccumulate-outgoing-args
 # GCC defines wchar to be 32 bits, but EFI expects 16 bits
 EFI_CFLAGS += -fshort-wchar
 # EFI applications use PIC as they are loaded to dynamic addresses, not a fixed
diff --git a/x86/Makefile.x86_64 b/x86/Makefile.x86_64
index f18c1e2..ac588ed 100644
--- a/x86/Makefile.x86_64
+++ b/x86/Makefile.x86_64
@@ -2,6 +2,10 @@  cstart.o = $(TEST_DIR)/cstart64.o
 bits = 64
 ldarch = elf64-x86-64
 ifeq ($(CONFIG_EFI),y)
+# Function calls must include the number of arguments passed to the functions
+# More details: https://wiki.osdev.org/GNU-EFI
+CFLAGS += -maccumulate-outgoing-args
+
 exe = efi
 bin = so
 FORMAT = efi-app-x86_64