about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-28 11:52:36 -0700
committerGitHub <noreply@github.com>2016-06-28 11:52:36 -0700
commit366de839ae9794411419c5b579c829e18adde613 (patch)
treee57c7bb7777858f221e8af85c27f7a569b94473d
parent59152a45af3688b53e677ea2362339643499c1a4 (diff)
parent3fd411e017ca78eb814272a3b3a71c8b755c4550 (diff)
downloadrust-366de839ae9794411419c5b579c829e18adde613.tar.gz
rust-366de839ae9794411419c5b579c829e18adde613.zip
Auto merge of #34519 - alexcrichton:fix-nightlies, r=brson
Try to fix the nightlies

They look to be failing right after the CMake PR landed. I've diagnosed and confirmed the first issue fixed, the second is a bit of a shot in the dark to see if it fixes things.
-rw-r--r--mk/llvm.mk14
-rw-r--r--src/bootstrap/build/native.rs69
2 files changed, 59 insertions, 24 deletions
diff --git a/mk/llvm.mk b/mk/llvm.mk
index cc868a49e4b..6d8601f3dad 100644
--- a/mk/llvm.mk
+++ b/mk/llvm.mk
@@ -27,12 +27,18 @@ endif
 
 define DEF_LLVM_RULES
 
+ifeq ($(1),$$(CFG_BUILD))
+LLVM_DEPS_TARGET_$(1) := $$(LLVM_DEPS)
+else
+LLVM_DEPS_TARGET_$(1) := $$(LLVM_DEPS) $$(LLVM_CONFIG_$$(CFG_BUILD))
+endif
+
 # If CFG_LLVM_ROOT is defined then we don't build LLVM ourselves
 ifeq ($(CFG_LLVM_ROOT),)
 
 LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
 
-$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
+$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS_TARGET_$(1)) $$(LLVM_STAMP_$(1))
 	@$$(call E, cmake: llvm)
 ifeq ($$(findstring msvc,$(1)),msvc)
 	$$(Q)$$(CFG_CMAKE) --build $$(CFG_LLVM_BUILD_DIR_$(1)) \
@@ -42,7 +48,13 @@ else
 endif
 	$$(Q)touch $$(LLVM_CONFIG_$(1))
 
+ifeq ($$(findstring msvc,$(1)),msvc)
 clean-llvm$(1):
+else
+clean-llvm$(1):
+	@$$(call E, clean: llvm)
+	$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) clean
+endif
 
 else
 clean-llvm$(1):
diff --git a/src/bootstrap/build/native.rs b/src/bootstrap/build/native.rs
index 5691b2da6a4..1e677aa48b0 100644
--- a/src/bootstrap/build/native.rs
+++ b/src/bootstrap/build/native.rs
@@ -135,27 +135,64 @@ pub fn compiler_rt(build: &Build, target: &str) {
     let dst = build.compiler_rt_out(target);
     let arch = target.split('-').next().unwrap();
     let mode = if build.config.rust_optimize {"Release"} else {"Debug"};
+
+    let build_llvm_config = build.llvm_config(&build.config.build);
+    let mut cfg = cmake::Config::new(build.src.join("src/compiler-rt"));
+    cfg.target(target)
+       .host(&build.config.build)
+       .out_dir(&dst)
+       .profile(mode)
+       .define("LLVM_CONFIG_PATH", build_llvm_config)
+       .define("COMPILER_RT_DEFAULT_TARGET_TRIPLE", target)
+       .define("COMPILER_RT_BUILD_SANITIZERS", "OFF")
+       .define("COMPILER_RT_BUILD_EMUTLS", "OFF")
+       // inform about c/c++ compilers, the c++ compiler isn't actually used but
+       // it's needed to get the initial configure to work on all platforms.
+       .define("CMAKE_C_COMPILER", build.cc(target))
+       .define("CMAKE_CXX_COMPILER", build.cc(target));
+
     let (dir, build_target, libname) = if target.contains("linux") ||
                                           target.contains("freebsd") ||
                                           target.contains("netbsd") {
-        let os = if target.contains("android") {"-android"} else {""};
-        let arch = if arch.starts_with("arm") && target.contains("eabihf") {
-            "armhf"
+        let os_extra = if target.contains("android") && target.contains("arm") {
+            "-android"
         } else {
-            arch
+            ""
         };
-        let target = format!("clang_rt.builtins-{}{}", arch, os);
+        let builtins_arch = match arch {
+            "i586" => "i386",
+            "arm" | "armv7" if target.contains("android") => "armhf",
+            "arm" if target.contains("eabihf") => "armhf",
+            _ => arch,
+        };
+        let target = format!("clang_rt.builtins-{}{}", builtins_arch, os_extra);
         ("linux".to_string(), target.clone(), target)
-    } else if target.contains("darwin") {
-        let target = format!("clang_rt.builtins_{}_osx", arch);
+    } else if target.contains("apple-darwin") {
+        let builtins_arch = match arch {
+            "i686" => "i386",
+            _ => arch,
+        };
+        let target = format!("clang_rt.builtins_{}_osx", builtins_arch);
+        ("builtins".to_string(), target.clone(), target)
+    } else if target.contains("apple-ios") {
+        cfg.define("COMPILER_RT_ENABLE_IOS", "ON");
+        let target = match arch {
+            "armv7s" => "hard_pic_armv7em_macho_embedded".to_string(),
+            "aarch64" => "builtins_arm64_ios".to_string(),
+            _ => format!("hard_pic_{}_macho_embedded", arch),
+        };
         ("builtins".to_string(), target.clone(), target)
     } else if target.contains("windows-gnu") {
         let target = format!("clang_rt.builtins-{}", arch);
         ("windows".to_string(), target.clone(), target)
     } else if target.contains("windows-msvc") {
+        let builtins_arch = match arch {
+            "i586" | "i686" => "i386",
+            _ => arch,
+        };
         (format!("windows/{}", mode),
          "lib/builtins/builtins".to_string(),
-         format!("clang_rt.builtins-{}", arch.replace("i686", "i386")))
+         format!("clang_rt.builtins-{}", builtins_arch))
     } else {
         panic!("can't get os from target: {}", target)
     };
@@ -168,21 +205,7 @@ pub fn compiler_rt(build: &Build, target: &str) {
     }
     let _ = fs::remove_dir_all(&dst);
     t!(fs::create_dir_all(&dst));
-    let build_llvm_config = build.llvm_config(&build.config.build);
-    let mut cfg = cmake::Config::new(build.src.join("src/compiler-rt"));
-    cfg.target(target)
-       .host(&build.config.build)
-       .out_dir(&dst)
-       .profile(mode)
-       .define("LLVM_CONFIG_PATH", build_llvm_config)
-       .define("COMPILER_RT_DEFAULT_TARGET_TRIPLE", target)
-       .define("COMPILER_RT_BUILD_SANITIZERS", "OFF")
-       .define("COMPILER_RT_BUILD_EMUTLS", "OFF")
-       // inform about c/c++ compilers, the c++ compiler isn't actually used but
-       // it's needed to get the initial configure to work on all platforms.
-       .define("CMAKE_C_COMPILER", build.cc(target))
-       .define("CMAKE_CXX_COMPILER", build.cc(target))
-       .build_target(&build_target);
+    cfg.build_target(&build_target);
     cfg.build();
 }