Skip to content

Commit 21433f2

Browse files
authored
Rollup merge of #56435 - RalfJung:libstd-without-c, r=alexcrichton
make the C part of compiler-builtins opt-out I'd like to be able to use Xargo to build a libstd without having a full C toolchain for the target. This is a start (but the fact that libstd is a dylib is still a problem). However, compiler_builtin already has somewhat similar logic to not require a C compiler for wasm: https://github.com/rust-lang-nursery/compiler-builtins/blob/fe74674f6e4be76d47b66f67d529ebf4186f4eb1/build.rs#L36-L41 (WTF GitHub, why doesn't this show an embedded code preview??) I wonder if there is a way to not have two separate mechanisms? Like, move the above wasm logic to some place that controls the libstd feature, or so? Or is it okay to have these two mechanisms co-exist? Cc @alexcrichton
2 parents a498a6d + bd20718 commit 21433f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/libstd/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ cc = "1.0"
4343
build_helper = { path = "../build_helper" }
4444

4545
[features]
46+
default = ["compiler_builtins_c"]
47+
4648
backtrace = []
4749
panic-unwind = ["panic_unwind"]
4850
profiler = ["profiler_builtins"]
51+
compiler_builtins_c = ["compiler_builtins/c"]
4952

5053
# Make panics and failed asserts immediately abort without formatting any message
5154
panic_immediate_abort = ["core/panic_immediate_abort"]

src/rustc/compiler_builtins_shim/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ cc = "1.0.1"
3434

3535
[features]
3636
c = []
37-
default = ["c", "rustbuild", "compiler-builtins"]
37+
default = ["rustbuild", "compiler-builtins"]
3838
mem = []
3939
rustbuild = []
4040
compiler-builtins = []

0 commit comments

Comments
 (0)