diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-02-26 03:08:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-26 03:08:36 -0500 |
| commit | c45dcd013bfe9de1c739a88203349603c0682fd9 (patch) | |
| tree | b1b5c1949b227e67238ef88b7a083d480388224c /src/main.zig | |
| parent | e0a955afb3c8768fb52b56c342f171bc1d0d6066 (diff) | |
| parent | ca83f52fd95fa6ebf28b7d51d4ef396a2ccf4be4 (diff) | |
| download | zig-c45dcd013bfe9de1c739a88203349603c0682fd9.tar.gz zig-c45dcd013bfe9de1c739a88203349603c0682fd9.zip | |
Merge pull request #22488 from Rexicon226/ubsan-rt
implement a ubsan runtime for better error messages
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig index 97a25a39fa..5e66244484 100644 --- a/src/main.zig +++ b/src/main.zig @@ -561,6 +561,8 @@ const usage_build_generic = \\ -fno-lld Prevent using LLD as the linker \\ -fcompiler-rt Always include compiler-rt symbols in output \\ -fno-compiler-rt Prevent including compiler-rt symbols in output + \\ -fubsan-rt Always include ubsan-rt symbols in the output + \\ -fno-ubsan-rt Prevent including ubsan-rt symbols in the output \\ -rdynamic Add all symbols to the dynamic symbol table \\ -feach-lib-rpath Ensure adding rpath for each used dynamic library \\ -fno-each-lib-rpath Prevent adding rpath for each used dynamic library @@ -849,6 +851,7 @@ fn buildOutputType( var emit_h: Emit = .no; var soname: SOName = undefined; var want_compiler_rt: ?bool = null; + var want_ubsan_rt: ?bool = null; var linker_script: ?[]const u8 = null; var version_script: ?[]const u8 = null; var linker_repro: ?bool = null; @@ -1376,6 +1379,10 @@ fn buildOutputType( want_compiler_rt = true; } else if (mem.eql(u8, arg, "-fno-compiler-rt")) { want_compiler_rt = false; + } else if (mem.eql(u8, arg, "-fubsan-rt")) { + want_ubsan_rt = true; + } else if (mem.eql(u8, arg, "-fno-ubsan-rt")) { + want_ubsan_rt = false; } else if (mem.eql(u8, arg, "-feach-lib-rpath")) { create_module.each_lib_rpath = true; } else if (mem.eql(u8, arg, "-fno-each-lib-rpath")) { @@ -3504,6 +3511,7 @@ fn buildOutputType( .windows_lib_names = create_module.windows_libs.keys(), .wasi_emulated_libs = create_module.wasi_emulated_libs.items, .want_compiler_rt = want_compiler_rt, + .want_ubsan_rt = want_ubsan_rt, .hash_style = hash_style, .linker_script = linker_script, .version_script = version_script, |
