[coreboot-gerrit] New patch to review for coreboot: [DO_NOT_SUBMIT]coreinfo: use coreboot crosscompiler
Martin Roth (martinroth@google.com)
gerrit at coreboot.org
Tue Nov 17 06:33:59 CET 2015
Martin Roth (martinroth at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/12454
-gerrit
commit 8ad117455120ce64c84f7c35d74461cf6cafb623
Author: Martin Roth <martinroth at google.com>
Date: Mon Nov 16 22:33:48 2015 -0700
[DO_NOT_SUBMIT]coreinfo: use coreboot crosscompiler
Initial pass at using the crosscompiler. Restrict to X86_32 GCC only.
Change-Id: I1cc180a5eeaf6cb9a36fdcef70a9819d0f459168
Signed-off-by: Martin Roth <martinroth at google.com>
---
payloads/coreinfo/Makefile | 31 +++++++++++++++++++++++++++++--
1 file changed, 29 insertions(+), 2 deletions(-)
diff --git a/payloads/coreinfo/Makefile b/payloads/coreinfo/Makefile
index 507e535..2ac0650 100644
--- a/payloads/coreinfo/Makefile
+++ b/payloads/coreinfo/Makefile
@@ -63,9 +63,36 @@ OBJECTS = cpuinfo_module.o cpuid.S.o pci_module.o coreboot_module.o \
OBJS = $(patsubst %,$(obj)/%,$(OBJECTS))
TARGET = $(obj)/coreinfo.elf
+all: real-all
+
+# in addition to the dependency below, create the file if it doesn't exist
+# to silence stupid warnings about a file that would be generated anyway.
+$(if $(wildcard .xcompile),,$(eval $(shell ../../util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
+
+.xcompile: ../../util/xcompile/xcompile
+ $< $(XGCCPATH) > $@.tmp
+ \mv -f $@.tmp $@ 2> /dev/null
+
+CONFIG_COMPILER_GCC := y
+ARCH-y := x86_32
+
+include .xcompile
+
+export CC := $(CC_$(ARCH-y))
+export AS := $(AS_$(ARCH-y))
+export LD := $(LD_$(ARCH-y))
+export NM := $(NM_$(ARCH-y))
+export OBJCOPY := $(OBJCOPY_$(ARCH-y))
+export OBJDUMP := $(OBJDUMP_$(ARCH-y))
+export READELF := $(READELF_$(ARCH-y))
+export STRIP := $(STRIP_$(ARCH-y))
+export AR := $(AR_$(ARCH-y))
+
+export CFLAGS += $(CFLAGS_$(ARCH-y))
+
ifneq ($(strip $(HAVE_DOTCONFIG)),)
include $(src)/.config
-all: $(TARGET)
+real-all: $(TARGET)
$(TARGET): $(src)/.config $(obj)/config.h $(OBJS) libpayload
printf " LPCC $(subst $(shell pwd)/,,$(@)) (LINK)\n"
@@ -83,7 +110,7 @@ $(obj)/%.o: $(src)/%.c libpayload
$(LPCC) $(CFLAGS) -c -o $@ $<
else
-all: config
+real-all: config
endif
ifneq ($(strip $(HAVE_LIBPAYLOAD)),)
More information about the coreboot-gerrit
mailing list