From 320640060f38957028141ea30bc4d5577d1e53b0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 27 Feb 2019 08:03:54 -0800 Subject: [PATCH] Whitelist containers that allow older toolchains We'll use this as a temporary measure to get an LLVM update landed, but we'll have to go through and update images later to make sure they've got the right toolchains. --- config.toml.example | 2 ++ src/bootstrap/config.rs | 3 +++ src/bootstrap/native.rs | 4 ++++ src/ci/docker/dist-x86_64-netbsd/Dockerfile | 3 ++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config.toml.example b/config.toml.example index f45db37c33b8..8f6bf03489f0 100644 --- a/config.toml.example +++ b/config.toml.example @@ -104,6 +104,8 @@ # The value specified here will be passed as `-DLLVM_USE_LINKER` to CMake. #use-linker = "lld" +# Whether or not to specify `-DLLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN=YES` +#allow-old-toolchain = false # ============================================================================= # General build configuration options diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 7d3e584f1a6f..d20958854ed6 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -78,6 +78,7 @@ pub struct Config { pub llvm_link_jobs: Option, pub llvm_version_suffix: Option, pub llvm_use_linker: Option, + pub llvm_allow_old_toolchain: Option, pub lld_enabled: bool, pub lldb_enabled: bool, @@ -263,6 +264,7 @@ struct Llvm { ldflags: Option, use_libcxx: Option, use_linker: Option, + allow_old_toolchain: Option, } #[derive(Deserialize, Default, Clone)] @@ -530,6 +532,7 @@ impl Config { config.llvm_ldflags = llvm.ldflags.clone(); set(&mut config.llvm_use_libcxx, llvm.use_libcxx); config.llvm_use_linker = llvm.use_linker.clone(); + config.llvm_allow_old_toolchain = llvm.allow_old_toolchain.clone(); } if let Some(ref rust) = toml.rust { diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 192b1cd1fbb7..d78670cfe515 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -238,6 +238,10 @@ impl Step for Llvm { cfg.define("LLVM_USE_LINKER", linker); } + if let Some(true) = builder.config.llvm_allow_old_toolchain { + cfg.define("LLVM_TEMPORARILY_ALLOW_OLD_TOOLCHAIN", "YES"); + } + if let Some(ref python) = builder.config.python { cfg.define("PYTHON_EXECUTABLE", python); } diff --git a/src/ci/docker/dist-x86_64-netbsd/Dockerfile b/src/ci/docker/dist-x86_64-netbsd/Dockerfile index a17a7ebc03dd..4fe7e2cca2b6 100644 --- a/src/ci/docker/dist-x86_64-netbsd/Dockerfile +++ b/src/ci/docker/dist-x86_64-netbsd/Dockerfile @@ -33,5 +33,6 @@ ENV \ ENV HOSTS=x86_64-unknown-netbsd -ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs +ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs \ + --set llvm.allow-old-toolchain ENV SCRIPT python2.7 ../x.py dist --host $HOSTS --target $HOSTS