From 2820220193a4ba871d25b210448a4117c0854637 Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Mon, 17 Feb 2014 16:59:56 +0000 Subject: Re-order system and stratum morphology fields. This is the new canonical ordering. --- build-essential.morph | 221 +++++++++++++++++++++++++------------------------- 1 file changed, 109 insertions(+), 112 deletions(-) (limited to 'build-essential.morph') diff --git a/build-essential.morph b/build-essential.morph index 01630931..387f2b82 100644 --- a/build-essential.morph +++ b/build-essential.morph @@ -1,108 +1,142 @@ +name: build-essential +kind: stratum +description: | + Toolchain stratum + + Stage 1: build a minimal cross compiler with the host's tools. + + Starting with a cross compiler ensures that (a) nothing from the host + can leak into the build-essential artifacts, and (b) cross-compiling + build-essential is fully tested and supported, since we always use the + cross code paths. + + Stage 2: cross-build the whole of build-essential, using the host's tools + but the cross-compiler toolchain. + + Stage 2 GCC outputs code for the same 'bootstrap' machine as stage 1 GCC, + but because stage 2 GCC is also built to *run* on the bootstrap machine + it can only execute inside the stage 3 chroot (due to being built against + a libc with a non-standard prefix). + + Stage 3: build the whole of build-essential again, this time using a + staging area containing only the output of stage 2. The result of this + build is fully reproducible. + + We do a switch-a-roo between stage 2 and 3: stages 2 chunks are all built + to run on a host *-bootstrap-* while stage 3 chunks are native-built for + a *-baserock-* machine. This works, because the cross build was all for + show (and cleanliness) and the binaries actually still run on the host. + + After build-essential is built we do another trick. See + stage2-fhs-dirs.morph for details. Basically, /bin is a symlink to + /tools/bin during stage 2 but in stage 3 it becomes a real directory + again. chunks: -- build-depends: [] +- name: stage1-binutils + repo: upstream:binutils-redhat + ref: baserock/build-essential + build-depends: [] build-mode: bootstrap - name: stage1-binutils prefix: /tools +- name: stage1-gcc + repo: upstream:gcc-tarball ref: baserock/build-essential - repo: upstream:binutils-redhat -- build-depends: + build-depends: - stage1-binutils build-mode: bootstrap - name: stage1-gcc prefix: /tools +- name: stage2-linux-api-headers + repo: upstream:linux ref: baserock/build-essential - repo: upstream:gcc-tarball - -- build-depends: + build-depends: - stage1-binutils - stage1-gcc build-mode: bootstrap - name: stage2-linux-api-headers prefix: /tools - ref: baserock/build-essential - repo: upstream:linux -- build-depends: +- name: stage2-eglibc + repo: upstream:eglibc2 + ref: baserock/2.15-build-essential + build-depends: - stage1-binutils - stage1-gcc - stage2-linux-api-headers build-mode: bootstrap - name: stage2-eglibc prefix: /tools - ref: baserock/2.15-build-essential - repo: upstream:eglibc2 -- build-depends: +- name: stage2-binutils + repo: upstream:binutils-redhat + ref: baserock/build-essential + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc build-mode: bootstrap - name: stage2-binutils prefix: /tools +- name: stage2-gcc-fixed-headers + repo: upstream:gcc-tarball ref: baserock/build-essential - repo: upstream:binutils-redhat -- build-depends: + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc build-mode: bootstrap - name: stage2-gcc-fixed-headers prefix: /tools - ref: baserock/build-essential +- name: stage2-gcc repo: upstream:gcc-tarball -- build-depends: + ref: baserock/build-essential + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc - stage2-gcc-fixed-headers build-mode: bootstrap - name: stage2-gcc prefix: /tools +- name: stage2-busybox + repo: upstream:busybox ref: baserock/build-essential - repo: upstream:gcc-tarball -- build-depends: + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc build-mode: bootstrap - name: stage2-busybox prefix: /tools - ref: baserock/build-essential - repo: upstream:busybox -- build-depends: [] +- name: stage2-fhs-dirs + repo: baserock:baserock/fhs-dirs + ref: master + build-depends: [] build-mode: bootstrap - name: stage2-fhs-dirs prefix: /tools - ref: master - repo: baserock:baserock/fhs-dirs -- build-depends: +- name: stage2-gawk + repo: upstream:gawk + ref: baserock/build-essential + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc build-mode: bootstrap - name: stage2-gawk prefix: /tools +- name: stage2-make + repo: upstream:make ref: baserock/build-essential - repo: upstream:gawk -- build-depends: + build-depends: - stage1-binutils - stage1-gcc - stage2-eglibc build-mode: bootstrap - name: stage2-make prefix: /tools - ref: baserock/build-essential - repo: upstream:make -- build-depends: +- name: stage2-reset-specs + repo: upstream:eglibc2 + ref: baserock/2.15-build-essential + build-depends: - stage1-binutils - stage1-gcc - stage2-linux-api-headers - stage2-eglibc build-mode: bootstrap - name: stage2-reset-specs prefix: /tools - ref: baserock/2.15-build-essential - repo: upstream:eglibc2 - -- build-depends: +- name: fhs-dirs + repo: baserock:baserock/fhs-dirs + ref: master + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -113,11 +147,11 @@ chunks: - stage2-make - stage2-reset-specs build-mode: staging - name: fhs-dirs prefix: /usr - ref: master - repo: baserock:baserock/fhs-dirs -- build-depends: +- name: linux-api-headers + repo: upstream:linux + ref: baserock/build-essential + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -128,11 +162,11 @@ chunks: - stage2-make - stage2-reset-specs build-mode: staging - name: linux-api-headers prefix: /usr - ref: baserock/build-essential - repo: upstream:linux -- build-depends: +- name: eglibc + repo: upstream:eglibc2 + ref: baserock/2.15-build-essential + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -144,11 +178,11 @@ chunks: - stage2-reset-specs - linux-api-headers build-mode: staging - name: eglibc prefix: /usr - ref: baserock/2.15-build-essential - repo: upstream:eglibc2 -- build-depends: +- name: zlib + repo: upstream:zlib + ref: baserock/build-essential + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -160,11 +194,11 @@ chunks: - stage2-reset-specs - eglibc build-mode: staging - name: zlib prefix: /usr +- name: binutils + repo: upstream:binutils-redhat ref: baserock/build-essential - repo: upstream:zlib -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -177,11 +211,11 @@ chunks: - eglibc - zlib build-mode: staging - name: binutils prefix: /usr +- name: busybox + repo: upstream:busybox ref: baserock/build-essential - repo: upstream:binutils-redhat -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -193,11 +227,11 @@ chunks: - stage2-reset-specs - eglibc build-mode: staging - name: busybox prefix: /usr +- name: gawk + repo: upstream:gawk ref: baserock/build-essential - repo: upstream:busybox -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -209,11 +243,11 @@ chunks: - stage2-reset-specs - eglibc build-mode: staging - name: gawk prefix: /usr +- name: gcc + repo: upstream:gcc-tarball ref: baserock/build-essential - repo: upstream:gawk -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -226,11 +260,11 @@ chunks: - eglibc - zlib build-mode: staging - name: gcc prefix: /usr +- name: make + repo: upstream:make ref: baserock/build-essential - repo: upstream:gcc-tarball -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -242,12 +276,11 @@ chunks: - stage2-reset-specs - eglibc build-mode: staging - name: make prefix: /usr +- name: ccache + repo: upstream:ccache ref: baserock/build-essential - repo: upstream:make - -- build-depends: + build-depends: - stage2-binutils - stage2-busybox - stage2-eglibc @@ -260,40 +293,4 @@ chunks: - eglibc - zlib build-mode: staging - name: ccache prefix: /usr - ref: baserock/build-essential - repo: upstream:ccache -description: | - Toolchain stratum - - Stage 1: build a minimal cross compiler with the host's tools. - - Starting with a cross compiler ensures that (a) nothing from the host - can leak into the build-essential artifacts, and (b) cross-compiling - build-essential is fully tested and supported, since we always use the - cross code paths. - - Stage 2: cross-build the whole of build-essential, using the host's tools - but the cross-compiler toolchain. - - Stage 2 GCC outputs code for the same 'bootstrap' machine as stage 1 GCC, - but because stage 2 GCC is also built to *run* on the bootstrap machine - it can only execute inside the stage 3 chroot (due to being built against - a libc with a non-standard prefix). - - Stage 3: build the whole of build-essential again, this time using a - staging area containing only the output of stage 2. The result of this - build is fully reproducible. - - We do a switch-a-roo between stage 2 and 3: stages 2 chunks are all built - to run on a host *-bootstrap-* while stage 3 chunks are native-built for - a *-baserock-* machine. This works, because the cross build was all for - show (and cleanliness) and the binaries actually still run on the host. - - After build-essential is built we do another trick. See - stage2-fhs-dirs.morph for details. Basically, /bin is a symlink to - /tools/bin during stage 2 but in stage 3 it becomes a real directory - again. -kind: stratum -name: build-essential -- cgit v1.2.1