From b3be36ee7d9781dae4da7cd9c262beca3d71213c Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Fri, 7 Nov 2025 16:05:41 +0000 Subject: [PATCH] Also compile rustc_driver as rlib This reduces the amount of patching necessary to get rustc working in environments where dynamic linking is not possible like wasm, miri or some niche OSes. There is still a single line patch necessary for miri to get the sysroot location (a future PR I have planned would as a side effect likely remove the need for this patch). For wasm some more intrusive patches are still necessary to disable thread usage. We will still only ship it in rustc-dev as dylib (all rlibs are filtered) and given that it is an empty crate, it shouldn't have any noticable size or compile time impact on building rustc. --- compiler/rustc_driver/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_driver/Cargo.toml b/compiler/rustc_driver/Cargo.toml index 5190971982763..6f833c5f23104 100644 --- a/compiler/rustc_driver/Cargo.toml +++ b/compiler/rustc_driver/Cargo.toml @@ -4,7 +4,7 @@ version = "0.0.0" edition = "2024" [lib] -crate-type = ["dylib"] +crate-type = ["rlib", "dylib"] [dependencies] # tidy-alphabetical-start