motiejus/zig

fork of https://codeberg.org/ziglang/zig
git clone https://git.jakstys.lt/motiejus/zig.git
Log | Tree | Refs | README | LICENSE

commit 8957b2707464a4dc7f0572bfc08fd104408bc8a3 (tree)
parent c45dcd013bfe9de1c739a88203349603c0682fd9
Author: Ali Cheraghi <alichraghi@proton.me>
Date:   Wed, 26 Feb 2025 15:44:28 +0330

Compilation: disable ubsan_rt for spirv target

Diffstat:
Msrc/Compilation.zig | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/Compilation.zig b/src/Compilation.zig @@ -1347,7 +1347,8 @@ 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 is_exe_or_dyn_lib); + const is_spirv = options.root_mod.resolved_target.result.cpu.arch.isSpirV(); + const want_ubsan_rt = options.want_ubsan_rt orelse (!is_spirv and 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;