about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2015-08-11 01:09:21 +0200
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2015-08-19 18:06:34 +0200
commitc97759699264c6b1fa0e88420cd3c720df25e594 (patch)
treecb1f47d6c1a2412e66dfa81b899f797d0780137c
parentaca2057ed5fb7af3f8905b2bc01f72fa001c35c8 (diff)
downloadrust-c97759699264c6b1fa0e88420cd3c720df25e594.tar.gz
rust-c97759699264c6b1fa0e88420cd3c720df25e594.zip
rustc_back: add configure options for default linker and ar
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
-rwxr-xr-xconfigure4
-rw-r--r--mk/target.mk4
-rw-r--r--src/librustc_back/target/mod.rs4
3 files changed, 10 insertions, 2 deletions
diff --git a/configure b/configure
index 071788cf79f..dc9d7d75310 100755
--- a/configure
+++ b/configure
@@ -607,6 +607,10 @@ valopt aarch64-linux-android-ndk "" "aarch64-linux-android NDK standalone path"
 valopt release-channel "dev" "the name of the release channel to build"
 valopt musl-root "/usr/local" "MUSL root installation directory"
 
+# Used on systems where "cc" and "ar" are unavailable
+valopt default-linker "cc" "the default linker"
+valopt default-ar     "ar" "the default ar"
+
 # Many of these are saved below during the "writing configuration" step
 # (others are conditionally saved).
 opt_nosave manage-submodules 1 "let the build manage the git submodules"
diff --git a/mk/target.mk b/mk/target.mk
index aae66c45b57..408ab966908 100644
--- a/mk/target.mk
+++ b/mk/target.mk
@@ -13,6 +13,10 @@
 # this exists can be found on issue #2400
 export CFG_COMPILER_HOST_TRIPLE
 
+# Used as defaults for the runtime ar and cc tools
+export CFG_DEFAULT_LINKER
+export CFG_DEFAULT_AR
+
 # The standard libraries should be held up to a higher standard than any old
 # code, make sure that these common warnings are denied by default. These can
 # be overridden during development temporarily. For stage0, we allow warnings
diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs
index d9cfdaacc90..542791ae904 100644
--- a/src/librustc_back/target/mod.rs
+++ b/src/librustc_back/target/mod.rs
@@ -185,8 +185,8 @@ impl Default for TargetOptions {
     fn default() -> TargetOptions {
         TargetOptions {
             data_layout: String::new(),
-            linker: "cc".to_string(),
-            ar: "ar".to_string(),
+            linker: option_env!("CFG_DEFAULT_LINKER").unwrap_or("cc").to_string(),
+            ar: option_env!("CFG_DEFAULT_AR").unwrap_or("ar").to_string(),
             pre_link_args: Vec::new(),
             post_link_args: Vec::new(),
             cpu: "generic".to_string(),