+
+ if compiler.stage != 0 && build.config.sanitizers {
+ // This variable is used by the sanitizer runtime crates, e.g.
+ // rustc_lsan, to build the sanitizer runtime from C code
+ // When this variable is missing, those crates won't compile the C code,
+ // so we don't set this variable during stage0 where llvm-config is
+ // missing
+ // We also only build the runtimes when --enable-sanitizers (or its
+ // config.toml equivalent) is used
+ cargo.env("LLVM_CONFIG", build.llvm_config(target));
+ }