-
-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
musl-cross-make: replace all cross compilers with musl-cross-make
Signed-off-by: Trammell Hudson <[email protected]>
- Loading branch information
1 parent
8af849c
commit 791d064
Showing
15 changed files
with
95 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,62 @@ | ||
CONFIG_MUSL ?= y | ||
|
||
ifeq "$(MUSL_CROSS_ONCE)" "" | ||
MUSL_CROSS_ONCE := 1 | ||
modules-$(CONFIG_MUSL) += musl-cross | ||
|
||
musl-cross_version := 38e52db | ||
musl-cross_dir := musl-cross-$(musl-cross_version) | ||
musl-cross_url := https://github.com/richfelker/musl-cross-make/archive/$(musl-cross_version).tar.gz | ||
musl-cross_tar := musl-cross-$(musl-cross_version).tar.gz | ||
musl-cross_hash := b4b85d6d3ddab0f2b8650a53e775673f8c346fa2fb07d652a9880bd206ade100 | ||
|
||
|
||
ifneq "$(CROSS)" "" | ||
|
||
# check that $(CROSS)gcc exists or else things just won't work | ||
ifneq "y" "$(shell [ -x '$(CROSS)gcc' ] && echo y)" | ||
$(error $(CROSS)gcc does not exist - can not build) | ||
else | ||
$(info Using $(CROSS)gcc) | ||
endif | ||
|
||
# The cross compiler has already been built, so the musl-cross target | ||
# is a NOP. | ||
#musl-cross.intermediate: | ||
# is a NOP. We really don't need to check out this code tree, but it is easier | ||
# if we have a target for it. | ||
musl-cross_target := --version | ||
|
||
musl-cross_dir := musl-cross-ext | ||
$(build)/$(musl-cross_dir)/.build: | ||
mkdir -p $(dir $@) | ||
touch $@ | ||
# Ask the compiler where to find its own libc.so | ||
musl-cross_libraries := \ | ||
$(shell $(CROSS)gcc --print-file-name=libc.so) \ | ||
|
||
else | ||
|
||
# Force a full build of the cross compiler | ||
# have to build both x86_64 and i386 versions for coreboot | ||
|
||
modules-y += musl-cross | ||
musl-cross_version := 1952975 | ||
musl-cross_dir := musl-cross | ||
musl-cross_url := https://github.com/GregorR/musl-cross/archive/$(musl-cross_version).tar.gz | ||
musl-cross_tar := musl-cross-$(musl-cross_version).tar.gz | ||
musl-cross_hash := dea10cfe4bfe5f5b131d8f98e65127cf5093477af56054d15563e858dc3b25cb | ||
musl-cross_configure := \ | ||
/bin/echo -e >> Makefile 'both:' ; \ | ||
/bin/echo -e >> Makefile '\t$$$$(MAKE) TARGET=x86_64-linux-musl install' ; \ | ||
/bin/echo -e >> Makefile '\t$$$$(MAKE) TARGET=i386-linux-musl install' ; \ | ||
|
||
CROSS_TOP := crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- | ||
CROSS := $(build)/../$(CROSS_TOP) | ||
musl-cross_output := ../../$(CROSS_TOP)gcc | ||
CROSS_PATH ?= $(pwd)/crossgcc | ||
|
||
musl-cross_configure := \ | ||
/bin/echo -e > Makefile \ | ||
'$(musl-cross_output):\n\tCC_BASE_PREFIX="$(pwd)/crossgcc" ./build.sh' | ||
musl-cross_target := \ | ||
OUTPUT="$(CROSS_PATH)" \ | ||
MAKE="$(MAKE)" \ | ||
both | ||
|
||
CROSS := $(CROSS_PATH)/bin/x86_64-linux-musl- | ||
musl-cross_libraries := $(CROSS_PATH)/x86_64-linux-musl/lib/libc.so | ||
|
||
endif | ||
|
||
musl-cross_target := | ||
|
||
musl-cross_output := $(CROSS)gcc | ||
|
||
## Fake a target so that musl will force a header install by the | ||
## Linux kernel sources. | ||
$(build)/$(musl-cross_dir)/.build: $(INSTALL)/include/linux/limits.h | ||
|
||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- clean/coreboot-4.8.1/Makefile 2018-05-16 21:00:17.000000000 +0200 | ||
+++ coreboot-4.8.1/Makefile 2020-01-08 17:01:32.998287979 +0100 | ||
@@ -152,6 +152,24 @@ | ||
|
||
-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. \ |