summaryrefslogtreecommitdiff
path: root/src/librustc/middle/trans
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc/middle/trans')
-rw-r--r--src/librustc/middle/trans/base.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/librustc/middle/trans/base.rs b/src/librustc/middle/trans/base.rs
index cf671bdce67..e649644e8b9 100644
--- a/src/librustc/middle/trans/base.rs
+++ b/src/librustc/middle/trans/base.rs
@@ -2883,6 +2883,10 @@ pub fn trans_crate(sess: session::Session,
reachable_map: @mut HashSet<ast::node_id>,
maps: astencode::Maps)
-> (ContextRef, ModuleRef, LinkMeta) {
+ // Before we touch LLVM, make sure that multithreading is enabled.
+ if unsafe { !llvm::LLVMRustStartMultithreading() } {
+ sess.bug("couldn't enable multi-threaded LLVM");
+ }
let mut symbol_hasher = hash::default_state();
let link_meta = link::build_link_meta(sess, crate, output, &mut symbol_hasher);
@@ -2897,12 +2901,6 @@ pub fn trans_crate(sess: session::Session,
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
let llmod_id = link_meta.name.to_owned() + ".rc";
- // FIXME(#6511): get LLVM building with --enable-threads so this
- // function can be called
- // if !llvm::LLVMRustStartMultithreading() {
- // sess.bug("couldn't enable multi-threaded LLVM");
- // }
-
let ccx = @mut CrateContext::new(sess,
llmod_id,
tcx,