Skip to content

Commit 78e7eee

Browse files
committed
Remove sanitizer runtime crates
1 parent adc6572 commit 78e7eee

File tree

16 files changed

+0
-404
lines changed

16 files changed

+0
-404
lines changed

Cargo.lock

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3348,17 +3348,6 @@ dependencies = [
33483348
"smallvec 1.0.0",
33493349
]
33503350

3351-
[[package]]
3352-
name = "rustc_asan"
3353-
version = "0.0.0"
3354-
dependencies = [
3355-
"alloc",
3356-
"build_helper",
3357-
"cmake",
3358-
"compiler_builtins",
3359-
"core",
3360-
]
3361-
33623351
[[package]]
33633352
name = "rustc_ast_lowering"
33643353
version = "0.0.0"
@@ -3680,17 +3669,6 @@ dependencies = [
36803669
"libc",
36813670
]
36823671

3683-
[[package]]
3684-
name = "rustc_lsan"
3685-
version = "0.0.0"
3686-
dependencies = [
3687-
"alloc",
3688-
"build_helper",
3689-
"cmake",
3690-
"compiler_builtins",
3691-
"core",
3692-
]
3693-
36943672
[[package]]
36953673
name = "rustc_macros"
36963674
version = "0.1.0"
@@ -3752,17 +3730,6 @@ dependencies = [
37523730
"syntax",
37533731
]
37543732

3755-
[[package]]
3756-
name = "rustc_msan"
3757-
version = "0.0.0"
3758-
dependencies = [
3759-
"alloc",
3760-
"build_helper",
3761-
"cmake",
3762-
"compiler_builtins",
3763-
"core",
3764-
]
3765-
37663733
[[package]]
37673734
name = "rustc_parse"
37683735
version = "0.0.0"
@@ -3935,17 +3902,6 @@ dependencies = [
39353902
"syntax",
39363903
]
39373904

3938-
[[package]]
3939-
name = "rustc_tsan"
3940-
version = "0.0.0"
3941-
dependencies = [
3942-
"alloc",
3943-
"build_helper",
3944-
"cmake",
3945-
"compiler_builtins",
3946-
"core",
3947-
]
3948-
39493905
[[package]]
39503906
name = "rustc_typeck"
39513907
version = "0.0.0"
@@ -4307,10 +4263,6 @@ dependencies = [
43074263
"panic_unwind",
43084264
"profiler_builtins",
43094265
"rand 0.7.0",
4310-
"rustc_asan",
4311-
"rustc_lsan",
4312-
"rustc_msan",
4313-
"rustc_tsan",
43144266
"unwind",
43154267
"wasi 0.9.0+wasi-snapshot-preview1",
43164268
]

src/bootstrap/dist.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,6 @@ impl Step for Src {
984984
"src/libcore",
985985
"src/libpanic_abort",
986986
"src/libpanic_unwind",
987-
"src/librustc_asan",
988-
"src/librustc_lsan",
989-
"src/librustc_msan",
990-
"src/librustc_tsan",
991987
"src/libstd",
992988
"src/libunwind",
993989
"src/libtest",

src/build_helper/lib.rs

Lines changed: 0 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use std::fs::File;
21
use std::path::{Path, PathBuf};
32
use std::process::{Command, Stdio};
4-
use std::thread;
53
use std::time::{SystemTime, UNIX_EPOCH};
64
use std::{env, fs};
75

@@ -181,108 +179,6 @@ pub fn up_to_date(src: &Path, dst: &Path) -> bool {
181179
}
182180
}
183181

184-
#[must_use]
185-
pub struct NativeLibBoilerplate {
186-
pub src_dir: PathBuf,
187-
pub out_dir: PathBuf,
188-
}
189-
190-
impl NativeLibBoilerplate {
191-
/// On macOS we don't want to ship the exact filename that compiler-rt builds.
192-
/// This conflicts with the system and ours is likely a wildly different
193-
/// version, so they can't be substituted.
194-
///
195-
/// As a result, we rename it here but we need to also use
196-
/// `install_name_tool` on macOS to rename the commands listed inside of it to
197-
/// ensure it's linked against correctly.
198-
pub fn fixup_sanitizer_lib_name(&self, sanitizer_name: &str) {
199-
if env::var("TARGET").unwrap() != "x86_64-apple-darwin" {
200-
return;
201-
}
202-
203-
let dir = self.out_dir.join("build/lib/darwin");
204-
let name = format!("clang_rt.{}_osx_dynamic", sanitizer_name);
205-
let src = dir.join(&format!("lib{}.dylib", name));
206-
let new_name = format!("lib__rustc__{}.dylib", name);
207-
let dst = dir.join(&new_name);
208-
209-
println!("{} => {}", src.display(), dst.display());
210-
fs::rename(&src, &dst).unwrap();
211-
let status = Command::new("install_name_tool")
212-
.arg("-id")
213-
.arg(format!("@rpath/{}", new_name))
214-
.arg(&dst)
215-
.status()
216-
.expect("failed to execute `install_name_tool`");
217-
assert!(status.success());
218-
}
219-
}
220-
221-
impl Drop for NativeLibBoilerplate {
222-
fn drop(&mut self) {
223-
if !thread::panicking() {
224-
t!(File::create(self.out_dir.join("rustbuild.timestamp")));
225-
}
226-
}
227-
}
228-
229-
// Perform standard preparations for native libraries that are build only once for all stages.
230-
// Emit rerun-if-changed and linking attributes for Cargo, check if any source files are
231-
// updated, calculate paths used later in actual build with CMake/make or C/C++ compiler.
232-
// If Err is returned, then everything is up-to-date and further build actions can be skipped.
233-
// Timestamps are created automatically when the result of `native_lib_boilerplate` goes out
234-
// of scope, so all the build actions should be completed until then.
235-
pub fn native_lib_boilerplate(
236-
src_dir: &Path,
237-
out_name: &str,
238-
link_name: &str,
239-
search_subdir: &str,
240-
) -> Result<NativeLibBoilerplate, ()> {
241-
rerun_if_changed_anything_in_dir(src_dir);
242-
243-
let out_dir =
244-
env::var_os("RUSTBUILD_NATIVE_DIR").unwrap_or_else(|| env::var_os("OUT_DIR").unwrap());
245-
let out_dir = PathBuf::from(out_dir).join(out_name);
246-
t!(fs::create_dir_all(&out_dir));
247-
if link_name.contains('=') {
248-
println!("cargo:rustc-link-lib={}", link_name);
249-
} else {
250-
println!("cargo:rustc-link-lib=static={}", link_name);
251-
}
252-
println!("cargo:rustc-link-search=native={}", out_dir.join(search_subdir).display());
253-
254-
let timestamp = out_dir.join("rustbuild.timestamp");
255-
if !up_to_date(Path::new("build.rs"), &timestamp) || !up_to_date(src_dir, &timestamp) {
256-
Ok(NativeLibBoilerplate { src_dir: src_dir.to_path_buf(), out_dir })
257-
} else {
258-
Err(())
259-
}
260-
}
261-
262-
pub fn sanitizer_lib_boilerplate(
263-
sanitizer_name: &str,
264-
) -> Result<(NativeLibBoilerplate, String), ()> {
265-
let (link_name, search_path, apple) = match &*env::var("TARGET").unwrap() {
266-
"x86_64-unknown-linux-gnu" => {
267-
(format!("clang_rt.{}-x86_64", sanitizer_name), "build/lib/linux", false)
268-
}
269-
"x86_64-apple-darwin" => {
270-
(format!("clang_rt.{}_osx_dynamic", sanitizer_name), "build/lib/darwin", true)
271-
}
272-
_ => return Err(()),
273-
};
274-
let to_link = if apple {
275-
format!("dylib=__rustc__{}", link_name)
276-
} else {
277-
format!("static={}", link_name)
278-
};
279-
// This env var is provided by rustbuild to tell us where `compiler-rt`
280-
// lives.
281-
let dir = env::var_os("RUST_COMPILER_RT_ROOT").unwrap();
282-
let lib = native_lib_boilerplate(dir.as_ref(), sanitizer_name, &to_link, search_path)?;
283-
Ok((lib, link_name))
284-
}
285-
286182
fn dir_up_to_date(src: &Path, threshold: SystemTime) -> bool {
287183
t!(fs::read_dir(src)).map(|e| t!(e)).all(|e| {
288184
let meta = t!(e.metadata());

src/librustc_asan/Cargo.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/librustc_asan/build.rs

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/librustc_asan/lib.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/librustc_lsan/Cargo.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/librustc_lsan/build.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/librustc_lsan/lib.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/librustc_msan/Cargo.toml

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/librustc_msan/build.rs

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/librustc_msan/lib.rs

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)