Auto merge of #38601 - schulzch:master, r=brson

Partial fix for #38489.

Fixes script name resolution for windows by invoking `emcc.bat` instead of `emcc`, etc.

Remaining issue:
```
Traceback (most recent call last):
  File "C:\Program Files\Emscripten\emscripten\1.35.0\\emcc", line 1309, in <module>
    final = shared.Building.llvm_opt(final, link_opts, DEFAULT_FINAL)
  File "C:\Program Files\Emscripten\emscripten\1.35.0\tools\shared.py", line 1471, in llvm_opt
    assert os.path.exists(target), 'Failed to run llvm optimizations: ' + output
AssertionError: Failed to run llvm optimizations:
```
This commit is contained in:
bors 2016-12-31 00:50:46 +00:00
commit b68d3293e3
4 changed files with 24 additions and 4 deletions

View file

@ -9,11 +9,12 @@
// except according to those terms.
use super::{Target, TargetOptions};
use super::emscripten_base::{cmd};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: "emcc".to_string(),
ar: "emar".to_string(),
linker: cmd("emcc"),
ar: cmd("emar"),
dynamic_linking: false,
executables: true,

View file

@ -0,0 +1,17 @@
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
pub fn cmd(name: &str) -> String {
if cfg!(windows) {
format!("{}.bat", name)
} else {
name.to_string()
}
}

View file

@ -58,6 +58,7 @@
mod arm_base;
mod bitrig_base;
mod dragonfly_base;
mod emscripten_base;
mod freebsd_base;
mod haiku_base;
mod linux_base;

View file

@ -9,11 +9,12 @@
// except according to those terms.
use super::{Target, TargetOptions};
use super::emscripten_base::{cmd};
pub fn target() -> Result<Target, String> {
let opts = TargetOptions {
linker: "emcc".to_string(),
ar: "emar".to_string(),
linker: cmd("emcc"),
ar: cmd("emar"),
dynamic_linking: false,
executables: true,