Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure rustc_driver links to an unwinder #77815

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']