Statically link proc_macro into proc macros.

This commit is contained in:
Eduard-Mihai Burtescu 2018-04-26 14:11:08 +03:00
parent 67afeef9e4
commit 188d2dafcd
3 changed files with 3 additions and 5 deletions

View file

@ -5,5 +5,3 @@ version = "0.0.0"
[lib]
path = "lib.rs"
crate-type = ["dylib"]

View file

@ -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.

View file

@ -15,4 +15,5 @@
extern crate bitflags;
extern crate log;
extern crate proc_macro;
extern crate unicode_width;