Skip to content

Commit

Permalink
coreboot-4.12: Use musl-cross-make (#844)
Browse files Browse the repository at this point in the history
* patches/coreboot-4.12: add cross-compiler support patch

Ported from coreboot-4.8.1, re-exported via `git diff`

Signed-off-by: Matt DeVillier <[email protected]>

* modules/coreboot: use musl-cross-make to build

revert toolchain bits to pre-4.12 addition

Signed-off-by: Matt DeVillier <[email protected]>

* config/coreboot-librem_mini: use CONFIG_ANY_TOOLCHAIN

Needed since coreboot 4.12 now built with musl-cross-make

Signed-off-by: Matt DeVillier <[email protected]>
  • Loading branch information
MrChromebox authored Oct 2, 2020
1 parent afa6753 commit 92e9a24
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
3 changes: 2 additions & 1 deletion config/coreboot-librem_mini.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
CONFIG_LOCALVERSION="PureBoot-beta"
CONFIG_LOCALVERSION="heads"
CONFIG_ANY_TOOLCHAIN=y
CONFIG_VENDOR_PURISM=y
CONFIG_INTEL_GMA_VBT_FILE="3rdparty/purism-blobs/mainboard/purism/librem_whl/vbt.bin"
CONFIG_IFD_BIN_PATH="3rdparty/purism-blobs/mainboard/purism/librem_whl/flashdescriptor.bin"
Expand Down
11 changes: 1 addition & 10 deletions modules/coreboot
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,7 @@ coreboot_target := \
coreboot_output := coreboot.rom
coreboot_depend += linux initrd $(musl_dep)

ifeq "$(CONFIG_COREBOOT_VERSION)" "4.8.1"
COREBOOT_TOOLCHAIN=""
$(COREBOOT_TOOLCHAIN):
else
COREBOOT_TOOLCHAIN="$(build)/$(coreboot_base_dir)/.xcompile"
$(COREBOOT_TOOLCHAIN): $(build)/$(coreboot_base_dir)/.canary
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS crossgcc-i386
endif

$(build)/$(coreboot_dir)/.configured: $(COREBOOT_IASL) $(COREBOOT_TOOLCHAIN)
$(build)/$(coreboot_dir)/.configured: $(COREBOOT_IASL)
$(COREBOOT_IASL): $(build)/$(coreboot_base_dir)/.canary
$(MAKE) -C "$(build)/$(coreboot_base_dir)" CPUS=$$CPUS iasl

Expand Down
28 changes: 28 additions & 0 deletions patches/coreboot-4.12/0010-cross-compiler-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/Makefile b/Makefile
index 027aae2faa..8251a9a478 100644
--- a/Makefile
+++ b/Makefile
@@ -176,6 +176,23 @@ $(if $(wildcard .xcompile)$(NOCOMPILE),,$(eval $(shell util/xcompile/xcompile $(

-include .xcompile

+ifneq "$(CROSS)" ""
+ $(info coreboot: Using $(CROSS)gcc)
+ CROSS_COMPILE_x86_32 := $(CROSS)
+ CC_x86_32 := $(CROSS_COMPILE_x86_32)gcc
+ CPP_x86_32 := $(CROSS_COMPILE_x86_32)cpp
+ AS_x86_32 := $(CROSS_COMPILE_x86_32)as --32
+ LD_x86_32 := $(CROSS_COMPILE_x86_32)ld.bfd -b elf32-i386 -melf_i386
+ NM_x86_32 := $(CROSS_COMPILE_x86_32)nm
+ OBJCOPY_x86_32 := $(CROSS_COMPILE_x86_32)objcopy
+ OBJDUMP_x86_32 := $(CROSS_COMPILE_x86_32)objdump
+ READELF_x86_32 := $(CROSS_COMPILE_x86_32)readelf
+ STRIP_x86_32 := $(CROSS_COMPILE_x86_32)strip
+ AR_x86_32 := $(CROSS_COMPILE_x86_32)ar
+ GNATBIND_x86_32 := $(CROSS_COMPILE_x86_32)gnatbind
+ COMPILER_RT_x86_32 := $(shell $(CC_x86_32) --print-libgcc-file-name)
+endif
+
ifneq ($(XCOMPILE_COMPLETE),1)
$(shell rm -f .xcompile)
$(error .xcompile deleted because it's invalid. \

0 comments on commit 92e9a24

Please sign in to comment.