| author | |
| committer | |
| log | fcdb7027e9f606cf0f4415daee73cb717affe69e |
| tree | 8bbcc034da247436ae77b10fb19321cb443d49a7 |
| parent | 0c83fa2fd03fec86c4e36075978646f202deec32 |
4 files changed, 22 insertions(+), 2 deletions(-)
build.zig+3| ... | @@ -747,6 +747,9 @@ fn addCmakeCfgOptionsToExe( | ... | @@ -747,6 +747,9 @@ fn addCmakeCfgOptionsToExe( |
| 747 | try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); | 747 | try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); |
| 748 | try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); | 748 | try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); |
| 749 | }, | 749 | }, |
| 750 | .haiku => { | ||
| 751 | try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); | ||
| 752 | }, | ||
| 750 | else => {}, | 753 | else => {}, |
| 751 | } | 754 | } |
| 752 | } | 755 | } |
lib/std/Target.zig+7| ... | @@ -2740,6 +2740,13 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool { | ... | @@ -2740,6 +2740,13 @@ pub fn is_libc_lib_name(target: std.Target, name: []const u8) bool { |
| 2740 | return true; | 2740 | return true; |
| 2741 | } | 2741 | } |
| 2742 | 2742 | ||
| 2743 | if (target.os.tag == .haiku) { | ||
| 2744 | if (eqlIgnoreCase(ignore_case, name, "root")) | ||
| 2745 | return true; | ||
| 2746 | if (eqlIgnoreCase(ignore_case, name, "network")) | ||
| 2747 | return true; | ||
| 2748 | } | ||
| 2749 | |||
| 2743 | return false; | 2750 | return false; |
| 2744 | } | 2751 | } |
| 2745 | 2752 |
lib/std/zig/system/NativePaths.zig+7| ... | @@ -105,6 +105,13 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths { | ... | @@ -105,6 +105,13 @@ pub fn detect(arena: Allocator, native_target: std.Target) !NativePaths { |
| 105 | return self; | 105 | return self; |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | if (builtin.os.tag == .haiku) { | ||
| 109 | try self.addLibDir("/system/non-packaged/lib"); | ||
| 110 | try self.addLibDir("/system/develop/lib"); | ||
| 111 | try self.addLibDir("/system/lib"); | ||
| 112 | return self; | ||
| 113 | } | ||
| 114 | |||
| 108 | if (builtin.os.tag != .windows and builtin.os.tag != .wasi) { | 115 | if (builtin.os.tag != .windows and builtin.os.tag != .wasi) { |
| 109 | const triple = try native_target.linuxTriple(arena); | 116 | const triple = try native_target.linuxTriple(arena); |
| 110 | 117 |
src/link/Elf.zig+5-2| ... | @@ -1517,7 +1517,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { | ... | @@ -1517,7 +1517,7 @@ fn dumpArgv(self: *Elf, comp: *Compilation) !void { |
| 1517 | 1517 | ||
| 1518 | if (self.base.isStatic()) { | 1518 | if (self.base.isStatic()) { |
| 1519 | try argv.append("-static"); | 1519 | try argv.append("-static"); |
| 1520 | } else if (self.base.isDynLib()) { | 1520 | } else if (self.base.isDynLib() or (target.os.tag == .haiku and self.base.isExe())) { |
| 1521 | try argv.append("-shared"); | 1521 | try argv.append("-shared"); |
| 1522 | } | 1522 | } |
| 1523 | 1523 | ||
| ... | @@ -2469,7 +2469,10 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) !voi | ... | @@ -2469,7 +2469,10 @@ fn linkWithLLD(self: *Elf, arena: Allocator, prog_node: *std.Progress.Node) !voi |
| 2469 | } else { | 2469 | } else { |
| 2470 | try argv.append("-static"); | 2470 | try argv.append("-static"); |
| 2471 | } | 2471 | } |
| 2472 | } else if (is_dyn_lib) { | 2472 | } else if (switch (target.os.tag) { |
| 2473 | else => is_dyn_lib, | ||
| 2474 | .haiku => is_exe_or_dyn_lib, | ||
| 2475 | }) { | ||
| 2473 | try argv.append("-shared"); | 2476 | try argv.append("-shared"); |
| 2474 | } | 2477 | } |
| 2475 | 2478 |