Skip to content

Commit

Permalink
make sure rustc_driver links to an unwinder
Browse files Browse the repository at this point in the history
Fixes rust-lang#76020

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
  • Loading branch information
Keruspe committed Oct 12, 2020
1 parent c6bebc1 commit 8645659
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3556,6 +3556,7 @@ dependencies = [
"tracing",
"tracing-subscriber",
"tracing-tree",
"unwind",
"winapi 0.3.9",
]

Expand Down Expand Up @@ -5279,8 +5280,8 @@ dependencies = [
"cc",
"cfg-if",
"compiler_builtins",
"core",
"libc",
"rustc-std-workspace-core",
]

[[package]]
Expand Down
3 changes: 3 additions & 0 deletions compiler/rustc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ rustc_serialize = { path = "../rustc_serialize" }
rustc_ast = { path = "../rustc_ast" }
rustc_span = { path = "../rustc_span" }

# Make sure we link to an unwinder
unwind = { path = "../../library/unwind" }

[target.'cfg(windows)'.dependencies]
winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"] }

Expand Down
5 changes: 5 additions & 0 deletions compiler/rustc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
#![feature(nll)]
#![feature(once_cell)]
#![feature(panic_unwind)]
#![recursion_limit = "256"]

#[macro_use]
extern crate tracing;

// This is here just to make sure we link to an unwinder
#[allow(unused_extern_crates)]
extern crate unwind;

pub extern crate rustc_plugin_impl as plugin;

use rustc_ast as ast;
Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ core = { path = "../core" }
libc = { version = "0.2.79", default-features = false, features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "0.1.35" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
unwind = { path = "../unwind", features = ['rustc-dep-of-std'] }
hashbrown = { version = "0.9.0", default-features = false, features = ['rustc-dep-of-std'] }

# Dependencies of the `backtrace` crate
Expand Down
7 changes: 4 additions & 3 deletions library/unwind/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ bench = false
doc = false

[dependencies]
core = { path = "../core" }
libc = { version = "0.2.79", features = ['rustc-dep-of-std'], default-features = false }
compiler_builtins = "0.1.0"
core = { version = '1.0.0', optional = true, package = 'rustc-std-workspace-core' }
libc = { version = "0.2.79", default-features = false }
compiler_builtins = { version = "0.1.0", optional = true }
cfg-if = "0.1.8"

[build-dependencies]
cc = { version = "1.0.1" }

[features]
llvm-libunwind = []
rustc-dep-of-std = ['compiler_builtins', 'core', 'libc/rustc-dep-of-std']

0 comments on commit 8645659

Please sign in to comment.