Rollup merge of #64166 - infinity0:master, r=alexcrichton
Better way of conditioning the sanitizer builds Previously the build would take the presence of the LLVM_CONFIG envvar to mean that the sanitizers should be built, but this is a common envvar that could be set for reasons unrelated to the rustc sanitizers. This commit adds a new envvar RUSTC_BUILD_SANITIZERS and uses it instead. This PR or similar will be necessary in order to work correctly with https://github.com/rust-lang-nursery/compiler-builtins/pull/296
This commit is contained in:
commit
8bbd71b99a
5 changed files with 13 additions and 0 deletions
|
@ -212,6 +212,7 @@ pub fn std_cargo(builder: &Builder<'_>,
|
||||||
emscripten: false,
|
emscripten: false,
|
||||||
});
|
});
|
||||||
cargo.env("LLVM_CONFIG", llvm_config);
|
cargo.env("LLVM_CONFIG", llvm_config);
|
||||||
|
cargo.env("RUSTC_BUILD_SANITIZERS", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
cargo.arg("--features").arg(features)
|
cargo.arg("--features").arg(features)
|
||||||
|
|
|
@ -4,6 +4,9 @@ use build_helper::sanitizer_lib_boilerplate;
|
||||||
use cmake::Config;
|
use cmake::Config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
||||||
build_helper::restore_library_path();
|
build_helper::restore_library_path();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ use build_helper::sanitizer_lib_boilerplate;
|
||||||
use cmake::Config;
|
use cmake::Config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
||||||
build_helper::restore_library_path();
|
build_helper::restore_library_path();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ use build_helper::sanitizer_lib_boilerplate;
|
||||||
use cmake::Config;
|
use cmake::Config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
||||||
build_helper::restore_library_path();
|
build_helper::restore_library_path();
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,9 @@ use build_helper::sanitizer_lib_boilerplate;
|
||||||
use cmake::Config;
|
use cmake::Config;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
if env::var("RUSTC_BUILD_SANITIZERS") != Ok("1".to_string()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
if let Some(llvm_config) = env::var_os("LLVM_CONFIG") {
|
||||||
build_helper::restore_library_path();
|
build_helper::restore_library_path();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue