Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump the minimum LLVM to 3.9 #45326

Merged
merged 4 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 7 additions & 4 deletions src/bootstrap/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ 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

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
1 change: 0 additions & 1 deletion src/test/codegen/abi-x86-interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

// ignore-arm
// ignore-aarch64
// min-llvm-version 3.8

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

Expand Down
7 changes: 3 additions & 4 deletions src/test/codegen/mainsubprogram.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 3 additions & 4 deletions src/test/codegen/mainsubprogramstart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions src/test/run-pass/issue-36023.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down