mirror of
https://gitlab.redox-os.org/redox-os/redox.git
synced 2026-06-28 07:44:18 +08:00
Merge branch 'linux' into 'master'
Draft: Build system on top of linux kernel See merge request redox-os/redox!2063
This commit is contained in:
commit
d296672d9c
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -917,7 +917,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "redoxer"
|
||||
version = "0.2.63"
|
||||
source = "git+https://gitlab.redox-os.org/redox-os/redoxer.git#67af2b7543ff8fb2eaba6699ac9d331dfe2d0f8c"
|
||||
source = "git+https://gitlab.redox-os.org/willnode/redoxer.git?branch=linux#908336f2bf893d026e391b8972f271a78e4e27c2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"dirs",
|
||||
|
||||
@ -40,7 +40,7 @@ pkgar-core = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
|
||||
pkgar-keys = { git = "https://gitlab.redox-os.org/redox-os/pkgar.git" }
|
||||
redox-pkg = { git = "https://gitlab.redox-os.org/redox-os/pkgutils.git", default-features = false }
|
||||
redox_installer = { git = "https://gitlab.redox-os.org/redox-os/installer.git", default-features = false }
|
||||
redoxer = { git = "https://gitlab.redox-os.org/redox-os/redoxer.git", default-features = false }
|
||||
redoxer = { git = "https://gitlab.redox-os.org/willnode/redoxer.git", branch = "linux", default-features = false }
|
||||
regex = "1.11"
|
||||
serde = { version = "=1.0.197", features = ["derive"] }
|
||||
termion = "4"
|
||||
|
||||
@ -5,11 +5,11 @@ include = ["desktop.toml"]
|
||||
# General settings
|
||||
[general]
|
||||
# Filesystem size in MiB
|
||||
filesystem_size = 20000
|
||||
filesystem_size = 3000
|
||||
# Do not prompt if settings are not defined
|
||||
prompt = false
|
||||
|
||||
# Package settings
|
||||
[packages]
|
||||
dev-redox = {}
|
||||
gcc13 = {}
|
||||
hello-redox = {}
|
||||
|
||||
@ -7,6 +7,8 @@ HOST_ARCH?=$(shell uname -m)
|
||||
# Configuration
|
||||
## Architecture to build Redox for (aarch64, i586, or x86_64). Defaults to a host one
|
||||
ARCH?=$(HOST_ARCH)
|
||||
## Operating system mode (redox or linux). Linux is experimental
|
||||
OPERATING_SYSTEM?=redox
|
||||
## Sub-device type for aarch64 if needed
|
||||
BOARD?=
|
||||
## Enable to use binary prefix (much faster)
|
||||
@ -159,7 +161,11 @@ endif
|
||||
endif
|
||||
|
||||
## Userspace variables
|
||||
ifeq ($(ARCH),riscv64gc)
|
||||
ifeq ($(OPERATING_SYSTEM),linux)
|
||||
export TARGET=$(ARCH)-unknown-linux-relibc
|
||||
export GNU_TARGET=$(ARCH)-linux-relibc
|
||||
export USE_RUST_LIBM=1
|
||||
else ifeq ($(ARCH),riscv64gc)
|
||||
export TARGET=riscv64gc-unknown-redox
|
||||
export GNU_TARGET=riscv64-unknown-redox
|
||||
else
|
||||
|
||||
@ -21,7 +21,7 @@ UPSTREAM_RUSTC_VERSION=2025-11-15
|
||||
export PREFIX_RUSTFLAGS=-L $(ROOT)/$(PREFIX_INSTALL)/$(TARGET)/lib
|
||||
export RUSTUP_TOOLCHAIN=$(ROOT)/$(PREFIX_INSTALL)
|
||||
export REDOXER_TOOLCHAIN=$(RUSTUP_TOOLCHAIN)
|
||||
PREFIX_CONFIG=CI=1 COOKBOOK_CLEAN_BUILD=true COOKBOOK_CLEAN_TARGET=false COOKBOOK_VERBOSE=true COOKBOOK_NONSTOP=false
|
||||
PREFIX_CONFIG=CI=1 COOKBOOK_CLEAN_TARGET=false COOKBOOK_VERBOSE=true COOKBOOK_NONSTOP=false
|
||||
|
||||
prefix: $(PREFIX)/sysroot
|
||||
|
||||
@ -375,14 +375,14 @@ endif
|
||||
# BUILD RUST ---------------------------------------------------
|
||||
else
|
||||
|
||||
$(PREFIX)/rust-install: | $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
|
||||
$(PREFIX)/rust-install: | $(PREFIX)/gcc-install $(PREFIX)/libtool-install $(FSTOOLS_TAG) $(CONTAINER_TAG)
|
||||
ifeq ($(PODMAN_BUILD),1)
|
||||
$(PODMAN_RUN) make $@
|
||||
else
|
||||
@echo "\033[1;36;49mBuilding rust-install\033[0m"
|
||||
rm -rf "$@.partial" "$@"
|
||||
export PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$$PATH" \
|
||||
$(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) && \
|
||||
export PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$(ROOT)/$(PREFIX)/gcc-install/bin:$$PATH" \
|
||||
$(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) COOKBOOK_CROSS_GNU_TARGET=$(GNU_TARGET) && \
|
||||
$(REPO_BIN) cook host:llvm21 host:rust
|
||||
cp -r "$(RUST_TARGET)/stage/usr/". "$@.partial"
|
||||
cp -r "$(LLVM_TARGET)/stage/usr/". "$@.partial"
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/relibc.git"
|
||||
git = "https://gitlab.redox-os.org/willnode/relibc.git"
|
||||
branch = "linux"
|
||||
|
||||
[build]
|
||||
template = "custom"
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/gcc"
|
||||
branch = "redox-13.2.0"
|
||||
git = "https://gitlab.redox-os.org/willnode/gcc"
|
||||
branch = "linux"
|
||||
shallow_clone = true
|
||||
script = """
|
||||
DYNAMIC_INIT
|
||||
|
||||
36
recipes/dev/rust/config-cross-linux.toml
Normal file
36
recipes/dev/rust/config-cross-linux.toml
Normal file
@ -0,0 +1,36 @@
|
||||
[llvm]
|
||||
download-ci-llvm = false
|
||||
static-libstdcpp = false
|
||||
link-shared = true
|
||||
|
||||
[build]
|
||||
host = ["TARGET"]
|
||||
target = ["TARGET", "COOKBOOK_TARGET"]
|
||||
cargo-native-static = true
|
||||
submodules = false
|
||||
docs = false
|
||||
tools = ["cargo", "clippy", "rustdoc", "rustfmt", "src"]
|
||||
extended = true
|
||||
verbose = 1
|
||||
|
||||
[install]
|
||||
prefix = "install"
|
||||
sysconfdir = "etc"
|
||||
|
||||
[rust]
|
||||
backtrace = false
|
||||
codegen-tests = false
|
||||
|
||||
[target.COOKBOOK_TARGET]
|
||||
cc = "COOKBOOK_GNU_TARGET-gcc"
|
||||
cxx = "COOKBOOK_GNU_TARGET-g++"
|
||||
ar = "COOKBOOK_GNU_TARGET-ar"
|
||||
linker = "COOKBOOK_GNU_TARGET-gcc"
|
||||
crt-static = false
|
||||
llvm-config = "COOKBOOK_SYSROOT/bin/llvm-config"
|
||||
|
||||
[target.aarch64-unknown-linux-gnu]
|
||||
llvm-config = "COOKBOOK_TOOLCHAIN/bin/llvm-config"
|
||||
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
llvm-config = "COOKBOOK_TOOLCHAIN/bin/llvm-config"
|
||||
@ -1,6 +1,6 @@
|
||||
[source]
|
||||
git = "https://gitlab.redox-os.org/redox-os/rust.git"
|
||||
branch = "redox-2025-10-03"
|
||||
git = "https://gitlab.redox-os.org/willnode/rust.git"
|
||||
branch = "linux"
|
||||
shallow_clone = true
|
||||
|
||||
[build]
|
||||
@ -20,9 +20,12 @@ dev-dependencies = [
|
||||
script = """
|
||||
if [ "${COOKBOOK_HOST_SYSROOT}" = "/usr" ]; then
|
||||
|
||||
cat ${COOKBOOK_RECIPE}/config-bootstrap.toml > config.toml
|
||||
sed -i "s|TARGET|${TARGET}|g" config.toml
|
||||
OS=$(echo "${TARGET}" | cut -d - -f3)
|
||||
cat ${COOKBOOK_RECIPE}/config-cross-$OS.toml > config.toml
|
||||
sed -i "s|COOKBOOK_TOOLCHAIN|${COOKBOOK_TOOLCHAIN}|g" config.toml
|
||||
sed -i "s|COOKBOOK_TARGET|${COOKBOOK_CROSS_TARGET}|g" config.toml
|
||||
sed -i "s|COOKBOOK_GNU_TARGET|${COOKBOOK_CROSS_GNU_TARGET}|g" config.toml
|
||||
sed -i "s|TARGET|${TARGET}|g" config.toml
|
||||
|
||||
else
|
||||
|
||||
|
||||
@ -15,6 +15,12 @@ COOKBOOK_CONFIGURE_FLAGS+=(
|
||||
if [ "${TARGET}" = "riscv64gc-unknown-redox" ]; then
|
||||
COOKBOOK_CONFIGURE_FLAGS+=( --without-libstdcxx-zoneinfo )
|
||||
fi
|
||||
if [ "${TARGET}" = "x86_64-unknown-linux-relibc" ]; then
|
||||
COOKBOOK_CONFIGURE_FLAGS+=( --without-libstdcxx-zoneinfo )
|
||||
fi
|
||||
if [ "${TARGET}" = "aarch64-unknown-linux-relibc" ]; then
|
||||
COOKBOOK_CONFIGURE_FLAGS+=( --without-libstdcxx-zoneinfo )
|
||||
fi
|
||||
|
||||
CPPINCLUDE="${COOKBOOK_HOST_SYSROOT}/$TARGET/include/c++/13.2.0"
|
||||
export CPPFLAGS+=" -I${CPPINCLUDE} -I${CPPINCLUDE}/$TARGET/bits"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user