Skip to content

Commit 00d3310

Browse files
committed
Auto merge of #40123 - TimNN:llvm40, r=TimNN
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` * [ ] 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:** * Travis (full build) is green * Local Windows build was green * Appveyor Windows build segfaults while running `llvm-tablegen`, investigating.
2 parents 5997806 + 5a4475c commit 00d3310

File tree

12 files changed

+58
-29
lines changed

12 files changed

+58
-29
lines changed

appveyor.yml

+10-20
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,28 @@ environment:
2020

2121
# 32/64-bit MinGW builds.
2222
#
23-
# The MinGW builds unfortunately have to both download a custom toolchain and
24-
# avoid the one installed by AppVeyor by default. Interestingly, though, for
25-
# different reasons!
23+
# We are using MinGW with posix threads since LLVM does not compile with
24+
# the win32 threads version due to missing support for C++'s std::thread.
2625
#
27-
# For 32-bit the installed gcc toolchain on AppVeyor uses the pthread
28-
# threading model. This is unfortunately not what we want, and if we compile
29-
# with it then there's lots of link errors in the standard library (undefined
30-
# references to pthread symbols).
31-
#
32-
# For 64-bit the installed gcc toolchain is currently 5.3.0 which
33-
# unfortunately segfaults on Windows with --enable-llvm-assertions (segfaults
34-
# in LLVM). See rust-lang/rust#28445 for more information, but to work around
35-
# this we go back in time to 4.9.2 specifically.
26+
# Instead of relying on the MinGW version installed on appveryor we download
27+
# and install one ourselves so we won't be surprised by changes to appveyor's
28+
# build image.
3629
#
3730
# Finally, note that the downloads below are all in the `rust-lang-ci` S3
3831
# bucket, but they cleraly didn't originate there! The downloads originally
3932
# came from the mingw-w64 SourceForge download site. Unfortunately
4033
# SourceForge is notoriously flaky, so we mirror it on our own infrastructure.
41-
#
42-
# And as a final point of note, the 32-bit MinGW build using the makefiles do
43-
# *not* use debug assertions and llvm assertions. This is because they take
44-
# too long on appveyor and this is tested by rustbuild below.
4534
- MSYS_BITS: 32
4635
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-ninja
4736
SCRIPT: python x.py test
4837
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
49-
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
38+
MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z
5039
MINGW_DIR: mingw32
5140
- MSYS_BITS: 64
5241
SCRIPT: python x.py test
5342
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-ninja
5443
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
55-
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
44+
MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z
5645
MINGW_DIR: mingw64
5746

5847
# 32/64 bit MSVC and GNU deployment
@@ -71,14 +60,14 @@ environment:
7160
RUST_CONFIGURE_ARGS: --build=i686-pc-windows-gnu --enable-extended --enable-ninja
7261
SCRIPT: python x.py dist
7362
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
74-
MINGW_ARCHIVE: i686-6.2.0-release-win32-dwarf-rt_v5-rev1.7z
63+
MINGW_ARCHIVE: i686-6.2.0-release-posix-dwarf-rt_v5-rev1.7z
7564
MINGW_DIR: mingw32
7665
DEPLOY: 1
7766
- MSYS_BITS: 64
7867
SCRIPT: python x.py dist
7968
RUST_CONFIGURE_ARGS: --build=x86_64-pc-windows-gnu --enable-extended --enable-ninja
8069
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci/rust-ci-mirror
81-
MINGW_ARCHIVE: x86_64-6.2.0-release-win32-seh-rt_v5-rev1.7z
70+
MINGW_ARCHIVE: x86_64-6.2.0-release-posix-seh-rt_v5-rev1.7z
8271
MINGW_DIR: mingw64
8372
DEPLOY: 1
8473

@@ -146,6 +135,7 @@ test_script:
146135
- set SRC=.
147136
- set NO_CCACHE=1
148137
- sh src/ci/run.sh
138+
- exit 1
149139

150140
on_failure:
151141
- cat %CD%\sccache.log || exit 0

src/bootstrap/lib.rs

+7
Original file line numberDiff line numberDiff line change
@@ -877,6 +877,13 @@ impl Build {
877877
if target.contains("apple-darwin") {
878878
base.push("-stdlib=libc++".into());
879879
}
880+
881+
// Work around an apparently bad MinGW / GCC optimization,
882+
// See: http://lists.llvm.org/pipermail/cfe-dev/2016-December/051980.html
883+
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78936
884+
if target == "i686-pc-windows-gnu" {
885+
base.push("-fno-omit-frame-pointer".into());
886+
}
880887
return base
881888
}
882889

src/ci/docker/emscripten/Dockerfile

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ WORKDIR /tmp
2727
COPY build-emscripten.sh /tmp/
2828
RUN ./build-emscripten.sh
2929
ENV PATH=$PATH:/tmp/emsdk_portable
30-
ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.1/build_tag-e1.37.1_32/bin
30+
ENV PATH=$PATH:/tmp/emsdk_portable/clang/tag-e1.37.8/build_tag-e1.37.8_32/bin
3131
ENV PATH=$PATH:/tmp/emsdk_portable/node/4.1.1_32bit/bin
32-
ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.1
33-
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.1
32+
ENV PATH=$PATH:/tmp/emsdk_portable/emscripten/tag-1.37.8
33+
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/tag-1.37.8
3434

3535
ENV RUST_CONFIGURE_ARGS --target=asmjs-unknown-emscripten
3636

src/ci/docker/emscripten/build-emscripten.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ chmod 755 emsdk_portable
4949

5050
source emsdk_portable/emsdk_env.sh
5151
hide_output emsdk update
52-
hide_output emsdk install --build=Release sdk-tag-1.37.1-32bit
53-
hide_output emsdk activate --build=Release sdk-tag-1.37.1-32bit
52+
hide_output emsdk install --build=Release sdk-tag-1.37.8-32bit
53+
hide_output emsdk activate --build=Release sdk-tag-1.37.8-32bit

src/compiler-rt

Submodule compiler-rt updated 680 files

src/libcompiler_builtins/build.rs

+6
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,12 @@ fn main() {
293293
}
294294

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

src/librustc_llvm/build.rs

+4
Original file line numberDiff line numberDiff line change
@@ -268,4 +268,8 @@ fn main() {
268268
if target.contains("windows") {
269269
println!("cargo:rustc-link-lib=ole32");
270270
}
271+
if target.contains("windows-gnu") {
272+
println!("cargo:rustc-link-lib=static-nobundle=gcc_s");
273+
println!("cargo:rustc-link-lib=static-nobundle=pthread");
274+
}
271275
}

src/librustc_llvm/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#![feature(link_args)]
3030
#![feature(staged_api)]
3131
#![feature(rustc_private)]
32+
#![feature(static_nobundle)]
3233

3334
extern crate libc;
3435
#[macro_use]

src/llvm

Submodule llvm updated 8732 files

src/test/run-pass/issue-29663.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
// write_volatile causes an LLVM assert with composite types
1212

13+
// ignore-emscripten See #41299: probably a bad optimization
14+
1315
#![feature(volatile)]
1416
use std::ptr::{read_volatile, write_volatile};
1517

src/test/run-pass/panic-runtime/abort-link-to-unwinding-crates.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,17 @@ fn main() {
2727
exit_success_if_unwind::bar(do_panic);
2828
}
2929
}
30-
let s = Command::new(env::args_os().next().unwrap()).arg("foo").status();
30+
31+
let mut cmd = Command::new(env::args_os().next().unwrap());
32+
cmd.arg("foo");
33+
34+
35+
// ARMv6 hanges while printing the backtrace, see #41004
36+
if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") {
37+
cmd.env("RUST_BACKTRACE", "0");
38+
}
39+
40+
let s = cmd.status();
3141
assert!(s.unwrap().code() != Some(0));
3242
}
3343

src/test/run-pass/panic-runtime/abort.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,15 @@ fn main() {
3535
panic!("try to catch me");
3636
}
3737
}
38-
let s = Command::new(env::args_os().next().unwrap()).arg("foo").status();
38+
39+
let mut cmd = Command::new(env::args_os().next().unwrap());
40+
cmd.arg("foo");
41+
42+
// ARMv6 hanges while printing the backtrace, see #41004
43+
if cfg!(target_arch = "arm") && cfg!(target_env = "gnu") {
44+
cmd.env("RUST_BACKTRACE", "0");
45+
}
46+
47+
let s = cmd.status();
3948
assert!(s.unwrap().code() != Some(0));
4049
}

0 commit comments

Comments
 (0)