about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock1
-rw-r--r--src/librustc_codegen_ssa/back/link.rs14
-rw-r--r--src/librustc_target/Cargo.toml1
-rw-r--r--src/librustc_target/spec/aarch64_uwp_windows_msvc.rs13
-rw-r--r--src/librustc_target/spec/i686_uwp_windows_msvc.rs13
-rw-r--r--src/librustc_target/spec/x86_64_uwp_windows_msvc.rs13
6 files changed, 14 insertions, 41 deletions
diff --git a/Cargo.lock b/Cargo.lock
index f2356a26152..c08d7444d14 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3126,7 +3126,6 @@ name = "rustc_target"
 version = "0.0.0"
 dependencies = [
  "bitflags 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_data_structures 0.0.0",
  "serialize 0.0.0",
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
index 3f6a1a72ea6..ea8e55145fa 100644
--- a/src/librustc_codegen_ssa/back/link.rs
+++ b/src/librustc_codegen_ssa/back/link.rs
@@ -1027,6 +1027,20 @@ fn link_args<'a, B: ArchiveBuilder<'a>>(cmd: &mut dyn Linker,
     let t = &sess.target.target;
 
     cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
+
+    if t.linker_flavor == LinkerFlavor::Msvc && t.target_vendor == "uwp" {
+        let link_tool = windows_registry::find_tool("x86_64-pc-windows-msvc", "link.exe")
+            .expect("no path found for link.exe");
+
+        let original_path = link_tool.path();
+        let root_lib_path = original_path.ancestors().skip(4).next().unwrap();
+        if t.arch == "aarch64".to_string() {
+            cmd.include_path(&root_lib_path.join(format!("lib\\arm64\\store")));
+        } else {
+            cmd.include_path(&root_lib_path.join(format!("lib\\{}\\store", t.arch)));
+        }
+    }
+    
     for obj in codegen_results.modules.iter().filter_map(|m| m.object.as_ref()) {
         cmd.add_object(obj);
     }
diff --git a/src/librustc_target/Cargo.toml b/src/librustc_target/Cargo.toml
index 940acf232ad..cab1e0e0137 100644
--- a/src/librustc_target/Cargo.toml
+++ b/src/librustc_target/Cargo.toml
@@ -11,7 +11,6 @@ path = "lib.rs"
 [dependencies]
 bitflags = "1.0"
 log = "0.4"
-cc = "1.0.1"
 rustc_data_structures = { path = "../librustc_data_structures" }
 rustc_serialize = { path = "../libserialize", package = "serialize" }
 syntax_pos = { path = "../libsyntax_pos" }
diff --git a/src/librustc_target/spec/aarch64_uwp_windows_msvc.rs b/src/librustc_target/spec/aarch64_uwp_windows_msvc.rs
index ab1b6705a1d..5d8b829f2ab 100644
--- a/src/librustc_target/spec/aarch64_uwp_windows_msvc.rs
+++ b/src/librustc_target/spec/aarch64_uwp_windows_msvc.rs
@@ -1,5 +1,4 @@
 use crate::spec::{LinkerFlavor, Target, TargetResult, PanicStrategy};
-use cc::windows_registry;
 
 pub fn target() -> TargetResult {
     let mut base = super::windows_uwp_msvc_base::opts();
@@ -9,18 +8,6 @@ pub fn target() -> TargetResult {
     // FIXME: this shouldn't be panic=abort, it should be panic=unwind
     base.panic_strategy = PanicStrategy::Abort;
 
-    let link_tool = windows_registry::find_tool("x86_64-pc-windows-msvc", "link.exe")
-        .expect("no path found for link.exe");
-
-    let original_path = link_tool.path();
-    let lib_root_path = original_path.ancestors().skip(4).next().unwrap().display();
-
-    base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
-        .push(format!("{}{}{}",
-            "/LIBPATH:".to_string(),
-            lib_root_path,
-            "lib\\arm64\\store".to_string()));
-
     Ok(Target {
         llvm_target: "aarch64-pc-windows-msvc".to_string(),
         target_endian: "little".to_string(),
diff --git a/src/librustc_target/spec/i686_uwp_windows_msvc.rs b/src/librustc_target/spec/i686_uwp_windows_msvc.rs
index bc5631439d1..5e8e8c2a414 100644
--- a/src/librustc_target/spec/i686_uwp_windows_msvc.rs
+++ b/src/librustc_target/spec/i686_uwp_windows_msvc.rs
@@ -1,5 +1,4 @@
 use crate::spec::{LinkerFlavor, Target, TargetResult};
-use cc::windows_registry;
 
 pub fn target() -> TargetResult {
     let mut base = super::windows_uwp_msvc_base::opts();
@@ -7,18 +6,6 @@ pub fn target() -> TargetResult {
     base.max_atomic_width = Some(64);
     base.has_elf_tls = true;
 
-    let link_tool = windows_registry::find_tool("x86_64-pc-windows-msvc", "link.exe")
-        .expect("no path found for link.exe");
-
-    let original_path = link_tool.path();
-    let lib_root_path = original_path.ancestors().skip(4).next().unwrap().display();
-
-    base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
-            .push(format!("{}{}{}",
-            "/LIBPATH:".to_string(),
-            lib_root_path,
-            "lib\\x86\\store".to_string()));
-
     Ok(Target {
         llvm_target: "i686-pc-windows-msvc".to_string(),
         target_endian: "little".to_string(),
diff --git a/src/librustc_target/spec/x86_64_uwp_windows_msvc.rs b/src/librustc_target/spec/x86_64_uwp_windows_msvc.rs
index 8c15c7c22fc..40dd52c1591 100644
--- a/src/librustc_target/spec/x86_64_uwp_windows_msvc.rs
+++ b/src/librustc_target/spec/x86_64_uwp_windows_msvc.rs
@@ -1,5 +1,4 @@
 use crate::spec::{LinkerFlavor, Target, TargetResult};
-use cc::windows_registry;
 
 pub fn target() -> TargetResult {
     let mut base = super::windows_uwp_msvc_base::opts();
@@ -7,18 +6,6 @@ pub fn target() -> TargetResult {
     base.max_atomic_width = Some(64);
     base.has_elf_tls = true;
 
-    let link_tool = windows_registry::find_tool("x86_64-pc-windows-msvc", "link.exe")
-        .expect("no path found for link.exe");
-
-    let original_path = link_tool.path();
-    let lib_root_path = original_path.ancestors().skip(4).next().unwrap().display();
-
-    base.pre_link_args.get_mut(&LinkerFlavor::Msvc).unwrap()
-            .push(format!("{}{}{}",
-            "/LIBPATH:".to_string(),
-            lib_root_path,
-            "lib\\x64\\store".to_string()));
-
     Ok(Target {
         llvm_target: "x86_64-pc-windows-msvc".to_string(),
         target_endian: "little".to_string(),