diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2019-10-22 08:51:35 -0700 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2019-12-11 09:50:11 -0500 |
| commit | 7f23e6e8d7479d8a430e007fab9b195b7ea0d261 (patch) | |
| tree | aaa866fa4909e2fd82855c895dd0b85a674ed407 /src/librustc_codegen_llvm/debuginfo | |
| parent | 033662dfbca088937b9cdfd3d9584015b5e375b2 (diff) | |
| download | rust-7f23e6e8d7479d8a430e007fab9b195b7ea0d261.tar.gz rust-7f23e6e8d7479d8a430e007fab9b195b7ea0d261.zip | |
rustc: Link LLVM directly into rustc again
This commit builds on #65501 continue to simplify the build system and compiler now that we no longer have multiple LLVM backends to ship by default. Here this switches the compiler back to what it once was long long ago, which is linking LLVM directly to the compiler rather than dynamically loading it at runtime. The `codegen-backends` directory of the sysroot no longer exists and all relevant support in the build system is removed. Note that `rustc` still supports a dynamically loaded codegen backend as it did previously, it just no longer supports dynamically loaded codegen backends in its own sysroot. Additionally as part of this the `librustc_codegen_llvm` crate now once again explicitly depends on all of its crates instead of implicitly loading them through the sysroot. This involved filling out its `Cargo.toml` and deleting all the now-unnecessary `extern crate` annotations in the header of the crate. (this in turn required adding a number of imports for names of macros too). The end results of this change are: * Rustbuild's build process for the compiler as all the "oh don't forget the codegen backend" checks can be easily removed. * Building `rustc_codegen_llvm` is much simpler since it's simply another compiler crate. * Managing the dependencies of `rustc_codegen_llvm` is much simpler since it's "just another `Cargo.toml` to edit" * The build process should be a smidge faster because there's more parallelism in the main rustc build step rather than splitting `librustc_codegen_llvm` out to its own step. * The compiler is expected to be slightly faster by default because the codegen backend does not need to be dynamically loaded. * Disabling LLVM as part of rustbuild is still supported, supporting multiple codegen backends is still supported, and dynamic loading of a codegen backend is still supported.
Diffstat (limited to 'src/librustc_codegen_llvm/debuginfo')
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/gdb.rs | 1 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/metadata.rs | 3 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/mod.rs | 1 | ||||
| -rw-r--r-- | src/librustc_codegen_llvm/debuginfo/source_loc.rs | 1 |
4 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/debuginfo/gdb.rs b/src/librustc_codegen_llvm/debuginfo/gdb.rs index 9ed1c1730a6..739437ac27b 100644 --- a/src/librustc_codegen_llvm/debuginfo/gdb.rs +++ b/src/librustc_codegen_llvm/debuginfo/gdb.rs @@ -7,6 +7,7 @@ use crate::builder::Builder; use crate::value::Value; use rustc::session::config::DebugInfo; use rustc_codegen_ssa::traits::*; +use rustc::bug; use syntax::attr; use syntax::symbol::sym; diff --git a/src/librustc_codegen_llvm/debuginfo/metadata.rs b/src/librustc_codegen_llvm/debuginfo/metadata.rs index 1847e4e9fa9..8327ff257c2 100644 --- a/src/librustc_codegen_llvm/debuginfo/metadata.rs +++ b/src/librustc_codegen_llvm/debuginfo/metadata.rs @@ -35,10 +35,13 @@ use rustc::session::config::{self, DebugInfo}; use rustc::util::nodemap::FxHashMap; use rustc_fs_util::path_to_c_string; use rustc_data_structures::small_c_str::SmallCStr; +use rustc_data_structures::const_cstr; use rustc_target::abi::HasDataLayout; use syntax::ast; use syntax::symbol::{Interner, Symbol}; use syntax_pos::{self, Span, FileName}; +use rustc::{bug, span_bug}; +use log::debug; use libc::{c_uint, c_longlong}; use std::collections::hash_map::Entry; diff --git a/src/librustc_codegen_llvm/debuginfo/mod.rs b/src/librustc_codegen_llvm/debuginfo/mod.rs index a3782ecd92d..1de298de75f 100644 --- a/src/librustc_codegen_llvm/debuginfo/mod.rs +++ b/src/librustc_codegen_llvm/debuginfo/mod.rs @@ -33,6 +33,7 @@ use rustc_codegen_ssa::mir::debuginfo::{FunctionDebugContext, DebugScope, use libc::c_uint; use std::cell::RefCell; use std::ffi::CString; +use log::debug; use smallvec::SmallVec; use syntax_pos::{self, BytePos, Span, Pos}; diff --git a/src/librustc_codegen_llvm/debuginfo/source_loc.rs b/src/librustc_codegen_llvm/debuginfo/source_loc.rs index ccb3bde1cbe..82183fa9bd7 100644 --- a/src/librustc_codegen_llvm/debuginfo/source_loc.rs +++ b/src/librustc_codegen_llvm/debuginfo/source_loc.rs @@ -8,6 +8,7 @@ use crate::llvm; use crate::llvm::debuginfo::DIScope; use crate::builder::Builder; use rustc_codegen_ssa::traits::*; +use log::debug; use libc::c_uint; use syntax_pos::{Span, Pos}; |
