diff --git a/Cargo.lock b/Cargo.lock index 8daba8746..66eaf9f6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -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", diff --git a/Cargo.toml b/Cargo.toml index ad32286ff..a7604dd80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/config/dev.toml b/config/dev.toml index 8f92fb2cc..cddb680a8 100644 --- a/config/dev.toml +++ b/config/dev.toml @@ -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 = {} diff --git a/mk/config.mk b/mk/config.mk index 6595f2a83..9ab62c20f 100644 --- a/mk/config.mk +++ b/mk/config.mk @@ -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 diff --git a/mk/prefix.mk b/mk/prefix.mk index a300d6430..5e40b4b0b 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -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" diff --git a/recipes/core/relibc/recipe.toml b/recipes/core/relibc/recipe.toml index 4aba45310..53ccb3bee 100644 --- a/recipes/core/relibc/recipe.toml +++ b/recipes/core/relibc/recipe.toml @@ -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" diff --git a/recipes/dev/gcc13/recipe.toml b/recipes/dev/gcc13/recipe.toml index 7cfa74503..0ff163b53 100644 --- a/recipes/dev/gcc13/recipe.toml +++ b/recipes/dev/gcc13/recipe.toml @@ -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 diff --git a/recipes/dev/rust/config-cross-linux.toml b/recipes/dev/rust/config-cross-linux.toml new file mode 100644 index 000000000..c2d4ea1d9 --- /dev/null +++ b/recipes/dev/rust/config-cross-linux.toml @@ -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" diff --git a/recipes/dev/rust/config-bootstrap.toml b/recipes/dev/rust/config-cross-redox.toml similarity index 100% rename from recipes/dev/rust/config-bootstrap.toml rename to recipes/dev/rust/config-cross-redox.toml diff --git a/recipes/dev/rust/recipe.toml b/recipes/dev/rust/recipe.toml index 93e5b6c18..2e3cff53c 100644 --- a/recipes/dev/rust/recipe.toml +++ b/recipes/dev/rust/recipe.toml @@ -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 diff --git a/recipes/libs/libstdcxx-v3/recipe.toml b/recipes/libs/libstdcxx-v3/recipe.toml index c89158af4..c53005dc7 100644 --- a/recipes/libs/libstdcxx-v3/recipe.toml +++ b/recipes/libs/libstdcxx-v3/recipe.toml @@ -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"