Skip to content

Commit 8957b27

Browse files
alichraghiandrewrk
authored andcommitted
Compilation: disable ubsan_rt for spirv target
1 parent c45dcd0 commit 8957b27

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Compilation.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,8 @@ pub fn create(gpa: Allocator, arena: Allocator, options: CreateOptions) !*Compil
13471347
// approach, since the ubsan runtime uses quite a lot of the standard library
13481348
// and this reduces unnecessary bloat.
13491349
const ubsan_rt_strat: RtStrat = s: {
1350-
const want_ubsan_rt = options.want_ubsan_rt orelse (any_sanitize_c and is_exe_or_dyn_lib);
1350+
const is_spirv = options.root_mod.resolved_target.result.cpu.arch.isSpirV();
1351+
const want_ubsan_rt = options.want_ubsan_rt orelse (!is_spirv and any_sanitize_c and is_exe_or_dyn_lib);
13511352
if (!want_ubsan_rt) break :s .none;
13521353
if (options.skip_linker_dependencies) break :s .none;
13531354
if (have_zcu) break :s .zcu;

0 commit comments

Comments
 (0)