Skip to content

Commit c77068a

Browse files
authored
Rollup merge of #45326 - cuviper:min-llvm-3.9, r=alexcrichton
Bump the minimum LLVM to 3.9 Old LLVM bugs are reportedly cropping up harder, but 3.9 seems to be OK. Fixes #45277.
2 parents 0d4dbba + 6309a47 commit c77068a

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ matrix:
1212
fast_finish: true
1313
include:
1414
# Images used in testing PR and try-build should be run first.
15-
- env: IMAGE=x86_64-gnu-llvm-3.7 RUST_BACKTRACE=1
15+
- env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
1616
if: type = pull_request OR branch = auto
1717

1818
- env: IMAGE=dist-x86_64-linux DEPLOY=1

config.toml.example

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# If an external LLVM root is specified, we automatically check the version by
3636
# default to make sure it's within the range that we're expecting, but setting
3737
# this flag will indicate that this version check should not be done.
38-
#version-check = false
38+
#version-check = true
3939

4040
# Link libstdc++ statically into the librustc_llvm instead of relying on a
4141
# dynamic version to be available.

src/bootstrap/config.rs

+1
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ impl Config {
299299
let mut config = Config::default();
300300
config.llvm_enabled = true;
301301
config.llvm_optimize = true;
302+
config.llvm_version_check = true;
302303
config.use_jemalloc = true;
303304
config.backtrace = true;
304305
config.rust_optimize = true;

src/bootstrap/native.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,14 @@ fn check_llvm_version(build: &Build, llvm_config: &Path) {
259259

260260
let mut cmd = Command::new(llvm_config);
261261
let version = output(cmd.arg("--version"));
262-
if version.starts_with("3.5") || version.starts_with("3.6") ||
263-
version.starts_with("3.7") {
264-
return
262+
let mut parts = version.split('.').take(2)
263+
.filter_map(|s| s.parse::<u32>().ok());
264+
if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
265+
if major > 3 || (major == 3 && minor >= 9) {
266+
return
267+
}
265268
}
266-
panic!("\n\nbad LLVM version: {}, need >=3.5\n\n", version)
269+
panic!("\n\nbad LLVM version: {}, need >=3.9\n\n", version)
267270
}
268271

269272
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

src/ci/docker/x86_64-gnu-llvm-3.7/Dockerfile renamed to src/ci/docker/x86_64-gnu-llvm-3.9/Dockerfile

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1111
cmake \
1212
sudo \
1313
gdb \
14-
llvm-3.7-tools \
14+
llvm-3.9-tools \
1515
libedit-dev \
1616
zlib1g-dev \
1717
xz-utils
1818

1919
COPY scripts/sccache.sh /scripts/
2020
RUN sh /scripts/sccache.sh
2121

22+
# using llvm-link-shared due to libffi issues -- see #34486
2223
ENV RUST_CONFIGURE_ARGS \
2324
--build=x86_64-unknown-linux-gnu \
24-
--llvm-root=/usr/lib/llvm-3.7
25+
--llvm-root=/usr/lib/llvm-3.9 \
26+
--enable-llvm-link-shared
2527
ENV RUST_CHECK_TARGET check

src/test/codegen/abi-x86-interrupt.rs

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
// ignore-arm
1616
// ignore-aarch64
17-
// min-llvm-version 3.8
1817

1918
// compile-flags: -C no-prepopulate-passes
2019

src/test/codegen/mainsubprogram.rs

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

11-
// The minimum LLVM version is set to 3.8, but really this test
12-
// depends on a patch that is was committed to upstream LLVM before
13-
// 4.0; and also backported to the Rust LLVM fork.
11+
// This test depends on a patch that was committed to upstream LLVM
12+
// before 4.0, formerly backported to the Rust LLVM fork.
1413

1514
// ignore-tidy-linelength
1615
// ignore-windows
1716
// ignore-macos
18-
// min-llvm-version 3.8
17+
// min-llvm-version 4.0
1918

2019
// compile-flags: -g -C no-prepopulate-passes
2120

src/test/codegen/mainsubprogramstart.rs

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

11-
// The minimum LLVM version is set to 3.8, but really this test
12-
// depends on a patch that is was committed to upstream LLVM before
13-
// 4.0; and also backported to the Rust LLVM fork.
11+
// This test depends on a patch that was committed to upstream LLVM
12+
// before 4.0, formerly backported to the Rust LLVM fork.
1413

1514
// ignore-tidy-linelength
1615
// ignore-windows
1716
// ignore-macos
18-
// min-llvm-version 3.8
17+
// min-llvm-version 4.0
1918

2019
// compile-flags: -g -C no-prepopulate-passes
2120

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

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

11-
// min-llvm-version 3.9
12-
1311
use std::ops::Deref;
1412

1513
fn main() {

0 commit comments

Comments
 (0)