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
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
set(CMAKE_C_COMPILER cc)
|
||||
set(CMAKE_CXX_COMPILER c++)
|
||||
@@ -0,0 +1,80 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/llvm-project.git"
|
||||
upstream = "https://github.com/rust-lang/llvm-project.git"
|
||||
branch = "redox-2025-10-03"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
dependencies = [
|
||||
"zstd",
|
||||
]
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
ARCH="$(echo "${TARGET}" | cut -d - -f1)"
|
||||
|
||||
generate_cookbook_cmake_file "$COOKBOOK_HOST_TARGET" "" "$COOKBOOK_TOOLCHAIN" native.cmake
|
||||
|
||||
case "${ARCH}" in
|
||||
x86 | x86_64) LLVM_TARGETS_TO_BUILD="X86";;
|
||||
aarch64) LLVM_TARGETS_TO_BUILD="AArch64";;
|
||||
riscv64gc) LLVM_TARGETS_TO_BUILD="RISCV";;
|
||||
esac
|
||||
|
||||
if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then
|
||||
LLVM_TARGETS_TO_BUILD="X86;AArch64;RISCV"
|
||||
fi
|
||||
|
||||
# This just build the LLVM library and tools just enough for Rust, to build the rest of LLVM see
|
||||
# https://github.com/llvm/llvm-zorg/blob/main/zorg/buildbot/builders/annotated/standalone-build.sh
|
||||
|
||||
COOKBOOK_CMAKE_FLAGS+=(
|
||||
-DLLVM_BUILD_LLVM_DYLIB=On
|
||||
-DLLVM_LINK_LLVM_DYLIB=On
|
||||
-DLLVM_INCLUDE_UTILS=On
|
||||
-DLLVM_INSTALL_UTILS=On
|
||||
-DLLVM_TOOL_LLVM_COV_BUILD=On
|
||||
-DLLVM_TOOL_LLVM_PROFDATA_BUILD=On
|
||||
-DLLVM_TARGETS_TO_BUILD="$LLVM_TARGETS_TO_BUILD"
|
||||
-DLLVM_ENABLE_ZLIB=Off
|
||||
-DLLVM_USE_STATIC_ZSTD=On
|
||||
-DLLVM_ENABLE_LIBXML2=Off
|
||||
|
||||
# the rest of options that shared to clang
|
||||
-DCROSS_TOOLCHAIN_FLAGS_NATIVE="-DCMAKE_TOOLCHAIN_FILE=$(realpath "${COOKBOOK_RECIPE}/native.cmake")"
|
||||
-DCMAKE_CXX_FLAGS="--std=gnu++11"
|
||||
-DBUILD_SHARED_LIBS=False
|
||||
-DLLVM_BUILD_EXAMPLES=Off
|
||||
-DLLVM_BUILD_TESTS=Off
|
||||
-DLLVM_DEFAULT_TARGET_TRIPLE="${TARGET}"
|
||||
-DLLVM_ENABLE_LTO=Off
|
||||
-DLLVM_ENABLE_RTTI=On
|
||||
-DLLVM_ENABLE_THREADS=On
|
||||
-DLLVM_INCLUDE_EXAMPLES=Off
|
||||
-DLLVM_INCLUDE_TESTS=Off
|
||||
-DLLVM_OPTIMIZED_TABLEGEN=On
|
||||
-DLLVM_TARGET_ARCH=$ARCH
|
||||
-DLLVM_TOOLS_INSTALL_DIR=bin
|
||||
-DLLVM_UTILS_INSTALL_DIR=bin
|
||||
-DUNIX=1
|
||||
)
|
||||
|
||||
COOKBOOK_SOURCE="$COOKBOOK_SOURCE/llvm"
|
||||
cookbook_cmake
|
||||
"""
|
||||
|
||||
# llvm runtime
|
||||
[[optional-packages]]
|
||||
name = "runtime"
|
||||
files = [
|
||||
"usr/bin/**",
|
||||
]
|
||||
|
||||
[[optional-packages]]
|
||||
name = "dev"
|
||||
dependencies = [ ".runtime" ]
|
||||
files = [
|
||||
"usr/include/llvm*/**",
|
||||
"usr/lib/libLLVM*.a",
|
||||
"usr/lib/cmake/llvm/**",
|
||||
]
|
||||
Reference in New Issue
Block a user