solaris: hard-code native libc paths

On illumos (and Solaris) there is, by design, only one libc.
This commit is contained in:
Ryan Zezeski 2023-09-26 16:02:04 -06:00
parent b447441a91
commit a0ed2c69b0

View File

@ -213,11 +213,16 @@ pub const LibCInstallation = struct {
try self.findNativeIncludeDirPosix(args);
try self.findNativeCrtBeginDirHaiku(args);
self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib");
} else if (builtin.target.os.tag == .solaris) {
// There is only one libc in illumos, and its headers and
// libraries are always in the same spot.
self.include_dir = try args.allocator.dupeZ(u8, "/usr/include");
self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include");
self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64");
} else if (std.process.can_spawn) {
try self.findNativeIncludeDirPosix(args);
switch (builtin.target.os.tag) {
.freebsd, .netbsd, .openbsd, .dragonfly => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib"),
.solaris => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"),
.linux => try self.findNativeCrtDirPosix(args),
else => {},
}