From a7f329fb442215c263b7c403769de26252d06803 Mon Sep 17 00:00:00 2001
From: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Date: Fri, 26 Oct 2018 10:18:48 +0200
Subject: [PATCH] rustbuild: use configured linker to build boostrap

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
---
 src/bootstrap/bootstrap.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index ffc5adbebb34f..b5dc0090c8b9c 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -632,6 +632,9 @@ def build_bootstrap(self):
             target_features += ["-crt-static"]
         if target_features:
             env["RUSTFLAGS"] += "-C target-feature=" + (",".join(target_features)) + " "
+        target_linker = self.get_toml("linker", build_section)
+        if target_linker is not None:
+            env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
 
         env["PATH"] = os.path.join(self.bin_root(), "bin") + \
             os.pathsep + env["PATH"]