Skip to content

mk: Don't consider LLVM done until it's done #34563

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mk/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,19 @@ endif
ifeq ($(CFG_LLVM_ROOT),)

LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
LLVM_DONE_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-finished-building

$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS_TARGET_$(1)) $$(LLVM_STAMP_$(1))
$$(LLVM_CONFIG_$(1)): $$(LLVM_DONE_$(1))

$$(LLVM_DONE_$(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)) \
--config $$(LLVM_BUILD_CONFIG_MODE)
else
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1))
endif
$$(Q)touch $$(LLVM_CONFIG_$(1))
$$(Q)touch $$@

ifeq ($$(findstring msvc,$(1)),msvc)
clean-llvm$(1):
Expand Down
10 changes: 6 additions & 4 deletions src/bootstrap/build/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@

use std::path::Path;
use std::process::Command;
use std::fs;
use std::fs::{self, File};

use build_helper::output;
use cmake;
use gcc;

use build::Build;
use build::util::{exe, staticlib, up_to_date};
use build::util::{staticlib, up_to_date};

/// Compile LLVM for `target`.
pub fn llvm(build: &Build, target: &str) {
Expand All @@ -43,9 +43,9 @@ pub fn llvm(build: &Build, target: &str) {
// artifacts are missing) then we keep going, otherwise we bail out.
let dst = build.llvm_out(target);
let stamp = build.src.join("src/rustllvm/llvm-auto-clean-trigger");
let llvm_config = dst.join("bin").join(exe("llvm-config", target));
let done_stamp = dst.join("llvm-finished-building");
build.clear_if_dirty(&dst, &stamp);
if fs::metadata(llvm_config).is_ok() {
if fs::metadata(&done_stamp).is_ok() {
return
}

Expand Down Expand Up @@ -111,6 +111,8 @@ pub fn llvm(build: &Build, target: &str) {
// tools. Figure out how to filter them down and only build the right
// tools and libs on all platforms.
cfg.build();

t!(File::create(&done_stamp));
}

fn check_llvm_version(build: &Build, llvm_config: &Path) {
Expand Down