Skip to content

Commit 4dcd723

Browse files
committed
Remove sanitizer runtime crates
1 parent 7afe6d9 commit 4dcd723

File tree

16 files changed

+0
-411
lines changed

16 files changed

+0
-411
lines changed

Cargo.lock

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3481,17 +3481,6 @@ dependencies = [
34813481
"smallvec 1.0.0",
34823482
]
34833483

3484-
[[package]]
3485-
name = "rustc_asan"
3486-
version = "0.0.0"
3487-
dependencies = [
3488-
"alloc",
3489-
"build_helper",
3490-
"cmake",
3491-
"compiler_builtins",
3492-
"core",
3493-
]
3494-
34953484
[[package]]
34963485
name = "rustc_codegen_llvm"
34973486
version = "0.0.0"
@@ -3714,17 +3703,6 @@ dependencies = [
37143703
"cc",
37153704
]
37163705

3717-
[[package]]
3718-
name = "rustc_lsan"
3719-
version = "0.0.0"
3720-
dependencies = [
3721-
"alloc",
3722-
"build_helper",
3723-
"cmake",
3724-
"compiler_builtins",
3725-
"core",
3726-
]
3727-
37283706
[[package]]
37293707
name = "rustc_macros"
37303708
version = "0.1.0"
@@ -3784,17 +3762,6 @@ dependencies = [
37843762
"syntax_pos",
37853763
]
37863764

3787-
[[package]]
3788-
name = "rustc_msan"
3789-
version = "0.0.0"
3790-
dependencies = [
3791-
"alloc",
3792-
"build_helper",
3793-
"cmake",
3794-
"compiler_builtins",
3795-
"core",
3796-
]
3797-
37983765
[[package]]
37993766
name = "rustc_parse"
38003767
version = "0.0.0"
@@ -3942,17 +3909,6 @@ dependencies = [
39423909
"syntax_pos",
39433910
]
39443911

3945-
[[package]]
3946-
name = "rustc_tsan"
3947-
version = "0.0.0"
3948-
dependencies = [
3949-
"alloc",
3950-
"build_helper",
3951-
"cmake",
3952-
"compiler_builtins",
3953-
"core",
3954-
]
3955-
39563912
[[package]]
39573913
name = "rustc_typeck"
39583914
version = "0.0.0"
@@ -4316,10 +4272,6 @@ dependencies = [
43164272
"panic_unwind",
43174273
"profiler_builtins",
43184274
"rand 0.7.0",
4319-
"rustc_asan",
4320-
"rustc_lsan",
4321-
"rustc_msan",
4322-
"rustc_tsan",
43234275
"unwind",
43244276
"wasi 0.9.0+wasi-snapshot-preview1",
43254277
]

src/bootstrap/dist.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,10 +961,6 @@ impl Step for Src {
961961
"src/libcore",
962962
"src/libpanic_abort",
963963
"src/libpanic_unwind",
964-
"src/librustc_asan",
965-
"src/librustc_lsan",
966-
"src/librustc_msan",
967-
"src/librustc_tsan",
968964
"src/libstd",
969965
"src/libunwind",
970966
"src/libtest",

src/build_helper/lib.rs

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
use std::fs::File;
21
use std::path::{Path, PathBuf};
32
use std::process::{Command, Stdio};
43
use std::time::{SystemTime, UNIX_EPOCH};
54
use std::{env, fs};
6-
use std::thread;
75

86
/// A helper macro to `unwrap` a result except also print out details like:
97
///
@@ -189,123 +187,6 @@ pub fn up_to_date(src: &Path, dst: &Path) -> bool {
189187
}
190188
}
191189

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

0 commit comments

Comments
 (0)