Skip to content

Commit

Permalink
Statically link proc_macro into proc macros.
Browse files Browse the repository at this point in the history
  • Loading branch information
eddyb committed Nov 30, 2018
1 parent 67afeef commit 188d2da
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 0 additions & 2 deletions src/libproc_macro/Cargo.toml
Expand Up @@ -5,5 +5,3 @@ version = "0.0.0"

[lib]
path = "lib.rs"
crate-type = ["dylib"]

5 changes: 2 additions & 3 deletions src/librustc/middle/dependency_format.rs
Expand Up @@ -127,9 +127,8 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
sess.crt_static() => Linkage::Static,
config::CrateType::Executable => Linkage::Dynamic,

// proc-macro crates are required to be dylibs, and they're currently
// required to link to libsyntax as well.
config::CrateType::ProcMacro => Linkage::Dynamic,
// proc-macro crates are mostly cdylibs, but we also need metadata.
config::CrateType::ProcMacro => Linkage::Static,

// No linkage happens with rlibs, we just needed the metadata (which we
// got long ago), so don't bother with anything.
Expand Down
1 change: 1 addition & 0 deletions src/librustc_cratesio_shim/src/lib.rs
Expand Up @@ -15,4 +15,5 @@

extern crate bitflags;
extern crate log;
extern crate proc_macro;
extern crate unicode_width;

0 comments on commit 188d2da

Please sign in to comment.