diff --git a/src/Compilation.zig b/src/Compilation.zig index 1dc7916a548855e6f3a898e5b3a8fa40c4c5198f..a88063b952420d75408f334491f9ea5daa8030de 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1347,7 +1347,7 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil // approach, since the ubsan runtime uses quite a lot of the standard library // and this reduces unnecessary bloat. const ubsan_rt_strat: RtStrat = s: { - const want_ubsan_rt = options.want_ubsan_rt orelse (any_sanitize_c and output_mode != .Obj); + const want_ubsan_rt = options.want_ubsan_rt orelse (any_sanitize_c and is_exe_or_dyn_lib); if (!want_ubsan_rt) break :s .none; if (options.skip_linker_dependencies) break :s .none; if (have_zcu) break :s .zcu;