Con el stage0 musl-host, run_rustc all terminó: rustc stage-3 (host=musl, LLVM 20.1.8, 1.90.0-stable-mrustc) + cargo 1.90.0 + sysroot (294 rlibs) construidos y verificados corriendo. El muro de proc-macros quedó roto (tinystr/displaydoc/icu nativos). Dos snags finales arreglados (en run_rustc.patch, vs be69c74): - Makefile:262 (hello_world FINAL): mismos flags CRT que la 172 (--target + -C target-feature=-crt-static -C link-self-contained=no); solo aflora al completar stage-2/3. - Makefile:235 (cargo FINAL): --features vendored-openssl (openssl-sys no halla openssl del sistema en el devfs hermético; openssl-src lo compila desde fuente). README documenta ambos como snags #4 y #2(262). NEXT: climb 1.90 -> 1.91.0 -> 1.91.1. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
68 lines
3.9 KiB
Diff
68 lines
3.9 KiB
Diff
diff --git a/run_rustc/Makefile b/run_rustc/Makefile
|
|
index e78d8c5..6acc615 100644
|
|
--- a/run_rustc/Makefile
|
|
+++ b/run_rustc/Makefile
|
|
@@ -108,7 +108,7 @@ CARGO_FLAGS := --target $(RUSTC_TARGET) -j $(PARLEVEL) --release --verbose
|
|
CARGO_ENV := CFG_COMPILER_HOST_TRIPLE=$(RUSTC_TARGET)
|
|
CARGO_ENV += RUSTC_BOOTSTRAP=1
|
|
CARGO_ENV += CARGO_HOME=$(CARGO_HOME)
|
|
-CARGO_ENV += RUSTFLAGS="-Z force-unstable-if-unmarked -C link_args=-Wl,-rpath,\$$ORIGIN/../lib -C target-feature=-crt-static"
|
|
+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"
|
|
|
|
fn_opt_copy = (test -e "$2" && test ! "$1" -nt "$2") || cp "$1" "$2"
|
|
|
|
@@ -159,7 +159,7 @@ $(LIBDIR_S)libstd.rlib: $(BINDIR_S)rustc $(MINICARGO) Makefile
|
|
@echo "[MINICARGO] $(RUST_SRC_LIBS)std > $(LIBDIR_S)"
|
|
mkdir -p $(LIBDIR_S)
|
|
ifneq ($(TARGETVER_LEAST_1_74),)
|
|
- $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
|
|
+ $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
|
|
else
|
|
$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
|
|
$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
|
|
@@ -169,7 +169,7 @@ endif
|
|
# Build hello_world using the bootstrapping compiler (mrustc-built rustc)
|
|
$(BINDIR_S)hello_world: $(RUST_SRC_HELLO) $(LIBDIR_S)libstd.rlib $(BINDIR_S)rustc
|
|
@mkdir -p $(dir $@)
|
|
- $V$(BINDIR_S)rustc $(RUSTFLAGS_$@) -L $(LIBDIR_S) $< -o $@
|
|
+ $V$(BINDIR_S)rustc $(RUSTFLAGS_$@) --target $(RUSTC_TARGET) -C target-feature=-crt-static -C link-self-contained=no -L $(LIBDIR_S) $< -o $@
|
|
|
|
# ---
|
|
# Stage 2: Build a proper libstd (which includes dynamc libraries too)
|
|
@@ -232,7 +232,7 @@ endif
|
|
#
|
|
$(BINDIR)cargo: $(BINDIR)rustc
|
|
@echo [CARGO] $(RUST_SRC_RUSTC)Cargo.toml '>' $(OUTDIR)build-rustc/
|
|
- $VTMPDIR=$(abspath $(PREFIX)tmp) $(CARGO_ENV_RUSTC) $(BINDIR_S)cargo build $(CARGO_FLAGS) --manifest-path $(RUST_SRC_CARGO)Cargo.toml
|
|
+ $VTMPDIR=$(abspath $(PREFIX)tmp) $(CARGO_ENV_RUSTC) $(BINDIR_S)cargo build $(CARGO_FLAGS) --features vendored-openssl --manifest-path $(RUST_SRC_CARGO)Cargo.toml
|
|
$Vcp $(CARGO_OUTDIR_RUSTC)cargo $(BINDIR)cargo
|
|
|
|
|
|
@@ -259,7 +259,7 @@ endif
|
|
$(BINDIR)hello_world: $(RUST_SRC_HELLO) $(BINDIR)rustc $(LIBDIR)libstd.rlib
|
|
@mkdir -p $(dir $@)
|
|
@echo "[RUSTC] -o $@"
|
|
- $V$(DBG) $(BINDIR)rustc -L $(LIBDIR) $< -o $@
|
|
+ $V$(DBG) $(BINDIR)rustc --target $(RUSTC_TARGET) -C target-feature=-crt-static -C link-self-contained=no -L $(LIBDIR) $< -o $@
|
|
./$@
|
|
|
|
#.PHONY: TEST_BOOTSTRAP
|
|
diff --git a/run_rustc/rustc_proxy.sh b/run_rustc/rustc_proxy.sh
|
|
index 3f4f2b9..78f6f1d 100755
|
|
--- a/run_rustc/rustc_proxy.sh
|
|
+++ b/run_rustc/rustc_proxy.sh
|
|
@@ -17,7 +17,12 @@ if is_target "$@"; then
|
|
#echo " [REAL]" "$@" >&2
|
|
${PROXY_RUSTC} "$@"
|
|
else
|
|
+ # Host (build-script / proc-macro) build. With the musl-host stage0 rustc its
|
|
+ # default target IS x86_64-unknown-linux-musl, so no --target inject is needed
|
|
+ # (host==target==musl, proc-macros load natively). Just force dynamic +
|
|
+ # non-self-contained so the Alpine gcc supplies the CRT (the mrustc sysroot has
|
|
+ # no self-contained CRT dir, and musl's default is static-pie).
|
|
#echo " [BOOTSTRAP]" "$@" >&2
|
|
- ${PROXY_MRUSTC} "$@"
|
|
+ ${PROXY_MRUSTC} -C target-feature=-crt-static -C link-self-contained=no "$@"
|
|
fi
|
|
|