aboutsummaryrefslogtreecommitdiff
path: root/src/link.zig
diff options
context:
space:
mode:
authorDavid Rubin <daviru007@icloud.com>2024-12-25 21:10:02 -0800
committerDavid Rubin <87927264+Rexicon226@users.noreply.github.com>2025-02-25 11:22:33 -0800
commit95720f007bb0dacc8a7cecb621c322d574c61d00 (patch)
treee3746e6d83a709cd86f93eaf7e59578007466d88 /src/link.zig
parentbabee5f73c01c220e3fb3901eb1a70149f94258b (diff)
downloadzig-95720f007bb0dacc8a7cecb621c322d574c61d00.tar.gz
zig-95720f007bb0dacc8a7cecb621c322d574c61d00.zip
move libubsan to `lib/` and integrate it into `-fubsan-rt`
Diffstat (limited to 'src/link.zig')
-rw-r--r--src/link.zig7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/link.zig b/src/link.zig
index 4ab71493d0..82b4e63397 100644
--- a/src/link.zig
+++ b/src/link.zig
@@ -1107,6 +1107,11 @@ pub const File = struct {
else
null;
+ const ubsan_rt_path: ?Path = if (comp.include_ubsan_rt)
+ comp.ubsan_rt_obj.?.full_object_path
+ else
+ null;
+
// This function follows the same pattern as link.Elf.linkWithLLD so if you want some
// insight as to what's going on here you can read that function body which is more
// well-commented.
@@ -1136,6 +1141,7 @@ pub const File = struct {
}
try man.addOptionalFile(zcu_obj_path);
try man.addOptionalFilePath(compiler_rt_path);
+ try man.addOptionalFilePath(ubsan_rt_path);
// We don't actually care whether it's a cache hit or miss; we just need the digest and the lock.
_ = try man.hit();
@@ -1181,6 +1187,7 @@ pub const File = struct {
}
if (zcu_obj_path) |p| object_files.appendAssumeCapacity(try arena.dupeZ(u8, p));
if (compiler_rt_path) |p| object_files.appendAssumeCapacity(try p.toStringZ(arena));
+ if (ubsan_rt_path) |p| object_files.appendAssumeCapacity(try p.toStringZ(arena));
if (comp.verbose_link) {
std.debug.print("ar rcs {s}", .{full_out_path_z});