Nico Huber has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84014?usp=email )
Change subject: libpayload: Set reasonable arch defaults ......................................................................
libpayload: Set reasonable arch defaults
This makes it easy to switch between x86_32 and x86_64 in payloads.
Change-Id: I3ac5f24d83dc80db924e92b53403c477e6256c44 Signed-off-by: Arthur Heymans arthur@aheymans.xyz Reviewed-on: https://review.coreboot.org/c/coreboot/+/84014 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M payloads/coreinfo/Makefile M payloads/libpayload/Makefile.payload M payloads/nvramcui/Makefile 3 files changed, 14 insertions(+), 9 deletions(-)
Approvals: build bot (Jenkins): Verified Nico Huber: Looks good to me, approved
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile index 9655e24..c8bf8f0 100644 --- a/payloads/coreinfo/Makefile +++ b/payloads/coreinfo/Makefile @@ -19,8 +19,6 @@ OBJS = $(patsubst %,$(obj)/%,$(OBJECTS)) TARGET = $(obj)/coreinfo.elf
-ARCH := x86_32 - all: real-all
include ../libpayload/Makefile.payload diff --git a/payloads/libpayload/Makefile.payload b/payloads/libpayload/Makefile.payload index 9366987..d2860bf 100644 --- a/payloads/libpayload/Makefile.payload +++ b/payloads/libpayload/Makefile.payload @@ -32,14 +32,8 @@
obj ?= build
-ARCH ?= OBJS ?= CCACHE ?= - -CFLAGS = $(CFLAGS_$(ARCH)) -CFLAGS += -Os -ffreestanding -CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror - STRIP ?= debug
$(TARGET): @@ -78,6 +72,20 @@ Restarting the build should fix that, or explain the problem.) endif
+ifeq ($(CONFIG_LP_ARCH_ARM),y) +ARCH ?= arm +else ifeq ($(CONFIG_LP_ARCH_X86_64),y) +ARCH ?= x86_64 +else ifeq ($(CONFIG_LP_ARCH_X86_32),y) +ARCH ?= x86_32 +else ifeq ($(CONFIG_LP_ARCH_ARM64),y) +ARCH ?= arm64 +endif + +CFLAGS = $(CFLAGS_$(ARCH)) +CFLAGS += -Os -ffreestanding +CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror + # `lpgcc` in in-tree mode: LPGCC = CC="$(CCACHE) $(CC_$(ARCH))" LPGCC += _OBJ="$(LIBPAYLOAD_OBJ)" diff --git a/payloads/nvramcui/Makefile b/payloads/nvramcui/Makefile index cfe279b..a0662cf 100644 --- a/payloads/nvramcui/Makefile +++ b/payloads/nvramcui/Makefile @@ -1,6 +1,5 @@ unexport $(COREBOOT_EXPORTS)
-ARCH = x86_32 OBJS = $(obj)/nvramcui.o TARGET = $(obj)/nvramcui.elf