From 7b9f586c37938cc8191179e42b848e978a9ab87b Mon Sep 17 00:00:00 2001 From: Wildan Mubarok Date: Fri, 25 Jul 2025 03:50:05 +0000 Subject: [PATCH] Update and Fix rust linking --- recipes/dev/rust/config.toml | 6 +++++- recipes/dev/rust/recipe.toml | 9 ++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/recipes/dev/rust/config.toml b/recipes/dev/rust/config.toml index d2760f2e7..b53de2d71 100644 --- a/recipes/dev/rust/config.toml +++ b/recipes/dev/rust/config.toml @@ -1,6 +1,10 @@ [llvm] +# TODO: LLVM is only compiled for stage1, +# it should be possible to enable this download-ci-llvm = false static-libstdcpp = false +targets = "X86" +experimental-targets = "" # TODO: This currently must need to be set manually. # If you like to build llvm with sccache, uncomment: # ccache = "sccache" @@ -19,7 +23,6 @@ sysconfdir = "etc" [rust] backtrace = false -rpath = false codegen-tests = false [target.x86_64-unknown-redox] @@ -29,4 +32,5 @@ ar = "x86_64-unknown-redox-ar" linker = "x86_64-unknown-redox-gcc" # Nasty path, please fix llvm-config = "../../../../bin/x86_64-unknown-redox-llvm-config" +rpath = false crt-static = false diff --git a/recipes/dev/rust/recipe.toml b/recipes/dev/rust/recipe.toml index e71a4c6e6..3bdc930fd 100644 --- a/recipes/dev/rust/recipe.toml +++ b/recipes/dev/rust/recipe.toml @@ -1,8 +1,8 @@ [source] git = "https://gitlab.redox-os.org/redox-os/rust.git" -branch = "redox-2024-05-11" +branch = "redox-2025-01-12" # due to heavy git operation, this will only clone once and will not refetch -# if you want to refetch or changing the branch, please do ucr.rust +# if you want to refetch or changing the branch, please run `make ucr.rust` shallow_clone = true [build] @@ -15,9 +15,9 @@ script = """ DYNAMIC_INIT HOST_STRIP=$STRIP # Linker flags for stage2 compiler (host -> target) -export MAGIC_EXTRA_RUSTFLAGS="${LDFLAGS} -C link-args=-lz" +export LDFLAGS_x86_64_unknown_redox="${LDFLAGS}" # Don't poison the stage1 compiler (host -> host) -unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF STRIP +unset AR AS CC CXX LD LDFLAGS NM OBJCOPY OBJDUMP RANLIB READELF RUSTFLAGS STRIP python3 "${COOKBOOK_SOURCE}/x.py" install \ --config "${COOKBOOK_RECIPE}/config.toml" \ --jobs $(nproc) @@ -29,7 +29,6 @@ rsync -av --delete "${COOKBOOK_BUILD}"/install/* "${COOKBOOK_STAGE}/" [package] dependencies = [ - "gcc13", "cargo" ] # TODO: Not implemented