Skip to content

Commit 1781be5

Browse files
committed
Auto merge of #40123 - TimNN:llvm40, r=<try>
[WIP] LLVM 4.0 Upgrade Since nobody has done this yet, I decided to get things started: **Todo:** * [ ] push the relevant commits to `rust-lang/llvm` and `rust-lang/compiler-rt` * [ ] 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:** * `FAIL`: `IMAGE=armhf-gnu` [travis](https://travis-ci.org/rust-lang/rust/jobs/205860539) (looks to be qemu related, or rather the client / server tools) * `FAIL`: `IMAGE=emscripten` [travis](https://travis-ci.org/rust-lang/rust/jobs/205978867) (with an updated emcc: one bad emcc optimization: emscripten-core/emscripten-fastcomp#176) ~~[travis](https://travis-ci.org/rust-lang/rust/jobs/205860559) (mainly (only?) due to emcc / rust llvm version mismatch)~~ * `FAIL`: `IMAGE=dist-powerpc64-linux` [travis](https://travis-ci.org/rust-lang/rust/jobs/206514546) (llvm unreachable when compiling core: `Invalid PPC CTR loop! UNREACHABLE executed at .../PPCCTRLoops.cpp:722!`, reported as [upstream bug #32485](https://bugs.llvm.org//show_bug.cgi?id=32485)) * `SUCCESS/TIMEOUT`: `IMAGE=dist-arm-linux` [travis](https://travis-ci.org/rust-lang/rust/jobs/206514540) (passes locally) * `SUCCESS/TIMEOUT`: `IMAGE=dist-armv7-aarch64-linux` [travis](https://travis-ci.org/rust-lang/rust/jobs/206514541) (passes locally) * `SUCCESS`: `IMAGE=arm-android` (fixed) * `SUCCESS`: `IMAGE=cross` * `SUCCESS`: `IMAGE=linux-tested-targets` * `SUCCESS`: `IMAGE=dist-android` * `SUCCESS`: `IMAGE=dist-freebsd` (fixed) * `SUCCESS`: `IMAGE=dist-fuchsia` * `SUCCESS`: `IMAGE=dist-mips-linux` * `SUCCESS`: `IMAGE=dist-mips64-linux` * `SUCCESS`: `IMAGE=dist-powerpc-linux` * `SUCCESS`: `IMAGE=dist-s390x-linux-netbsd` (fixed) * `SUCCESS`: `IMAGE=dist-x86-linux` (fixed) * `SUCCESS`: `IMAGE=i686-gnu` * `SUCCESS`: `IMAGE=i686-gnu-nopt` * `SUCCESS`: `IMAGE=x86_64-gnu-llvm-3.7` * `SUCCESS`: `IMAGE=x86_64-gnu` * `SUCCESS`: `IMAGE=x86_64-gnu-aux` * `SUCCESS`: `IMAGE=x86_64-gnu-debug` * `SUCCESS`: `IMAGE=x86_64-gnu-nopt` * `SUCCESS`: `IMAGE=x86_64-gnu-full-bootstrap` * `SUCCESS`: `IMAGE=x86_64-gnu-distcheck` * `SUCCESS`: `IMAGE=x86_64-gnu-incremental`
2 parents a610117 + 17e01d3 commit 1781be5

File tree

12 files changed

+85
-17
lines changed

12 files changed

+85
-17
lines changed

.gitmodules

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[submodule "src/llvm"]
22
path = src/llvm
3-
url = https://github.com/rust-lang/llvm.git
3+
url = https://github.com/TimNN/llvm.git
44
branch = master
55
[submodule "src/compiler-rt"]
66
path = src/compiler-rt
7-
url = https://github.com/rust-lang/compiler-rt.git
7+
url = https://github.com/llvm-mirror/compiler-rt.git
88
[submodule "src/jemalloc"]
99
path = src/jemalloc
1010
url = https://github.com/rust-lang/jemalloc.git

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/fastcomp/build_incoming_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/incoming
33+
ENV EMSCRIPTEN=/tmp/emsdk_portable/emscripten/incoming
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 --enable-assertions sdk-incoming-32bit
53+
hide_output emsdk activate --build=Release sdk-incoming-32bit

src/ci/docker/run.sh

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,17 @@ docker_dir="`dirname $script`"
1818
ci_dir="`dirname $docker_dir`"
1919
src_dir="`dirname $ci_dir`"
2020
root_dir="`dirname $src_dir`"
21+
tag=rust-ci-$image
2122

2223
source "$ci_dir/shared.sh"
2324

24-
retry docker \
25+
docker \
2526
build \
2627
--rm \
27-
-t rust-ci \
28+
-t $tag \
2829
"`dirname "$script"`/$image"
2930

30-
objdir=$root_dir/obj
31+
objdir=$root_dir/obj/$image
3132

3233
mkdir -p $HOME/.cargo
3334
mkdir -p $objdir/tmp
@@ -60,5 +61,5 @@ exec docker \
6061
--volume "$HOME/rustsrc:$HOME/rustsrc" \
6162
--privileged \
6263
--rm \
63-
rust-ci \
64+
$tag \
6465
/checkout/src/ci/run.sh

src/ci/run.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@
99
# option. This file may not be copied, modified, or distributed
1010
# except according to those terms.
1111

12-
set -e
12+
set -eE
13+
14+
function err(){
15+
sleep infinity
16+
}
17+
18+
trap "err" ERR
1319

1420
if [ "$NO_CHANGE_USER" = "" ]; then
1521
if [ "$LOCAL_USER_ID" != "" ]; then

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/llvm

Submodule llvm updated 8731 files

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
}

src/tools/qemu-test-client/src/main.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ fn main() {
5151
}
5252

5353
fn spawn_emulator(rootfs: &Path, tmpdir: &Path) {
54+
use std::os::unix::io::{FromRawFd, IntoRawFd};
55+
use std::fs::OpenOptions;
56+
5457
// Generate a new rootfs image now that we've updated the test server
5558
// executable. This is the equivalent of:
5659
//
@@ -71,6 +74,10 @@ fn spawn_emulator(rootfs: &Path, tmpdir: &Path) {
7174
&mut t!(File::create(&rootfs_img))));
7275
assert!(t!(child.wait()).success());
7376

77+
let log = OpenOptions::new().create(true).append(true).open("qemu.log").unwrap();
78+
let qout = unsafe { Stdio::from_raw_fd(log.try_clone().unwrap().into_raw_fd()) };
79+
let qerr = unsafe { Stdio::from_raw_fd(log.try_clone().unwrap().into_raw_fd()) };
80+
7481
// Start up the emulator, in the background
7582
let mut cmd = Command::new("qemu-system-arm");
7683
cmd.arg("-M").arg("vexpress-a15")
@@ -80,7 +87,8 @@ fn spawn_emulator(rootfs: &Path, tmpdir: &Path) {
8087
.arg("-dtb").arg("/tmp/vexpress-v2p-ca15-tc1.dtb")
8188
.arg("-append").arg("console=ttyAMA0 root=/dev/ram rdinit=/sbin/init init=/sbin/init")
8289
.arg("-nographic")
83-
.arg("-redir").arg("tcp:12345::12345");
90+
.arg("-redir").arg("tcp:12345::12345")
91+
.stdout(qout).stderr(qerr);
8492
t!(cmd.spawn());
8593

8694
// Wait for the emulator to come online

src/tools/qemu-test-server/src/main.rs

+28
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#![feature(libc)]
12+
13+
extern crate libc;
14+
1115
/// This is a small server which is intended to run inside of an emulator. This
1216
/// server pairs with the `qemu-test-client` program in this repository. The
1317
/// `qemu-test-client` connects to this server over a TCP socket and performs
@@ -41,7 +45,31 @@ macro_rules! t {
4145

4246
static TEST: AtomicUsize = ATOMIC_USIZE_INIT;
4347

48+
fn debug() {
49+
::std::env::set_var("RUST_BACKTRACE", "1");
50+
51+
unsafe {
52+
let pid = libc::fork();
53+
if pid == 0 {
54+
println!("@@ Child is running.");
55+
return; // we are the child
56+
}
57+
assert!(pid > 0);
58+
59+
println!("@@ Watcher is running.");
60+
61+
let mut status: libc::c_int = 0;
62+
libc::waitpid(pid, &mut status, 0);
63+
64+
println!("@@EXIT@@: {}", status);
65+
66+
::std::process::exit(0);
67+
}
68+
}
69+
4470
fn main() {
71+
debug();
72+
4573
println!("starting test server");
4674
let listener = t!(TcpListener::bind("10.0.2.15:12345"));
4775
println!("listening!");

0 commit comments

Comments
 (0)