use rustc::middle::cstore::{EncodedMetadata, LibSource, NativeLibrary, NativeLibraryKind};
use rustc::middle::dependency_format::Linkage;
-use rustc::session::config::{
+use rustc_data_structures::fx::FxHashSet;
+use rustc_fs_util::fix_windows_verbatim_for_gcc;
+use rustc_hir::def_id::CrateNum;
+use rustc_session::config::{
self, CFGuard, DebugInfo, OutputFilenames, OutputType, PrintRequest, Sanitizer,
};
-use rustc::session::search_paths::PathKind;
+use rustc_session::search_paths::PathKind;
/// For all the linkers we support, and information they might
/// need out of the shared crate context before we get rid of it.
-use rustc::session::{filesearch, Session};
-use rustc_data_structures::fx::FxHashSet;
-use rustc_fs_util::fix_windows_verbatim_for_gcc;
-use rustc_hir::def_id::CrateNum;
+use rustc_session::{filesearch, Session};
use rustc_span::symbol::Symbol;
use rustc_target::spec::{LinkerFlavor, PanicStrategy, RelroLevel};
cmd.args(args);
}
if let Some(args) = sess.target.target.options.pre_link_args_crt.get(&flavor) {
- if sess.crt_static() {
+ if sess.crt_static(Some(crate_type)) {
cmd.args(args);
}
}
cmd.arg(get_file_path(sess, obj));
}
- if crate_type == config::CrateType::Executable && sess.crt_static() {
+ if crate_type == config::CrateType::Executable && sess.crt_static(Some(crate_type)) {
for obj in &sess.target.target.options.pre_link_objects_exe_crt {
cmd.arg(get_file_path(sess, obj));
}
for obj in &sess.target.target.options.post_link_objects {
cmd.arg(get_file_path(sess, obj));
}
- if sess.crt_static() {
+ if sess.crt_static(Some(crate_type)) {
for obj in &sess.target.target.options.post_link_objects_crt {
cmd.arg(get_file_path(sess, obj));
}
let more_args = &sess.opts.cg.link_arg;
let mut args = args.iter().chain(more_args.iter()).chain(used_link_args.iter());
- if is_pic(sess) && !sess.crt_static() && !args.any(|x| *x == "-static") {
+ if is_pic(sess) && !sess.crt_static(Some(crate_type)) && !args.any(|x| *x == "-static")
+ {
position_independent_executable = true;
}
}
if crate_type != config::CrateType::Executable {
cmd.build_dylib(out_filename);
}
- if crate_type == config::CrateType::Executable && sess.crt_static() {
+ if crate_type == config::CrateType::Executable && sess.crt_static(Some(crate_type)) {
cmd.build_static_executable();
}