Auto merge of #40123 - TimNN:llvm40, r=alexcrichton

LLVM 4.0 Upgrade

Since nobody has done this yet, I decided to get things started:

**Todo:**

* [x] push the relevant commits to `rust-lang/llvm` and `rust-lang/compiler-rt`
* [x] cleanup `.gitmodules`
* [x] Verify if there are any other commits from `rust-lang/llvm` which need backporting
* [x] Investigate / fix debuginfo ("`<optimized out>`") failures
* [x] Use correct emscripten version in docker image

---

Closes #37609.

---

**Test results:**

Everything is green 🎉
This commit is contained in:
bors 2017-04-24 22:18:16 +00:00
commit 0777c757a6
12 changed files with 57 additions and 29 deletions

View File

@ -20,39 +20,28 @@ environment:
# 32/64-bit MinGW builds.
#
# The MinGW builds unfortunately have to both download a custom toolchain and
# avoid the one installed by AppVeyor by default. Interestingly, though, for
# different reasons!
# We are using MinGW with posix threads since LLVM does not compile with
# the win32 threads version due to missing support for C++'s std::thread.
#
# For 32-bit the installed gcc toolchain on AppVeyor uses the pthread
# threading model. This is unfortunately not what we want, and if we compile
# with it then there's lots of link errors in the standard library (undefined
# references to pthread symbols).
#
# For 64-bit the installed gcc toolchain is currently 5.3.0 which
# unfortunately segfaults on Windows with --enable-llvm-assertions (segfaults
# in LLVM). See rust-lang/rust#28445 for more information, but to work around
# this we go back in time to 4.9.2 specifically.
# Instead of relying on the MinGW version installed on appveryor we download
# and install one ourselves so we won't be surprised by changes to appveyor's
# build image.
#
# Finally, note that the downloads below are all in the `rust-lang-ci` S3
# bucket, but they cleraly didn't originate there! The downloads originally
# came from the mingw-w64 SourceForge download site. Unfortunately
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
#
# And as a final point of note, the 32-bit MinGW build using the makefiles do
# *not* use debug assertions and llvm assertions. This is because they take
# too long on appveyor and this is tested by rustbuild below.
- MSYS_BITS: 32
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja
SCRIPT: python x.py test
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z
MINGW_DIR: mingw32
- MSYS_BITS: 64
SCRIPT: python x.py test
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-ninja
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z
MINGW_DIR: mingw64
# 32/64 bit MSVC and GNU deployment
@ -71,14 +60,14 @@ environment:
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended --enable-ninja
SCRIPT: python x.py dist
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z
MINGW_DIR: mingw32
DEPLOY: 1
- MSYS_BITS: 64
SCRIPT: python x.py dist
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended --enable-ninja
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z
MINGW_DIR: mingw64
DEPLOY: 1

View File

@ -882,6 +882,13 @@ impl Build {
if target.contains("apple-darwin") {
base.push("-stdlib=libc++".into());
}
// Work around an apparently bad MinGW / GCC optimization,
// See: http://lists.llvm.org/pipermail/cfe-dev/2016-December/051980.html
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78936
if target == "i686-pc-windows-gnu" {
base.push("-fno-omit-frame-pointer".into());
}
return base
}

View File

@ -27,10 +27,10 @@ WORKDIR /tmp
COPY build-emscripten.sh /tmp/
RUN ./build-emscripten.sh
ENV PATH=$PATH:/tmp/emsdk_portable
ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin
ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.10/build_tag-e1.37.10_32/bin
ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin
ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1
ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.10
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.10
ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten

View File

@ -49,5 +49,5 @@ chmod 755 emsdk_portable
source emsdk_portable/emsdk_env.sh
hide_output emsdk update
hide_output emsdk install --build=Release sdk-tag-1.37.1-32bit
hide_output emsdk activate --build=Release sdk-tag-1.37.1-32bit
hide_output emsdk install --build=Release sdk-tag-1.37.10-32bit
hide_output emsdk activate --build=Release sdk-tag-1.37.10-32bit

@ -1 +1 @@
Subproject commit d30da544a8afc5d78391dee270bdf40e74a215d3
Subproject commit c8a8767c56ad3d3f4eb45c87b95026936fb9aa35

View File

@ -293,6 +293,12 @@ fn main() {
}
if target.contains("arm") && !target.contains("ios") {
// (At least) udivsi3.S is broken for Thumb 1 which our gcc uses by
// default, we don't want Thumb 2 since it isn't supported on some
// devices, so disable thumb entirely.
// Upstream bug: https://bugs.llvm.org/show_bug.cgi?id=32492
cfg.define("__ARM_ARCH_ISA_THUMB", Some("0"));
sources.extend(&["arm/aeabi_cdcmp.S",
"arm/aeabi_cdcmpeq_check_nan.c",
"arm/aeabi_cfcmp.S",

View File

@ -268,4 +268,8 @@ fn main() {
if target.contains("windows") {
println!("cargo:rustc-link-lib=ole32");
}
if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=static-nobundle=gcc_s");
println!("cargo:rustc-link-lib=static-nobundle=pthread");
}
}

View File

@ -29,6 +29,7 @@
#![feature(link_args)]
#![feature(staged_api)]
#![feature(rustc_private)]
#![feature(static_nobundle)]
extern crate libc;
#[macro_use]

@ -1 +1 @@
Subproject commit 2e951c3ae354bcbd2e50b30798e232949a926b75
Subproject commit a884d21cc5f0b23a1693d1e872fd8998a4fdd17f

View File

@ -10,6 +10,8 @@
// write_volatile causes an LLVM assert with composite types
// ignore-emscripten See #41299: probably a bad optimization
#![feature(volatile)]
use std::ptr::{read_volatile, write_volatile};

View File

@ -27,7 +27,17 @@ fn main() {
exit_success_if_unwind::bar(do_panic);
}
}
let s = Command::new(env::args_os().next().unwrap()).arg("foo").status();
let mut cmd = Command::new(env::args_os().next().unwrap());
cmd.arg("foo");
// ARMv6 hanges while printing the backtrace, see #41004
if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") {
cmd.env("RUST_BACKTRACE", "0");
}
let s = cmd.status();
assert!(s.unwrap().code() != Some(0));
}

View File

@ -35,6 +35,15 @@ fn main() {
panic!("try to catch me");
}
}
let s = Command::new(env::args_os().next().unwrap()).arg("foo").status();
let mut cmd = Command::new(env::args_os().next().unwrap());
cmd.arg("foo");
// ARMv6 hanges while printing the backtrace, see #41004
if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") {
cmd.env("RUST_BACKTRACE", "0");
}
let s = cmd.status();
assert!(s.unwrap().code() != Some(0));
}