mirror of
https://github.com/linuxboot/heads.git
synced 2024-12-18 20:47:55 +00:00
bootstrap the musl-libc gcc cross compiler and use it to build everything except coreboot
This commit is contained in:
parent
5c425b3ec9
commit
2213500000
25
bootstrap
Executable file
25
bootstrap
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/sh
|
||||
# Download and build the musl-libc cross compiler.
|
||||
# This should be worked around eventually to use the coreboot
|
||||
# cross compile suite that we've already built, but for now
|
||||
# we'll download yet another copy of gcc...
|
||||
|
||||
PWD="`dirname $0`"
|
||||
|
||||
die() { echo >&2 "$@"; exit 1; }
|
||||
|
||||
if [ -d build/musl-cross ]; then
|
||||
die "cross compiler already built?"
|
||||
fi
|
||||
|
||||
cd build
|
||||
hg clone https://bitbucket.org/GregorR/musl-cross \
|
||||
|| die "clone failed"
|
||||
|
||||
cd musl-cross
|
||||
patch -p1 < ../../patches/musl-cross.patch \
|
||||
|| die "patch of configuration failed!"
|
||||
|
||||
export CC_BASE_PREFIX="$PWD/crossgcc"
|
||||
./build.sh \
|
||||
|| die "compiler build failed!"
|
@ -11,7 +11,15 @@ linux-4.9_hash := 029098dcffab74875e086ae970e3828456838da6e0ba22ce3f64ef764f3d7f
|
||||
|
||||
linux_hash := $(linux-$(linux_version)_hash)
|
||||
|
||||
linux_configure := $(MAKE) oldconfig
|
||||
linux_configure := \
|
||||
$(MAKE) \
|
||||
CROSS_COMPILE=$(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- \
|
||||
oldconfig \
|
||||
|
||||
linux_output := arch/x86/boot/bzImage
|
||||
linux_config := linux.config
|
||||
linux_target := -j 8 bzImage
|
||||
|
||||
linux_target := \
|
||||
CROSS_COMPILE=$(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl- \
|
||||
-j 8 \
|
||||
bzImage
|
||||
|
@ -18,7 +18,13 @@ musl_output := $(INSTALL)/bin/musl-gcc
|
||||
musl_configure := ./configure \
|
||||
--prefix="$(INSTALL)" \
|
||||
--syslibdir="/lib" \
|
||||
--enable-gcc-wrapper \
|
||||
--enable-shared \
|
||||
CC=$(HOME)/heads/crossgcc/x86_64-linux-musl/bin/x86_64-musl-linux-gcc
|
||||
|
||||
|
||||
|
||||
musl_target := -j 8 install
|
||||
#musl_target := install
|
||||
|
||||
musl_depends := kernel-headers
|
||||
|
40
patches/musl-cross.patch
Normal file
40
patches/musl-cross.patch
Normal file
@ -0,0 +1,40 @@
|
||||
diff -r c004067a7b34 config.sh
|
||||
--- a/config.sh Sun Oct 02 20:51:04 2016 -0400
|
||||
+++ b/config.sh Fri Jan 27 17:47:25 2017 -0500
|
||||
@@ -1,13 +1,15 @@
|
||||
# ARCH will be auto-detected as the host if not specified
|
||||
#ARCH=i486
|
||||
-#ARCH=x86_64
|
||||
+ARCH=x86_64
|
||||
#ARCH=powerpc
|
||||
#ARCH=arm
|
||||
#ARCH=microblaze
|
||||
#ARCH=mips
|
||||
#ARCH=mipsel
|
||||
|
||||
-CC_BASE_PREFIX=/opt/cross
|
||||
+if [ -z "$CC_BASE_PREFIX" ]; then
|
||||
+ CC_BASE_PREFIX=$HOME/heads/install
|
||||
+fi
|
||||
|
||||
# If you use arm, you may need more fine-tuning:
|
||||
# arm hardfloat v7
|
||||
@@ -24,3 +26,6 @@
|
||||
|
||||
# Enable this to build the bootstrap gcc (thrown away) without optimization, to reduce build time
|
||||
GCC_STAGE1_NOOPT=1
|
||||
+
|
||||
+# Build GMP, MPFR and MPC
|
||||
+GCC_BUILTIN_PREREQS=yes
|
||||
diff -r c004067a7b34 defs.sh
|
||||
--- a/defs.sh Sun Oct 02 20:51:04 2016 -0400
|
||||
+++ b/defs.sh Fri Jan 27 17:47:25 2017 -0500
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
# musl can optionally be checked out from GIT, in which case MUSL_VERSION must
|
||||
# be set to a git tag and MUSL_GIT set to yes in config.sh
|
||||
-MUSL_DEFAULT_VERSION=1.1.12
|
||||
+MUSL_DEFAULT_VERSION=1.1.15
|
||||
MUSL_GIT_VERSION=615629bd6fcd6ddb69ad762e679f088c7bd878e2
|
||||
MUSL_GIT_REPO='git://repo.or.cz/musl.git'
|
||||
MUSL_VERSION="$MUSL_DEFAULT_VERSION"
|
Loading…
Reference in New Issue
Block a user