]> git.lizzy.rs Git - rust.git/commitdiff
Re-enable linker override for cross-compilation
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Mon, 16 Oct 2017 00:20:01 +0000 (03:20 +0300)
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>
Mon, 16 Oct 2017 00:22:17 +0000 (03:22 +0300)
src/bootstrap/lib.rs

index 63dc17910f08a7f03555c8cbc92ad38647ffdbfb..6ac919d3fbdda544922e5cf1ef678d9e75e53991 100644 (file)
@@ -661,8 +661,9 @@ fn cxx(&self, target: Interned<String>) -> Result<&Path, String> {
 
     /// Returns the path to the linker for the given target if it needs to be overriden.
     fn linker(&self, target: Interned<String>) -> Option<&Path> {
-        if let Some(config) = self.config.target_config.get(&target) {
-            config.linker.as_ref().map(|p| &**p)
+        if let Some(linker) = self.config.target_config.get(&target)
+                                                       .and_then(|c| c.linker.as_ref()) {
+            Some(linker)
         } else if target != self.config.build &&
                   !target.contains("msvc") && !target.contains("emscripten") {
             Some(self.cc(target))