From afa72b5dd6b75ed4577a4e73c1525dcd58d93b51 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 28 Sep 2016 16:08:59 +0000 Subject: [PATCH] Don't build any native compiler-builtin components for emscripten --- src/bootstrap/sanity.rs | 7 +++++++ src/libcompiler_builtins/build.rs | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/src/bootstrap/sanity.rs b/src/bootstrap/sanity.rs index 9429af56525..c4e6399c2c3 100644 --- a/src/bootstrap/sanity.rs +++ b/src/bootstrap/sanity.rs @@ -95,6 +95,13 @@ pub fn check(build: &mut Build) { // We're gonna build some custom C code here and there, host triples // also build some C++ shims for LLVM so we need a C++ compiler. for target in build.config.target.iter() { + // On emscripten we don't actually need the C compiler to just + // build the target artifacts, only for testing. For the sake + // of easier bot configuration, just skip detection. + if target.contains("emscripten") { + continue; + } + need_cmd(build.cc(target).as_ref()); if let Some(ar) = build.ar(target) { need_cmd(ar.as_ref()); diff --git a/src/libcompiler_builtins/build.rs b/src/libcompiler_builtins/build.rs index 66c683333b9..acbd39bb163 100644 --- a/src/libcompiler_builtins/build.rs +++ b/src/libcompiler_builtins/build.rs @@ -73,6 +73,12 @@ fn extend(&mut self, sources: &[&'static str]) { fn main() { let target = env::var("TARGET").expect("TARGET was not set"); + + // Emscripten's runtime includes all the builtins + if target.contains("emscripten") { + return; + } + let cfg = &mut gcc::Config::new(); if target.contains("msvc") {