Skip to content

Commit 0577b60

Browse files
committed
Re-enable linker override for cross-compilation
1 parent 89d9ce4 commit 0577b60

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/bootstrap/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -661,8 +661,9 @@ impl Build {
661661

662662
/// Returns the path to the linker for the given target if it needs to be overriden.
663663
fn linker(&self, target: Interned<String>) -> Option<&Path> {
664-
if let Some(config) = self.config.target_config.get(&target) {
665-
config.linker.as_ref().map(|p| &**p)
664+
if let Some(linker) = self.config.target_config.get(&target)
665+
.and_then(|c| c.linker.as_ref()) {
666+
Some(linker)
666667
} else if target != self.config.build &&
667668
!target.contains("msvc") && !target.contains("emscripten") {
668669
Some(self.cc(target))

0 commit comments

Comments
 (0)