Skip to content

Commit cef95b0

Browse files
committed
Auto merge of #47828 - alexcrichton:llvm-6, r=<try>
rustc: Upgrade to LLVM 6 The following submodules have been updated for a new version of LLVM: - `src/llvm` - `src/libcompiler_builtins` - transitively contains compiler-rt - `src/dlmalloc` This also updates the docker container for dist-i686-freebsd as the old 16.04 container is no longer capable of building LLVM. The compiler-rt/compiler-builtins and dlmalloc updates are pretty routine without much interesting happening, but the LLVM update here is of particular note. Unlike previous updates I haven't cherry-picked all existing patches we had on top of our LLVM branch as we have a [huge amount][patches4] and have at this point forgotten what most of them are for. Instead I started from the current `release_60` branch in LLVM and only applied patches that were necessary to get our tests working and building. The [current set of custom rustc-specific patches](rust-lang/llvm@f128612...rust-llvm-release-6-0-0) included in this LLVM update are: * rust-lang/llvm@1187443 - this is how we actually implement `cfg(target_feature)` for now and continues to not be upstreamed. While a hazard for SIMD stabilization this commit is otherwise keeping the status quo of a small rustc-specific feature. * rust-lang/llvm@013f2ec - this is a rustc-specific optimization that we haven't upstreamed, notably teaching LLVM about our allocation-related routines (which aren't malloc/free). Once we stabilize the global allocator routines we will likely want to upstream this patch, but for now it seems reasonable to keep it on our fork. * rust-lang/llvm@a65bbfd - I found this necessary to fix compilation of LLVM in our 32-bit linux container. I'm not really sure why it's necessary but my guess is that it's because of the absolutely ancient glibc that we're using. In any case it's only updating pieces we're not actually using in LLVM so I'm hoping it'll turn out alright. This doesn't seem like something we'll want to upstream.c * rust-lang/llvm@77ab1f0 - this is what's actually enabling LLVM to build in our i686-freebsd container, I'm not really sure what's going on but we for sure probably don't want to upstream this and otherwise it seems not too bad for now at least. * rust-lang/llvm@9eb9267 - we currently suffer on MSVC from an [upstream bug] which although diagnosed to a particular revision isn't currently fixed upstream (and the bug itself doesn't seem too active). This commit is a partial revert of the suspected cause of this regression (found via a bisection). I'm sort of hoping that this eventually gets fixed upstream with a similar fix (which we can replace in our branch), but for now I'm also hoping it's a relatively harmless change to have. After applying these patches (plus one [backport] which should be [backported upstream][llvm-back]) I believe we should have all tests working on all platforms in our current test suite. I'm like 99% sure that we'll need some more backports as issues are reported for LLVM 6 when this propagates through nightlies, but that's sort of just par for the course nowadays! In any case though some extra scrutiny of the patches here would definitely be welcome, along with scrutiny of the "missing patches" like a [change to pass manager order](rust-lang/llvm@2717444), [another change to pass manager order](rust-lang/llvm@c782feb), some [compile fixes for sparc](rust-lang/llvm@1a83de6), and some [fixes for solaris](rust-lang/llvm@c2bfe0a). [patches4]: rust-lang/llvm@5401fdf...rust-llvm-release-4-0-1 [backport]: rust-lang/llvm@5c54c25 [llvm-back]: https://bugs.llvm.org/show_bug.cgi?id=36114 [upstream bug]: https://bugs.llvm.org/show_bug.cgi?id=36096 --- The update to LLVM 6 is desirable for a number of reasons, notably: * This'll allow us to keep up with the upstream wasm backend, picking up new features as they start landing. * Upstream LLVM has fixed a number of SIMD-related compilation errors, especially around AVX-512 and such. * There's a few assorted known bugs which are fixed in LLVM 5 and aren't fixed in the LLVM 4 branch we're using. * Overall it's not a great idea to stagnate with our codegen backend! This update is mostly powered by #47730 which is allowing us to update LLVM *independent* of the version of LLVM that Emscripten is locked to. This means that when compiling code for Emscripten we'll still be using the old LLVM 4 backend, but when compiling code for any other target we'll be using the new LLVM 6 target. Once Emscripten updates we may no longer need this distinction, but we're not sure when that will happen! Closes #43370 Closes #43418 Closes #47015 Closes #47683 Closes rust-lang/stdarch#157 Closes rust-lang-nursery/rust-wasm#3
2 parents 3bcda48 + cea6733 commit cef95b0

File tree

11 files changed

+81
-57
lines changed

11 files changed

+81
-57
lines changed

.travis.yml

+43-43
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ matrix:
1313
include:
1414
# Images used in testing PR and try-build should be run first.
1515
- env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
16-
if: type = pull_request OR branch = auto
16+
if: type = pull_request OR branch = try
1717

1818
- env: IMAGE=dist-x86_64-linux DEPLOY=1
19-
if: branch = try OR branch = auto
19+
if: branch = try OR branch = try
2020

2121
# "alternate" deployments, these are "nightlies" but have LLVM assertions
2222
# turned on, they're deployed to a different location primarily for
2323
# additional testing.
2424
- env: IMAGE=dist-x86_64-linux DEPLOY_ALT=1
25-
if: branch = try OR branch = auto
25+
if: branch = try OR branch = try
2626

2727
- env: >
2828
RUST_CHECK_TARGET=dist
@@ -36,7 +36,7 @@ matrix:
3636
NO_DEBUG_ASSERTIONS=1
3737
os: osx
3838
osx_image: xcode7.3
39-
if: branch = auto
39+
if: branch = try
4040
4141
# macOS builders. These are placed near the beginning because they are very
4242
# slow to run.
@@ -57,7 +57,7 @@ matrix:
5757
NO_DEBUG_ASSERTIONS=1
5858
os: osx
5959
osx_image: xcode8.3
60-
if: branch = auto
60+
if: branch = try
6161
6262
- env: >
6363
RUST_CHECK_TARGET=check
@@ -71,7 +71,7 @@ matrix:
7171
NO_DEBUG_ASSERTIONS=1
7272
os: osx
7373
osx_image: xcode8.3
74-
if: branch = auto
74+
if: branch = try
7575
7676
# OSX builders producing releases. These do not run the full test suite and
7777
# just produce a bunch of artifacts.
@@ -91,7 +91,7 @@ matrix:
9191
NO_DEBUG_ASSERTIONS=1
9292
os: osx
9393
osx_image: xcode7.3
94-
if: branch = auto
94+
if: branch = try
9595
9696
- env: >
9797
RUST_CHECK_TARGET=dist
@@ -105,79 +105,79 @@ matrix:
105105
NO_DEBUG_ASSERTIONS=1
106106
os: osx
107107
osx_image: xcode7.3
108-
if: branch = auto
108+
if: branch = try
109109
110110
# Linux builders, remaining docker images
111111
- env: IMAGE=arm-android
112-
if: branch = auto
112+
if: branch = try
113113
- env: IMAGE=armhf-gnu
114-
if: branch = auto
114+
if: branch = try
115115
- env: IMAGE=dist-various-1 DEPLOY=1
116-
if: branch = auto
116+
if: branch = try
117117
- env: IMAGE=dist-various-2 DEPLOY=1
118-
if: branch = auto
118+
if: branch = try
119119
- env: IMAGE=dist-aarch64-linux DEPLOY=1
120-
if: branch = auto
120+
if: branch = try
121121
- env: IMAGE=dist-android DEPLOY=1
122-
if: branch = auto
122+
if: branch = try
123123
- env: IMAGE=dist-arm-linux DEPLOY=1
124-
if: branch = auto
124+
if: branch = try
125125
- env: IMAGE=dist-armhf-linux DEPLOY=1
126-
if: branch = auto
126+
if: branch = try
127127
- env: IMAGE=dist-armv7-linux DEPLOY=1
128-
if: branch = auto
128+
if: branch = try
129129
- env: IMAGE=dist-i586-gnu-i586-i686-musl DEPLOY=1
130-
if: branch = auto
130+
if: branch = try
131131
- env: IMAGE=dist-i686-freebsd DEPLOY=1
132-
if: branch = auto
132+
if: branch = try
133133
- env: IMAGE=dist-i686-linux DEPLOY=1
134-
if: branch = auto
134+
if: branch = try
135135
- env: IMAGE=dist-mips-linux DEPLOY=1
136-
if: branch = auto
136+
if: branch = try
137137
- env: IMAGE=dist-mips64-linux DEPLOY=1
138-
if: branch = auto
138+
if: branch = try
139139
- env: IMAGE=dist-mips64el-linux DEPLOY=1
140-
if: branch = auto
140+
if: branch = try
141141
- env: IMAGE=dist-mipsel-linux DEPLOY=1
142-
if: branch = auto
142+
if: branch = try
143143
- env: IMAGE=dist-powerpc-linux DEPLOY=1
144-
if: branch = auto
144+
if: branch = try
145145
- env: IMAGE=dist-powerpc64-linux DEPLOY=1
146-
if: branch = auto
146+
if: branch = try
147147
- env: IMAGE=dist-powerpc64le-linux DEPLOY=1
148-
if: branch = auto
148+
if: branch = try
149149
- env: IMAGE=dist-s390x-linux DEPLOY=1
150-
if: branch = auto
150+
if: branch = try
151151
- env: IMAGE=dist-x86_64-freebsd DEPLOY=1
152-
if: branch = auto
152+
if: branch = try
153153
- env: IMAGE=dist-x86_64-musl DEPLOY=1
154-
if: branch = auto
154+
if: branch = try
155155
- env: IMAGE=dist-x86_64-netbsd DEPLOY=1
156-
if: branch = auto
156+
if: branch = try
157157
- env: IMAGE=asmjs
158-
if: branch = auto
158+
if: branch = try
159159
- env: IMAGE=i686-gnu
160-
if: branch = auto
160+
if: branch = try
161161
- env: IMAGE=i686-gnu-nopt
162-
if: branch = auto
162+
if: branch = try
163163
- env: IMAGE=wasm32-unknown
164-
if: branch = auto
164+
if: branch = try
165165
- env: IMAGE=x86_64-gnu
166-
if: branch = auto
166+
if: branch = try
167167
- env: IMAGE=x86_64-gnu-full-bootstrap
168-
if: branch = auto
168+
if: branch = try
169169
- env: IMAGE=x86_64-gnu-aux
170-
if: branch = auto
170+
if: branch = try
171171
- env: IMAGE=x86_64-gnu-tools
172-
if: branch = auto
172+
if: branch = try
173173
- env: IMAGE=x86_64-gnu-debug
174-
if: branch = auto
174+
if: branch = try
175175
- env: IMAGE=x86_64-gnu-nopt
176-
if: branch = auto
176+
if: branch = try
177177
- env: IMAGE=x86_64-gnu-distcheck
178-
if: branch = auto
178+
if: branch = try
179179
- env: IMAGE=x86_64-gnu-incremental
180-
if: branch = auto
180+
if: branch = try
181181

182182
- stage: publish toolstate
183183
if: branch = master AND type = push

appveyor.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ on_failure:
181181

182182
branches:
183183
only:
184-
- auto
184+
- try
185185

186186
before_deploy:
187187
- ps: |

src/bootstrap/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl Step for Llvm {
186186
}
187187

188188
// http://llvm.org/docs/HowToCrossCompileLLVM.html
189-
if target != build.build {
189+
if target != build.build && !emscripten {
190190
builder.ensure(Llvm {
191191
target: build.build,
192192
emscripten: false,

src/ci/docker/dist-i686-freebsd/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:16.04
1+
FROM ubuntu:18.04
22

33
RUN apt-get update && apt-get install -y --no-install-recommends \
44
clang \

src/ci/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fi
2323
ci_dir=`cd $(dirname $0) && pwd`
2424
source "$ci_dir/shared.sh"
2525

26-
if [ "$TRAVIS" == "true" ] && [ "$TRAVIS_BRANCH" != "auto" ]; then
26+
if [ "$TRAVIS" == "true" ] && [ "$TRAVIS_BRANCH" != "try" ]; then
2727
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-quiet-tests"
2828
fi
2929

src/dlmalloc

src/llvm

Submodule llvm updated 14843 files

src/rustllvm/RustWrapper.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -552,9 +552,11 @@ static unsigned fromRust(LLVMRustDIFlags Flags) {
552552
if (isSet(Flags & LLVMRustDIFlags::FlagRValueReference)) {
553553
Result |= DINode::DIFlags::FlagRValueReference;
554554
}
555+
#if LLVM_VERSION_LE(4, 0)
555556
if (isSet(Flags & LLVMRustDIFlags::FlagExternalTypeRef)) {
556557
Result |= DINode::DIFlags::FlagExternalTypeRef;
557558
}
559+
#endif
558560
if (isSet(Flags & LLVMRustDIFlags::FlagIntroducedVirtual)) {
559561
Result |= DINode::DIFlags::FlagIntroducedVirtual;
560562
}

src/rustllvm/llvm-rebuild-trigger

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# If this file is modified, then llvm will be (optionally) cleaned and then rebuilt.
22
# The actual contents of this file do not matter, but to trigger a change on the
33
# build bots then the contents should be changed so git updates the mtime.
4-
2018-01-25
4+
2018-02-09

src/test/run-pass/backtrace-debuginfo.rs

+28-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
// Unfortunately, LLVM has no "disable" option for this, so we have to set
1616
// "enable" to 0 instead.
1717

18-
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0
18+
// compile-flags:-g -Cllvm-args=-enable-tail-merge=0 -Cllvm-args=-opt-bisect-limit=0
1919
// ignore-pretty issue #37195
2020
// ignore-cloudabi spawning processes is not supported
2121
// ignore-emscripten spawning processes is not supported
2222

23+
// note that above `-opt-bisect-limit=0` is used to basically disable
24+
// optimizations
25+
2326
use std::env;
2427

2528
#[path = "backtrace-debuginfo-aux.rs"] mod aux;
@@ -114,25 +117,34 @@ fn outer(mut counter: i32, main_pos: Pos) {
114117
inner_inlined(&mut counter, main_pos, pos!());
115118
}
116119

117-
fn check_trace(output: &str, error: &str) {
120+
fn check_trace(output: &str, error: &str) -> Result<(), String> {
118121
// reverse the position list so we can start with the last item (which was the first line)
119122
let mut remaining: Vec<&str> = output.lines().map(|s| s.trim()).rev().collect();
120123

121-
assert!(error.contains("stack backtrace"), "no backtrace in the error: {}", error);
124+
if !error.contains("stack backtrace") {
125+
return Err(format!("no backtrace found in stderr:\n{}", error))
126+
}
122127
for line in error.lines() {
123128
if !remaining.is_empty() && line.contains(remaining.last().unwrap()) {
124129
remaining.pop();
125130
}
126131
}
127-
assert!(remaining.is_empty(),
128-
"trace does not match position list: {}\n---\n{}", error, output);
132+
if !remaining.is_empty() {
133+
return Err(format!("trace does not match position list\n\
134+
still need to find {:?}\n\n\
135+
--- stdout\n{}\n\
136+
--- stderr\n{}",
137+
remaining, output, error))
138+
}
139+
Ok(())
129140
}
130141

131142
fn run_test(me: &str) {
132143
use std::str;
133144
use std::process::Command;
134145

135146
let mut i = 0;
147+
let mut errors = Vec::new();
136148
loop {
137149
let out = Command::new(me)
138150
.env("RUST_BACKTRACE", "full")
@@ -143,10 +155,20 @@ fn run_test(me: &str) {
143155
assert!(output.contains("done."), "bad output for successful run: {}", output);
144156
break;
145157
} else {
146-
check_trace(output, error);
158+
if let Err(e) = check_trace(output, error) {
159+
errors.push(e);
160+
}
147161
}
148162
i += 1;
149163
}
164+
if errors.len() > 0 {
165+
for error in errors {
166+
println!("---------------------------------------");
167+
println!("{}", error);
168+
}
169+
170+
panic!("found some errors");
171+
}
150172
}
151173

152174
#[inline(never)]

0 commit comments

Comments
 (0)