From f3748bf4668cc28de56aad0ec1c617d0359ea2bc Mon Sep 17 00:00:00 2001 From: Wildan M Date: Tue, 24 Feb 2026 05:48:47 +0700 Subject: [PATCH] Fix rust compilation, add rustdoc tool --- mk/prefix.mk | 3 ++- recipes/dev/rust/config-bootstrap.toml | 2 +- recipes/dev/rust/config.toml | 3 +-- recipes/dev/rust/recipe.toml | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/mk/prefix.mk b/mk/prefix.mk index c9132daf..0257bf1d 100644 --- a/mk/prefix.mk +++ b/mk/prefix.mk @@ -385,10 +385,11 @@ else export PATH="$(ROOT)/$(PREFIX)/libtool-install/bin:$$PATH" \ $(PREFIX_CONFIG) COOKBOOK_HOST_SYSROOT=/usr COOKBOOK_CROSS_TARGET=$(TARGET) && \ ./target/release/repo cook host:llvm21 host:clang21 host:lld21 -# skipping dev, llvm libraries is already in rust if building +# llvm libraries is already in rust if building ifeq ($(PREFIX_USE_UPSTREAM_RUST_COMPILER),1) cp -r "$(LLVM_TARGET)/stage/usr/". "$@.partial" endif + cp -r "$(LLVM_TARGET)/stage.dev/usr/". "$@.partial" cp -r "$(LLVM_TARGET)/stage.runtime/usr/". "$@.partial" cp -r "$(CLANG_TARGET)/stage/usr/". "$@.partial" cp -r "$(LLD_TARGET)/stage/usr/". "$@.partial" diff --git a/recipes/dev/rust/config-bootstrap.toml b/recipes/dev/rust/config-bootstrap.toml index 08aa9408..b3fc3b82 100644 --- a/recipes/dev/rust/config-bootstrap.toml +++ b/recipes/dev/rust/config-bootstrap.toml @@ -10,7 +10,7 @@ target = ["TARGET", "i586-unknown-redox", "x86_64-unknown-redox", "aarch64-unkno cargo-native-static = true submodules = false docs = false -tools = ["cargo", "clippy", "rustfmt", "src"] +tools = ["cargo", "clippy", "rustdoc", "rustfmt", "src"] extended = true verbose = 1 diff --git a/recipes/dev/rust/config.toml b/recipes/dev/rust/config.toml index 4418c3dd..29dc4476 100644 --- a/recipes/dev/rust/config.toml +++ b/recipes/dev/rust/config.toml @@ -8,9 +8,8 @@ experimental-targets = "" host = ["x86_64-unknown-redox"] target = ["x86_64-unknown-redox"] submodules = false -# TODO: enable rustdoc and others docs = false -tools = ["cargo", "clippy", "rustfmt", "src"] +tools = ["cargo", "clippy", "rustdoc", "rustfmt", "src"] extended = true verbose = 1 diff --git a/recipes/dev/rust/recipe.toml b/recipes/dev/rust/recipe.toml index f5ad66af..84f0a971 100644 --- a/recipes/dev/rust/recipe.toml +++ b/recipes/dev/rust/recipe.toml @@ -37,14 +37,14 @@ export CARGO_TARGET_X86_64_UNKNOWN_REDOX_RUSTFLAGS="\ cat "${COOKBOOK_ROOT}/bin/x86_64-unknown-redox-llvm-config" > "${COOKBOOK_SYSROOT}/bin/llvm-config" # Linker flags for stage1 compiler (host -> host) export RUSTFLAGS_BOOTSTRAP="\ --Clink-args=-L${COOKBOOK_TOOLCHAIN}/lib \ --Clink-args=-Wl,-rpath-link,${COOKBOOK_TOOLCHAIN}/lib" +-Clink-args=-L${COOKBOOK_HOST_SYSROOT}/lib \ +-Clink-args=-Wl,-rpath-link,${COOKBOOK_HOST_SYSROOT}/lib" export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="${RUSTFLAGS_BOOTSTRAP}" export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="${RUSTFLAGS_BOOTSTRAP}" cat ${COOKBOOK_RECIPE}/config.toml > config.toml sed -i "s|COOKBOOK_SYSROOT|${COOKBOOK_SYSROOT}|g" config.toml -sed -i "s|COOKBOOK_TOOLCHAIN|${COOKBOOK_TOOLCHAIN}|g" config.toml +sed -i "s|COOKBOOK_TOOLCHAIN|${COOKBOOK_HOST_SYSROOT}|g" config.toml fi