Skip to content

Commit e216b65

Browse files
committed
Remove sanitizer runtime crates
1 parent cf148a7 commit e216b65

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
@@ -3411,17 +3411,6 @@ dependencies = [
34113411
"smallvec",
34123412
]
34133413

3414-
[[package]]
3415-
name = "rustc_asan"
3416-
version = "0.0.0"
3417-
dependencies = [
3418-
"alloc",
3419-
"build_helper",
3420-
"cmake",
3421-
"compiler_builtins",
3422-
"core",
3423-
]
3424-
34253414
[[package]]
34263415
name = "rustc_codegen_llvm"
34273416
version = "0.0.0"
@@ -3620,17 +3609,6 @@ dependencies = [
36203609
"cc",
36213610
]
36223611

3623-
[[package]]
3624-
name = "rustc_lsan"
3625-
version = "0.0.0"
3626-
dependencies = [
3627-
"alloc",
3628-
"build_helper",
3629-
"cmake",
3630-
"compiler_builtins",
3631-
"core",
3632-
]
3633-
36343612
[[package]]
36353613
name = "rustc_macros"
36363614
version = "0.1.0"
@@ -3685,17 +3663,6 @@ dependencies = [
36853663
"syntax_pos",
36863664
]
36873665

3688-
[[package]]
3689-
name = "rustc_msan"
3690-
version = "0.0.0"
3691-
dependencies = [
3692-
"alloc",
3693-
"build_helper",
3694-
"cmake",
3695-
"compiler_builtins",
3696-
"core",
3697-
]
3698-
36993666
[[package]]
37003667
name = "rustc_passes"
37013668
version = "0.0.0"
@@ -3810,17 +3777,6 @@ dependencies = [
38103777
"syntax_pos",
38113778
]
38123779

3813-
[[package]]
3814-
name = "rustc_tsan"
3815-
version = "0.0.0"
3816-
dependencies = [
3817-
"alloc",
3818-
"build_helper",
3819-
"cmake",
3820-
"compiler_builtins",
3821-
"core",
3822-
]
3823-
38243780
[[package]]
38253781
name = "rustc_typeck"
38263782
version = "0.0.0"
@@ -4176,10 +4132,6 @@ dependencies = [
41764132
"panic_unwind",
41774133
"profiler_builtins",
41784134
"rand 0.7.0",
4179-
"rustc_asan",
4180-
"rustc_lsan",
4181-
"rustc_msan",
4182-
"rustc_tsan",
41834135
"unwind",
41844136
"wasi",
41854137
]

src/bootstrap/dist.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,10 +960,6 @@ impl Step for Src {
960960
"src/libcore",
961961
"src/libpanic_abort",
962962
"src/libpanic_unwind",
963-
"src/librustc_asan",
964-
"src/librustc_lsan",
965-
"src/librustc_msan",
966-
"src/librustc_tsan",
967963
"src/libstd",
968964
"src/libunwind",
969965
"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.

0 commit comments

Comments
 (0)