Files
RedBear-OS/recipes/dev/gcc13/recipe.toml
T
vasilito 50b731f1b7 Red Bear OS — microkernel OS in Rust, based on Redox
Derivative of Redox OS (https://www.redox-os.org) adding:
- AMD GPU driver (amdgpu) via LinuxKPI compat layer
- ext4 filesystem support (ext4d scheme daemon)
- ACPI fixes for AMD bare metal (x2APIC, DMAR, IVRS, MCFG)
- Custom branding (hostname, os-release, boot identity)

Build system is full upstream Redox with RBOS overlay in local/.
Patches for kernel, base, and relibc are symlinked from local/patches/
and protected from make clean/distclean. Custom recipes live in
local/recipes/ with symlinks into the recipes/ search path.

Build:  make all CONFIG_NAME=redbear-full
Sync:   ./local/scripts/sync-upstream.sh
2026-04-12 19:05:00 +01:00

109 lines
3.0 KiB
TOML

[source]
git = "https://gitlab.redox-os.org/redox-os/gcc"
branch = "redox-13.2.0"
shallow_clone = true
script = """
DYNAMIC_INIT
COOKBOOK_AUTORECONF=autoreconf2.69 autotools_recursive_regenerate -I"$(realpath ./config)"
LIBTOOL_BUILD_AUX="${COOKBOOK_LIBTOOL_DIR:-$COOKBOOK_HOST_SYSROOT}"/share/libtool/build-aux
cp -fpv "$LIBTOOL_BUILD_AUX"/{config.sub,config.guess,install-sh} libiberty/
"""
[build]
template = "custom"
dependencies = [
"libgmp",
"libmpfr",
"mpc",
# TODO: this zlib get linked when boostrapping gcc
# "zlib"
]
script = """
DYNAMIC_STATIC_INIT
CROSS_GNU_TARGET=${COOKBOOK_CROSS_GNU_TARGET:-$GNU_TARGET}
if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then
# not specifying --enable-shared as it will link shared deps
COOKBOOK_STAGE+="/usr"
COOKBOOK_CONFIGURE_FLAGS=(
--prefix=""
--host="${GNU_TARGET}"
--program-prefix="${CROSS_GNU_TARGET}-"
--with-native-system-header-dir="/include"
--disable-hosted-libstdcxx
--with-sysroot
--with-build-sysroot="${COOKBOOK_CROSS_SYSROOT:-$COOKBOOK_SYSROOT}"
--disable-bootstrap
)
else
export CFLAGS_FOR_TARGET="${CPPFLAGS}" CXXFLAGS_FOR_TARGET="${CPPFLAGS}" LDFLAGS_FOR_TARGET="${LDFLAGS}"
export CC_FOR_BUILD="$CC_WRAPPER gcc" CXX_FOR_BUILD="$CC_WRAPPER g++"
unset CFLAGS CPPFLAGS LDFLAGS
COOKBOOK_CONFIGURE_FLAGS+=(
--with-sysroot=/
--with-gmp="${COOKBOOK_SYSROOT}/usr"
--with-mpfr="${COOKBOOK_SYSROOT}/usr"
--with-mpc="${COOKBOOK_SYSROOT}/usr"
)
fi
if [ "${CROSS_GNU_TARGET}" = "riscv64gc-unknown-redox" ]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--with-arch=rv64gc
--with-abi=lp64d
)
fi
if [ "${CROSS_GNU_TARGET}" != "i586-unknown-redox" ]; then
COOKBOOK_CONFIGURE_FLAGS+=(
--enable-frame-pointer
)
fi
COOKBOOK_CONFIGURE_FLAGS+=(
--target="${CROSS_GNU_TARGET}"
--with-linker-hash-style=gnu
--enable-languages=c,c++,lto
--enable-initfini-array
--disable-nls
--disable-multilib
# --with-system-zlib
--enable-host-shared
--enable-threads=posix
--enable-libstdcxx-threads
--with-bugurl="https://gitlab.redox-os.org/redox-os/gcc/-/issues"
)
"${COOKBOOK_CONFIGURE}" "${COOKBOOK_CONFIGURE_FLAGS[@]}"
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-gcc
"${COOKBOOK_MAKE}" install-gcc DESTDIR="${COOKBOOK_STAGE}"
# requires relibc which is not available on bootstrapping
if [ "${COOKBOOK_HOST_SYSROOT}" != "/usr" ]; then
"${COOKBOOK_MAKE}" -j "${COOKBOOK_MAKE_JOBS}" all-target-libgcc all-target-libstdc++-v3
"${COOKBOOK_MAKE}" install-target-libgcc install-target-libstdc++-v3 DESTDIR="${COOKBOOK_STAGE}"
ln -s "gcc" "${COOKBOOK_STAGE}/usr/bin/cc"
# Avoid conflict with libgcc & libstdcxx
rm -f "${COOKBOOK_STAGE}"/usr/lib/libgcc_s.so* "${COOKBOOK_STAGE}"/usr/lib/libstdc++.so*
fi
"""
[package]
dependencies = [
"gnu-binutils"
]
[[optional-packages]]
name = "cxx"
dependencies = []
files = [
"usr/bin/*c++",
"usr/bin/*g++",
"usr/include/c++/**",
"usr/lib/*c++*",
"usr/libexec/gcc/**/cc1plus",
"usr/share/gcc-*/python/libstdcxx/**",
]