Skip to content

Commit 4a4c949

Browse files
committed
[WIP]
1 parent b56b261 commit 4a4c949

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ fn main() {
5757
let mut cmd = Command::new(rustc);
5858
cmd.args(&args).env(bootstrap::util::dylib_path_var(), env::join_paths(&dylib_path).unwrap());
5959

60+
cmd.arg("-Clink-arg=-rdynamic"); // Export __cg_clif_global_atomic_mutex from rustc executable for proc macros
61+
6062
// Get the name of the crate we're compiling, if any.
6163
let crate_name =
6264
args.windows(2).find(|args| args[0] == "--crate-name").and_then(|args| args[1].to_str());

src/rustc/rustc.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
extern crate libc;
2+
3+
#[no_mangle]
4+
#[used]
5+
pub static mut __cg_clif_global_atomic_mutex: libc::pthread_mutex_t = libc::PTHREAD_MUTEX_INITIALIZER;
6+
17
fn main() {
28
// Pull in jemalloc when enabled.
39
//
@@ -26,6 +32,8 @@ fn main() {
2632
static _F6: unsafe extern "C" fn(*mut c_void) = jemalloc_sys::free;
2733
}
2834

35+
unsafe { libc::pthread_mutex_init(&mut __cg_clif_global_atomic_mutex, 0 as *const _); }
36+
2937
rustc_driver::set_sigpipe_handler();
3038
rustc_driver::main()
3139
}

0 commit comments

Comments
 (0)