From 127b0921baa01c6fc256a5349ad174fc8d50652e Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Sat, 1 Feb 2025 12:14:37 -0500 Subject: [PATCH 1/2] openbsd: fix stage3 link - llvm requires libexecinfo which has conflicting symbols with libc++abi - workaround is to link c++abi dynamically --- build.zig | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/build.zig b/build.zig index e53135ccdf..9b3effc27a 100644 --- a/build.zig +++ b/build.zig @@ -791,24 +791,19 @@ fn addCmakeCfgOptionsToExe( if (target.abi != .msvc) mod.link_libcpp = true; }, .freebsd => { - if (static) { - try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes); - try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); - } else { - try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes); - } + try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes); + if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); }, .openbsd => { - try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes); - try addCxxKnownPath(b, cfg, exe, b.fmt("libc++abi.{s}", .{lib_suffix}), null, need_cpp_includes); + // - llvm requires libexecinfo which has conflicting symbols with libc++abi + // - only an issue with .a linking + // - workaround is to link c++abi dynamically + try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{target.dynamicLibSuffix()[1..]}), null, need_cpp_includes); + try addCxxKnownPath(b, cfg, exe, b.fmt("libc++abi.{s}", .{target.dynamicLibSuffix()[1..]}), null, need_cpp_includes); }, .netbsd, .dragonfly => { - if (static) { - try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); - try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); - } else { - try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); - } + try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); + if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); }, .solaris, .illumos => { try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); From 1c288ee857cc98a3cd5065790f1df4590e4c132d Mon Sep 17 00:00:00 2001 From: Michael Dusan Date: Sat, 1 Feb 2025 14:47:10 -0500 Subject: [PATCH 2/2] std.Target: bump semver min/max for BSDs and Apple --- lib/std/Target.zig | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/std/Target.zig b/lib/std/Target.zig index 9eea755189..9e5cd44513 100644 --- a/lib/std/Target.zig +++ b/lib/std/Target.zig @@ -528,13 +528,13 @@ pub const Os = struct { .freebsd => .{ .semver = .{ .min = .{ .major = 12, .minor = 0, .patch = 0 }, - .max = .{ .major = 14, .minor = 1, .patch = 0 }, + .max = .{ .major = 14, .minor = 2, .patch = 0 }, }, }, .netbsd => .{ .semver = .{ .min = .{ .major = 8, .minor = 0, .patch = 0 }, - .max = .{ .major = 10, .minor = 0, .patch = 0 }, + .max = .{ .major = 10, .minor = 1, .patch = 0 }, }, }, .openbsd => .{ @@ -553,31 +553,31 @@ pub const Os = struct { .macos => .{ .semver = .{ .min = .{ .major = 13, .minor = 0, .patch = 0 }, - .max = .{ .major = 15, .minor = 2, .patch = 0 }, + .max = .{ .major = 15, .minor = 3, .patch = 0 }, }, }, .ios => .{ .semver = .{ .min = .{ .major = 12, .minor = 0, .patch = 0 }, - .max = .{ .major = 18, .minor = 1, .patch = 0 }, + .max = .{ .major = 18, .minor = 3, .patch = 0 }, }, }, .tvos => .{ .semver = .{ .min = .{ .major = 13, .minor = 0, .patch = 0 }, - .max = .{ .major = 18, .minor = 1, .patch = 0 }, + .max = .{ .major = 18, .minor = 3, .patch = 0 }, }, }, .visionos => .{ .semver = .{ .min = .{ .major = 1, .minor = 0, .patch = 0 }, - .max = .{ .major = 2, .minor = 1, .patch = 0 }, + .max = .{ .major = 2, .minor = 3, .patch = 0 }, }, }, .watchos => .{ .semver = .{ .min = .{ .major = 6, .minor = 0, .patch = 0 }, - .max = .{ .major = 11, .minor = 1, .patch = 0 }, + .max = .{ .major = 11, .minor = 3, .patch = 0 }, }, },