This set of scripts aim to provide automatic bootstrap facilities for eweOS.
baseandbase-devel: Supportedpythonpackages: TODOrust: Cross-compilation onlyghc: TODOgolang: TODO- ... and more?
The process is split into four stages,
stage0: Cross-compiled. Compile tools to run onbuildplatform. Currently an eweOS-like system is assumed, thus the only target instage0is a LLVM toolchain without runtime libraries.stage1: Cross-compiled. Compile C/C++ libraries, native toolchain, and basic POSIX-compilant environment to run onhostplatform.stage2: Compile natively in rootfs produced bystage1, artifacts are installed directly into the rootfs. Compile base/base-devel components which aren't covered bystage1, to produce a rootfs fully equivalent tobase/base-devel.stage3: Compile natively in rootfs produced bystage1with additional packages produced bystage2. Compile all base/base-devel packages from eweOS mainline, artifacts are in pacman format (*.pkg.tar.*).
stage1 and stage2 are intentionally separated to minimize
cross-compilation for easier maintanence.
The first three stages are driven by GNU Makefiles, to build them, run
# There's no need to manually build stage0, stage1 targets claim dependencies
# to it.
make build/stage1or
make build/stage2stage3 build is driven by stage3/build.sh, which pulls PKGBUILD from
eweOS mainline repository and run
makepkg on them.
A list of packages in base and base-devel is available at stage3/packages.
To build all of them, run
mkdir stage3-built
cd stage3-buil
while read pkg; do
../stage3/build.sh https://github.com/eweOS/packages.git "$pkg" ||
break
done < ../stage3/packagesstage3/build.sh applies stage3/<PKGNAME>.patch if it exists when building
a package, which is useful if patching mainline build scripts is necessary for
breaking dependency loops or minimizing dependencies.
It's separated into three stages,
- Bootstrapping rustc with help of mrustc, which is a Rust compiler written in C++. This step would probably be only maintained for x86_64. TODO.
- Cross-compiling Rustc from one architecture to another. Available.
- Automatically lifting Rust versions. TODO.
Related scripts are located in rust/.
rust/cross-build.sh serves for the purpose, which accepts three arguments,
# Provide absolute path for <TARGET_ROOTFS>
./cross-build.sh <TARGET_ARCH> <RUSTC_VERSION> <TARGET_ROOTFS>
and respects JOBS environment variable.
This script automatically downloads rustc sources, wraps clang as a C/C++
compiler on <TARGET_ROOTFS>, generates config.toml bootstrapping
configuration for rustc, and builds it. Patches (ended with .patch) in
rust/patches/<RUSTC_VERSION> will be applied to rustc source before building.
The following packages must be available on the build side,
rustc: Please note that rustc could only be bootstrapped with compiler exactly one version earlier or with the same version.qemu-userfor<TARGET_ARCH>: Required for wrapping targetllvm-config.zstdcurlllvm
The following packages must be available on the build/target rootfs,
llvm