@@ -236,51 +236,6 @@ if (toolchain_has_rust) {
236
236
visibility = [ " :*" ]
237
237
}
238
238
239
- # When given -Zsanitize=..., rustc insists on passing a sanitizer runtime to
240
- # the linker it invokes. Unfortunately, our C++ ldflags already tell the
241
- # linker to link against a C++ sanitizer runtime - which contains the same
242
- # symbols. So, make a blank library.
243
- # The list of relevant sanitizers here is taken from
244
- # https://github.com/rust-lang/rust/blob/7e7483d26e3cec7a44ef00cf7ae6c9c8c918bec6/compiler/rustc_codegen_ssa/src/back/link.rs#L1148
245
- template (" rustc_sanitizer_runtime" ) {
246
- rt_name = target_name
247
- not_needed ([ " invoker" ])
248
- static_library (" sanitizer_rt_$rt_name " ) {
249
- sources = []
250
- output_name = " librustc-${ rust_channel } _rt.$rt_name "
251
- output_dir = " $local_rustc_sysroot /$sysroot_lib_subdir "
252
- if (is_win ) {
253
- arflags = [ " /llvmlibempty" ]
254
- }
255
- }
256
- }
257
- rustc_sanitizer_runtimes = []
258
- if (is_asan ) {
259
- rustc_sanitizer_runtime (" asan" ) {
260
- }
261
- rustc_sanitizer_runtimes += [ " :sanitizer_rt_asan" ]
262
- }
263
- if (is_lsan ) {
264
- rustc_sanitizer_runtime (" lsan" ) {
265
- }
266
- rustc_sanitizer_runtimes += [ " :sanitizer_rt_lsan" ]
267
- }
268
- if (is_msan ) {
269
- rustc_sanitizer_runtime (" msan" ) {
270
- }
271
- rustc_sanitizer_runtimes += [ " :sanitizer_rt_msan" ]
272
- }
273
- if (is_tsan ) {
274
- rustc_sanitizer_runtime (" tsan" ) {
275
- }
276
- rustc_sanitizer_runtimes += [ " :sanitizer_rt_tsan" ]
277
- }
278
- if (is_hwasan ) {
279
- rustc_sanitizer_runtime (" hwasan" ) {
280
- }
281
- rustc_sanitizer_runtimes += [ " :sanitizer_rt_hwasan" ]
282
- }
283
-
284
239
# Builds and links against the Rust stdlib. Both Rust and C++ targets should
285
240
# depend on this, as it provides the path to the library and includes the
286
241
# allocator hooks.
@@ -299,7 +254,6 @@ if (toolchain_has_rust) {
299
254
foreach (libname , stdlib_files + skip_stdlib_files ) {
300
255
deps += [ " rules:$libname " ]
301
256
}
302
- deps += rustc_sanitizer_runtimes
303
257
304
258
public_deps = [ " :remap_alloc" ]
305
259
}
0 commit comments