tawasuyu

sergio/takana

> Una distribución Linux construida con un laboratorio funcional y hermético en el > sótano, y una terminal mutable, clásica y anárquica en el piso de arriba — diseñada > desde el suelo para que una IA programadora entienda, modifique y co…

TOML 1572Shell 203Rust 109Markdown 993728 Definiciones

⎇ 4f0f5c7bc79b884119d5a41e3aa5f80d2d7d042a scripts/rust-frontier/run_rustc.patch 49 líneas · 3.1 KB Historia crudo

selfhost-verify: artefactos del frente rust (parche run_rustc + runners stage0-musl) bf3f1166e · sergio ·

1diff --git a/run_rustc/Makefile b/run_rustc/Makefile
2index e78d8c5..4d6ef5d 100644
3--- a/run_rustc/Makefile
4+++ b/run_rustc/Makefile
5@@ -108,7 +108,7 @@ CARGO_FLAGS := --target $(RUSTC_TARGET) -j $(PARLEVEL) --release --verbose
6 CARGO_ENV := CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET)
7 CARGO_ENV += RUSTC_BOOTSTRAP=1
8 CARGO_ENV += CARGO_HOME=$(CARGO_HOME)
9-CARGO_ENV += RUSTFLAGS="-Z force-unstable-if-unmarked -C link_args=-Wl,-rpath,\$$ORIGIN/../lib -C target-feature=-crt-static"
10+CARGO_ENV += RUSTFLAGS="-Z force-unstable-if-unmarked -C link_args=-Wl,-rpath,\$$ORIGIN/../lib -C target-feature=-crt-static -C link-self-contained=no"
11 
12 fn_opt_copy = (test -e "$2" && test ! "$1" -nt "$2") || cp "$1" "$2"
13 
14@@ -159,7 +159,7 @@ $(LIBDIR_S)libstd.rlib: $(BINDIR_S)rustc $(MINICARGO) Makefile
15 	@echo "[MINICARGO] $(RUST_SRC_LIBS)std > $(LIBDIR_S)"
16 	mkdir -p $(LIBDIR_S)
17 ifneq ($(TARGETVER_LEAST_1_74),)
18-	$V+STD_ENV_ARCH=$(RUSTC_ARCH) MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)sysroot
19+	$V+STD_ENV_ARCH=$(RUSTC_ARCH) MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) --target $(RUSTC_TARGET) $(RUST_SRC_LIBS)sysroot
20 else
21 	$V+MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)std
22 	$V+MRUSTC_PATH=$(abspath $(BINDIR_S)rustc) $(MINICARGO) --vendor-dir $(VENDOR_DIR) --script-overrides ../script-overrides/stable-$(RUSTC_VERSION)-$(PLATFORM)/ --output-dir $(LIBDIR_S) $(RUST_SRC_LIBS)panic_unwind
23@@ -169,7 +169,7 @@ endif
24 # Build hello_world using the bootstrapping compiler (mrustc-built rustc)
25 $(BINDIR_S)hello_world: $(RUST_SRC_HELLO) $(LIBDIR_S)libstd.rlib $(BINDIR_S)rustc
26 	@mkdir -p $(dir $@)
27-	$V$(BINDIR_S)rustc $(RUSTFLAGS_$@) -L $(LIBDIR_S) $< -o $@
28+	$V$(BINDIR_S)rustc $(RUSTFLAGS_$@) --target $(RUSTC_TARGET) -C target-feature=-crt-static -C link-self-contained=no -L $(LIBDIR_S) $< -o $@
29 
30 # ---
31 # Stage 2: Build a proper libstd (which includes dynamc libraries too)
32diff --git a/run_rustc/rustc_proxy.sh b/run_rustc/rustc_proxy.sh
33index 3f4f2b9..78f6f1d 100755
34--- a/run_rustc/rustc_proxy.sh
35+++ b/run_rustc/rustc_proxy.sh
36@@ -17,7 +17,12 @@ if is_target "$@"; then
37     #echo "  [REAL]" "$@" >&2
38     ${PROXY_RUSTC} "$@"
39 else
40+    # Host (build-script / proc-macro) build. With the musl-host stage0 rustc its
41+    # default target IS x86_64-unknown-linux-musl, so no --target inject is needed
42+    # (host==target==musl, proc-macros load natively). Just force dynamic +
43+    # non-self-contained so the Alpine gcc supplies the CRT (the mrustc sysroot has
44+    # no self-contained CRT dir, and musl's default is static-pie).
45     #echo "  [BOOTSTRAP]" "$@" >&2
46-    ${PROXY_MRUSTC} "$@"
47+    ${PROXY_MRUSTC} -C target-feature=-crt-static -C link-self-contained=no "$@"
48 fi
49