summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elements/bootstrap/stage2-sysroot.bst25
-rw-r--r--elements/bootstrap/stage3-sysroot.bst15
-rw-r--r--elements/gnu-toolchain/base-platform.bst23
-rw-r--r--elements/gnu-toolchain/base-sdk.bst20
-rw-r--r--elements/gnu-toolchain/base.bst15
-rw-r--r--elements/gnu-toolchain/binutils.bst4
-rw-r--r--elements/gnu-toolchain/busybox.bst4
-rw-r--r--elements/gnu-toolchain/ccache.bst4
-rw-r--r--elements/gnu-toolchain/fhs-dirs.bst4
-rw-r--r--elements/gnu-toolchain/gawk.bst4
-rw-r--r--elements/gnu-toolchain/gcc.bst4
-rw-r--r--elements/gnu-toolchain/glibc.bst4
-rw-r--r--elements/gnu-toolchain/m4-tarball.bst4
-rw-r--r--elements/gnu-toolchain/make.bst4
-rw-r--r--elements/gnu-toolchain/stage1-binutils.bst9
-rw-r--r--elements/gnu-toolchain/stage1-gcc.bst5
-rw-r--r--elements/gnu-toolchain/stage1.bst3
-rw-r--r--elements/gnu-toolchain/zlib.bst4
-rw-r--r--project.conf26
19 files changed, 130 insertions, 51 deletions
diff --git a/elements/bootstrap/stage2-sysroot.bst b/elements/bootstrap/stage2-sysroot.bst
new file mode 100644
index 00000000..28eeee9d
--- /dev/null
+++ b/elements/bootstrap/stage2-sysroot.bst
@@ -0,0 +1,25 @@
+kind: compose
+
+description: |
+ stage2-sysroot: cross-buildable minimal shell environment + C/C++ toolchain
+
+ This is only useful when bringing up new architectures. For more
+ information see: http://wiki.baserock.org/guides/how-to-cross-bootstrap/
+
+ To build in this environment, you will likely need to delete the symlink
+ from /usr/bin to /tools/bin and replace it with a real directory, containing
+ symlinks from /usr/bin/sh to /tools/bin/sh and from /usr/bin/bash to
+ /tools/bin/bash. If you build GCC with the /usr/bin -> /tools/bin symlink
+ still in place you will end up with a GCC that doesn't work.
+
+depends:
+- filename: gnu-toolchain/stage2.bst
+ type: build
+
+config:
+ # We don't run any integration commands because we might have cross-built the
+ # sysroot using `bst --target-arch=... build`. If this is the case, probably
+ # none of the binaries in the artifact will be able to execute.
+ integrate: false
+
+ exclude: [ debug, doc, locale ]
diff --git a/elements/bootstrap/stage3-sysroot.bst b/elements/bootstrap/stage3-sysroot.bst
new file mode 100644
index 00000000..cc6d0632
--- /dev/null
+++ b/elements/bootstrap/stage3-sysroot.bst
@@ -0,0 +1,15 @@
+kind: compose
+
+description: |
+ stage3-sysroot: clean minimal shell environment + C/C++ toolchain
+
+ Binaries of this are released to https://ostree.baserock.org/releases/ and
+ are in turn used to seed subsequent rebuilds of the Baserock reference
+ systems (via gnu-toolchain/base.bst).
+
+depends:
+- filename: gnu-toolchain.bst
+ type: build
+
+config:
+ exclude: [ debug, doc, locale ]
diff --git a/elements/gnu-toolchain/base-platform.bst b/elements/gnu-toolchain/base-platform.bst
deleted file mode 100644
index ce9cdc0a..00000000
--- a/elements/gnu-toolchain/base-platform.bst
+++ /dev/null
@@ -1,23 +0,0 @@
-kind: import
-description: Import the base freedesktop platform
-config:
- source: files
-public:
- bst:
- integration-commands:
- - ldconfig
-host-arches:
- x86_64:
- sources:
- - kind: ostree
- url: gnomesdk:repo/
- track: runtime/org.freedesktop.BasePlatform/x86_64/1.4
- gpg-key: keys/gnome-sdk.gpg
- ref: c9d09b7250a12ef09d95952fc4f49a35e5f8c2c1dd7141b7eeada4069e6f6576
- i386:
- sources:
- - kind: ostree
- url: gnomesdk:repo/
- track: runtime/org.freedesktop.BasePlatform/i386/1.4
- gpg-key: keys/gnome-sdk.gpg
- ref: 27ebae91839a454596a273391b0e53063eaa8aca4fc9cb64654582bfbc338c96
diff --git a/elements/gnu-toolchain/base-sdk.bst b/elements/gnu-toolchain/base-sdk.bst
deleted file mode 100644
index 61c29f64..00000000
--- a/elements/gnu-toolchain/base-sdk.bst
+++ /dev/null
@@ -1,20 +0,0 @@
-kind: import
-description: Import the base freedesktop SDK
-config:
- source: files
- target: usr
-host-arches:
- x86_64:
- sources:
- - kind: ostree
- url: gnomesdk:repo/
- track: runtime/org.freedesktop.BaseSdk/x86_64/1.4
- gpg-key: keys/gnome-sdk.gpg
- ref: 0d9d255d56b08aeaaffb1c820eef85266eb730cb5667e50681185ccf5cd7c882
- i386:
- sources:
- - kind: ostree
- url: gnomesdk:repo/
- track: runtime/org.freedesktop.BaseSdk/i386/1.4
- gpg-key: keys/gnome-sdk.gpg
- ref: 16036b747c1ec8e7fe291f5b1f667cb942f0267d08fcad962e9b7627d6cf1981
diff --git a/elements/gnu-toolchain/base.bst b/elements/gnu-toolchain/base.bst
new file mode 100644
index 00000000..52b8994f
--- /dev/null
+++ b/elements/gnu-toolchain/base.bst
@@ -0,0 +1,15 @@
+kind: import
+description: Import the base freedesktop platform
+environment:
+ PATH: /tools/bin:/tools/sbin:/usr/bin:/bin:/usr/sbin:/sbin
+public:
+ bst:
+ integration-commands:
+ - ldconfig
+host-arches:
+ x86_64:
+ sources:
+ - kind: ostree
+ url: https://ostree.baserock.org/releases/
+ track: stage3-sysroot/x86_64
+ ref: 176e4ce55460e5c99232681a0ffa7f2425fbf8d1573f7f4dcb9daf2bca737311
diff --git a/elements/gnu-toolchain/binutils.bst b/elements/gnu-toolchain/binutils.bst
index 5983c465..0548af41 100644
--- a/elements/gnu-toolchain/binutils.bst
+++ b/elements/gnu-toolchain/binutils.bst
@@ -22,3 +22,7 @@ config:
- |
./configure --prefix="%{prefix}" --disable-nls --disable-werror \
--with-system-zlib
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/busybox.bst b/elements/gnu-toolchain/busybox.bst
index be14fa51..ef86087c 100644
--- a/elements/gnu-toolchain/busybox.bst
+++ b/elements/gnu-toolchain/busybox.bst
@@ -102,3 +102,7 @@ config:
MANDATORY_MANPATH /usr/share/man
MANDATORY_MANPATH /usr/local/share/man
EOF
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/ccache.bst b/elements/gnu-toolchain/ccache.bst
index f66a37ca..7e435476 100644
--- a/elements/gnu-toolchain/ccache.bst
+++ b/elements/gnu-toolchain/ccache.bst
@@ -26,3 +26,7 @@ config:
done
- for cc in gcc cc g++ c++; do ln -sf "%{prefix}/bin/ccache" "%{install-root}%{prefix}/lib/ccache/%{target}-$cc";
done
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/fhs-dirs.bst b/elements/gnu-toolchain/fhs-dirs.bst
index 36b6236c..7d9702db 100644
--- a/elements/gnu-toolchain/fhs-dirs.bst
+++ b/elements/gnu-toolchain/fhs-dirs.bst
@@ -58,3 +58,7 @@ arches:
(>):
- mkdir -p "%{install-root}/usr/lib64"
- ln -s "./usr/lib64" "%{install-root}/lib64"
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/gawk.bst b/elements/gnu-toolchain/gawk.bst
index 7a612bfd..d00bd6d8 100644
--- a/elements/gnu-toolchain/gawk.bst
+++ b/elements/gnu-toolchain/gawk.bst
@@ -18,3 +18,7 @@ environment:
config:
configure-commands:
- ./configure --prefix="%{prefix}" --disable-nls
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/gcc.bst b/elements/gnu-toolchain/gcc.bst
index e9a54834..5c43ca24 100644
--- a/elements/gnu-toolchain/gcc.bst
+++ b/elements/gnu-toolchain/gcc.bst
@@ -65,3 +65,7 @@ config:
for fortran_alias in f77 f90 f95; do
ln -s gfortran "%{install-root}%{prefix}/bin/$fortran_alias"
done
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/glibc.bst b/elements/gnu-toolchain/glibc.bst
index 9772baa5..a541a771 100644
--- a/elements/gnu-toolchain/glibc.bst
+++ b/elements/gnu-toolchain/glibc.bst
@@ -69,3 +69,7 @@ config:
include /etc/ld.so.conf.d/*.conf
EOF
- install -m 644 -o root -g root ld.so.conf "%{install-root}/etc/ld.so.conf"
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/m4-tarball.bst b/elements/gnu-toolchain/m4-tarball.bst
index 1019c57a..af3732c9 100644
--- a/elements/gnu-toolchain/m4-tarball.bst
+++ b/elements/gnu-toolchain/m4-tarball.bst
@@ -18,3 +18,7 @@ environment:
config:
configure-commands:
- ./configure --prefix="%{prefix}" --disable-gcc-warnings
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/make.bst b/elements/gnu-toolchain/make.bst
index 731d1a9f..c6192008 100644
--- a/elements/gnu-toolchain/make.bst
+++ b/elements/gnu-toolchain/make.bst
@@ -19,3 +19,7 @@ config:
configure-commands:
- ./configure --prefix="%{prefix}" --disable-nls
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/stage1-binutils.bst b/elements/gnu-toolchain/stage1-binutils.bst
index 72d51bcb..d36fa6c0 100644
--- a/elements/gnu-toolchain/stage1-binutils.bst
+++ b/elements/gnu-toolchain/stage1-binutils.bst
@@ -7,14 +7,13 @@ sources:
ref: 5500a97a2ad1735db5b35bc51cfb825c1f4c38df
depends:
-- gnu-toolchain/base-platform.bst
-- gnu-toolchain/base-sdk.bst
+- gnu-toolchain/base.bst
variables:
prefix: /tools
environment:
- PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin
+ PATH: /tools/bin:/tools/sbin:/usr/bin:/bin:/usr/sbin:/sbin
config:
configure-commands:
@@ -36,3 +35,7 @@ config:
--host=$(sh config.guess) \
--target=%{target-stage1} \
--with-sysroot=/nonexistentdir --with-lib-path="=%{prefix}/lib:=%{prefix}/lib64"
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/elements/gnu-toolchain/stage1-gcc.bst b/elements/gnu-toolchain/stage1-gcc.bst
index bcf30bc3..4df5fde7 100644
--- a/elements/gnu-toolchain/stage1-gcc.bst
+++ b/elements/gnu-toolchain/stage1-gcc.bst
@@ -7,15 +7,14 @@ sources:
ref: 3b0dbcfa2e5d12bd80cab1b35f08653d61fe7838
depends:
-- gnu-toolchain/base-platform.bst
-- gnu-toolchain/base-sdk.bst
+- gnu-toolchain/base.bst
- gnu-toolchain/stage1-binutils.bst
variables:
prefix: /tools
environment:
- PATH: /tools/bin:/usr/bin:/bin:/usr/sbin:/sbin
+ PATH: /tools/bin:/tools/sbin:/usr/bin:/bin:/usr/sbin:/sbin
config:
configure-commands:
diff --git a/elements/gnu-toolchain/stage1.bst b/elements/gnu-toolchain/stage1.bst
index 80d3aa43..54465610 100644
--- a/elements/gnu-toolchain/stage1.bst
+++ b/elements/gnu-toolchain/stage1.bst
@@ -1,7 +1,6 @@
kind: stack
depends:
-- gnu-toolchain/base-platform.bst
-- gnu-toolchain/base-sdk.bst
+- gnu-toolchain/base.bst
- gnu-toolchain/stage1-binutils.bst
- gnu-toolchain/stage1-gcc.bst
diff --git a/elements/gnu-toolchain/zlib.bst b/elements/gnu-toolchain/zlib.bst
index 1dd353c5..b7b06bab 100644
--- a/elements/gnu-toolchain/zlib.bst
+++ b/elements/gnu-toolchain/zlib.bst
@@ -21,3 +21,7 @@ config:
- make
install-commands:
- make DESTDIR="%{install-root}" install
+
+ strip-commands:
+ - |
+ %{stage3-strip-binaries}
diff --git a/project.conf b/project.conf
index 18023773..699a1ce8 100644
--- a/project.conf
+++ b/project.conf
@@ -34,6 +34,32 @@ variables:
%{target-stage1}-strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
%{target-stage1}-objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
+ # BuildStream passes `--compress-debug-sections` to objcopy; this would be
+ # great if it worked but in stage3 builds I see errors like this:
+ #
+ # BFD: /buildstream/install/usr/bin/gcc-ranlib: unable to initialize compress status for section .debug_aranges
+ # objcopy:/buildstream/install/usr/bin/gcc-ranlib: Invalid operation
+ #
+ # This causes debug stripping to just not happen, which makes the stage3
+ # sysroot huge. I haven't investigated the cause, but I guess we need to
+ # build zlib in stage2 for the feature to work.
+ stage3-strip-binaries: |
+ find "%{install-root}" -type f \
+ '(' -perm -111 -o -name '*.so*' \
+ -o -name '*.cmxs' -o -name '*.node' ')' \
+ -exec sh -ec \
+ 'read -n4 hdr <"$1" # check for elf header
+ if [ "$hdr" != "$(printf \\x7fELF)" ]; then
+ exit 0
+ fi
+ debugfile="%{install-root}%{debugdir}/$(basename "$1")"
+ mkdir -p "$(dirname "$debugfile")"
+ objcopy --only-keep-debug "$1" "$debugfile"
+ chmod 644 "$debugfile"
+ strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
+ objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
+
+
artifacts:
pull-url: https://ostree.baserock.org/cache/