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.
This commit is contained in:
kennytm 2017-10-19 01:59:52 +08:00 committed by GitHub
commit c77068a94b
9 changed files with 20 additions and 19 deletions

View File

@ -12,7 +12,7 @@ matrix:
fast_finish: true
include:
# Images used in testing PR and try-build should be run first.
- env: IMAGE=x86_64-gnu-llvm-3.7 RUST_BACKTRACE=1
- env: IMAGE=x86_64-gnu-llvm-3.9 RUST_BACKTRACE=1
if: type = pull_request OR branch = auto
- env: IMAGE=dist-x86_64-linux DEPLOY=1

View File

@ -35,7 +35,7 @@
# If an external LLVM root is specified, we automatically check the version by
# default to make sure it's within the range that we're expecting, but setting
# this flag will indicate that this version check should not be done.
#version-check = false
#version-check = true
# Link libstdc++ statically into the librustc_llvm instead of relying on a
# dynamic version to be available.

View File

@ -299,6 +299,7 @@ impl Config {
let mut config = Config::default();
config.llvm_enabled = true;
config.llvm_optimize = true;
config.llvm_version_check = true;
config.use_jemalloc = true;
config.backtrace = true;
config.rust_optimize = true;

View File

@ -259,11 +259,14 @@ fn check_llvm_version(build: &Build, llvm_config: &Path) {
let mut cmd = Command::new(llvm_config);
let version = output(cmd.arg("--version"));
if version.starts_with("3.5") || version.starts_with("3.6") ||
version.starts_with("3.7") {
return
let mut parts = version.split('.').take(2)
.filter_map(|s| s.parse::<u32>().ok());
if let (Some(major), Some(minor)) = (parts.next(), parts.next()) {
if major > 3 || (major == 3 && minor >= 9) {
return
}
}
panic!("\n\nbad LLVM version: {}, need >=3.5\n\n", version)
panic!("\n\nbad LLVM version: {}, need >=3.9\n\n", version)
}
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]

View File

@ -11,7 +11,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
cmake \
sudo \
gdb \
llvm-3.7-tools \
llvm-3.9-tools \
libedit-dev \
zlib1g-dev \
xz-utils
@ -19,7 +19,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
# using llvm-link-shared due to libffi issues -- see #34486
ENV RUST_CONFIGURE_ARGS \
--build=x86_64-unknown-linux-gnu \
--llvm-root=/usr/lib/llvm-3.7
--llvm-root=/usr/lib/llvm-3.9 \
--enable-llvm-link-shared
ENV RUST_CHECK_TARGET check

View File

@ -14,7 +14,6 @@
// ignore-arm
// ignore-aarch64
// min-llvm-version 3.8
// compile-flags: -C no-prepopulate-passes

View File

@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// The minimum LLVM version is set to 3.8, but really this test
// depends on a patch that is was committed to upstream LLVM before
// 4.0; and also backported to the Rust LLVM fork.
// This test depends on a patch that was committed to upstream LLVM
// before 4.0, formerly backported to the Rust LLVM fork.
// ignore-tidy-linelength
// ignore-windows
// ignore-macos
// min-llvm-version 3.8
// min-llvm-version 4.0
// compile-flags: -g -C no-prepopulate-passes

View File

@ -8,14 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// The minimum LLVM version is set to 3.8, but really this test
// depends on a patch that is was committed to upstream LLVM before
// 4.0; and also backported to the Rust LLVM fork.
// This test depends on a patch that was committed to upstream LLVM
// before 4.0, formerly backported to the Rust LLVM fork.
// ignore-tidy-linelength
// ignore-windows
// ignore-macos
// min-llvm-version 3.8
// min-llvm-version 4.0
// compile-flags: -g -C no-prepopulate-passes

View File

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// min-llvm-version 3.9
use std::ops::Deref;
fn main() {