Skip to content

Commit

Permalink
Rollup merge of rust-lang#56435 - RalfJung:libstd-without-c, r=alexcr…
Browse files Browse the repository at this point in the history
…ichton

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
  • Loading branch information
kennytm committed Dec 3, 2018
2 parents a498a6d + bd20718 commit 21433f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/libstd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ cc = "1.0"
build_helper = { path = "../build_helper" }

[features]
default = ["compiler_builtins_c"]

backtrace = []
panic-unwind = ["panic_unwind"]
profiler = ["profiler_builtins"]
compiler_builtins_c = ["compiler_builtins/c"]

# Make panics and failed asserts immediately abort without formatting any message
panic_immediate_abort = ["core/panic_immediate_abort"]
Expand Down
2 changes: 1 addition & 1 deletion src/rustc/compiler_builtins_shim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cc = "1.0.1"

[features]
c = []
default = ["c", "rustbuild", "compiler-builtins"]
default = ["rustbuild", "compiler-builtins"]
mem = []
rustbuild = []
compiler-builtins = []

0 comments on commit 21433f2

Please sign in to comment.