diff options
| author | Andy Russell <arussell123@gmail.com> | 2018-10-12 15:35:55 -0400 |
|---|---|---|
| committer | Andy Russell <arussell123@gmail.com> | 2018-10-12 17:29:40 -0400 |
| commit | 00e1f5b8df5382a7296ba463a8e53ce55bf4c6a5 (patch) | |
| tree | 2ec2525efd16d091c0d6f3647f6c8c8aa29c5d74 /src/librustc_codegen_llvm | |
| parent | e9e27e6a6258b3adf00a5dd35d2676656224880d (diff) | |
| download | rust-00e1f5b8df5382a7296ba463a8e53ce55bf4c6a5.tar.gz rust-00e1f5b8df5382a7296ba463a8e53ce55bf4c6a5.zip | |
exit with status code 101 on fatal LLVM error
Fixes #54992.
Diffstat (limited to 'src/librustc_codegen_llvm')
| -rw-r--r-- | src/librustc_codegen_llvm/llvm/ffi.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/llvm_util.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index c9f51efdc50..6108af6c884 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -482,6 +482,8 @@ pub mod debuginfo { extern { pub type ModuleBuffer; } extern "C" { + pub fn LLVMRustInstallFatalErrorHandler(); + // Create and destroy contexts. pub fn LLVMRustContextCreate(shouldDiscardNames: bool) -> &'static mut Context; pub fn LLVMContextDispose(C: &'static mut Context); diff --git a/src/librustc_codegen_llvm/llvm_util.rs b/src/librustc_codegen_llvm/llvm_util.rs index 8456cf2f480..0a80fdddbf9 100644 --- a/src/librustc_codegen_llvm/llvm_util.rs +++ b/src/librustc_codegen_llvm/llvm_util.rs @@ -56,6 +56,8 @@ unsafe fn configure_llvm(sess: &Session) { let mut llvm_c_strs = Vec::with_capacity(n_args + 1); let mut llvm_args = Vec::with_capacity(n_args + 1); + llvm::LLVMRustInstallFatalErrorHandler(); + { let mut add = |arg: &str| { let s = CString::new(arg).unwrap(); |
