Arthur Heymans has uploaded this change for review. ( 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 --- M payloads/libpayload/Makefile.payload M payloads/nvramcui/Makefile 2 files changed, 19 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/14/84014/1
diff --git a/payloads/libpayload/Makefile.payload b/payloads/libpayload/Makefile.payload index 9366987..34e1f3b 100644 --- a/payloads/libpayload/Makefile.payload +++ b/payloads/libpayload/Makefile.payload @@ -32,16 +32,6 @@
obj ?= build
-ARCH ?= -OBJS ?= -CCACHE ?= - -CFLAGS = $(CFLAGS_$(ARCH)) -CFLAGS += -Os -ffreestanding -CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror - -STRIP ?= debug - $(TARGET):
# Make is silent per default, but `make V=1` will show all calls. @@ -78,6 +68,25 @@ 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 + +OBJS ?= +CCACHE ?= + +CFLAGS = $(CFLAGS_$(ARCH)) +CFLAGS += -Os -ffreestanding +CFLAGS += -Wall -Wextra -Wmissing-prototypes -Wvla -Werror + +STRIP ?= debug + # `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