From 3008bb6945adcd78654ebdae73f1fbd4796f13c9 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Tue, 31 Jan 2017 12:45:42 -0500 Subject: [PATCH] Make musl-cross a normal Heads module. This merges pull request #99 by @blackwellops and removes the ./bootstrap script since the musl-cross can be built as part of the normal dependency tree. --- README.md | 4 +--- bootstrap | 28 ---------------------------- modules/musl | 2 +- modules/musl-cross | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 32 deletions(-) delete mode 100755 bootstrap create mode 100644 modules/musl-cross diff --git a/README.md b/README.md index 708381dc..2dd7cc09 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,7 @@ Building heads In order to build reproducible firmware images, Heads builds a specific version of gcc and uses it to compile the Linux kernel and various tools that go into the initrd. Unfortunately this means the first step is a -little slow... After cloning the tree, cd into it and run `./bootstrap` -to download and build binutils, gcc and all of their dependencies into -`./crossgcc/`. +little slow since it will clone the `musl-cross` tree and build gcc... Once that is done, the top level `Makefile` will handle most of the remaining details -- it downloads the various packages, verifies the diff --git a/bootstrap b/bootstrap deleted file mode 100755 index 267d084d..00000000 --- a/bootstrap +++ /dev/null @@ -1,28 +0,0 @@ -#!/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... - -DIRNAME="`dirname $0`" -BASE="`cd "$DIRNAME" ; /bin/pwd `" - -die() { echo >&2 "$@"; exit 1; } - -if [ ! -d build/musl-cross ]; then - cd build - git clone https://github.com/GregorR/musl-cross.git \ - || die "clone failed" - - cd musl-cross - patch -p1 < ../../patches/musl-cross.patch \ - || die "patch of configuration failed!" -else - cd build/musl-cross -fi - -export CC_BASE_PREFIX="$BASE/crossgcc" -echo "export CC_BASE_PREFIX='$CC_BASE_PREFIX'" - -./build.sh \ - || die "compiler build failed!" diff --git a/modules/musl b/modules/musl index 8f51310c..b34a540c 100644 --- a/modules/musl +++ b/modules/musl @@ -27,4 +27,4 @@ musl_configure := ./configure \ musl_target := -j 8 install #musl_target := install -musl_depends := kernel-headers +musl_depends := kernel-headers musl-cross diff --git a/modules/musl-cross b/modules/musl-cross new file mode 100644 index 00000000..a1814dfe --- /dev/null +++ b/modules/musl-cross @@ -0,0 +1,14 @@ +modules += musl-cross + +musl-cross_version := git +musl-cross_dir := musl-cross-$(musl-cross_version) +musl-cross_repo := https://github.com/GregorR/musl-cross + +musl-cross_output := $(pwd)/crossgcc/x86_64-linux-musl/bin/x86_64-linux-musl-gcc + +musl-cross_configure := \ + echo > Makefile -n \ + '$(musl-cross_output):\n\tCC_BASE_PREFIX="$(pwd)/crossgcc" ./build.sh' + +musl-cross_target := +