| author | |
| committer | |
| log | 77338947617f5aed0bfe50ca4975d284736a5d90 |
| tree | c16c472fe582471051c9d17dbd757704985aed46 |
| parent | 47f08605bd3ce01fb38e0d41408f4e09268fce09 |
| parent | dd026588d081c639f59696bb1e2f0998f0f10f11 |
| signature |
Illumos/Solaris updates26 files changed, 132 insertions(+), 53 deletions(-)
CMakeLists.txt+22-8| ... | ... | @@ -1,4 +1,5 @@ |
| 1 | 1 | cmake_minimum_required(VERSION 3.5) |
| 2 | include(CheckSymbolExists) | |
| 2 | 3 | |
| 3 | 4 | if(NOT CMAKE_BUILD_TYPE) |
| 4 | 5 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING |
| ... | ... | @@ -706,9 +707,25 @@ target_link_libraries(zigcpp LINK_PUBLIC |
| 706 | 707 | ${CMAKE_THREAD_LIBS_INIT} |
| 707 | 708 | ) |
| 708 | 709 | |
| 710 | string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS) | |
| 711 | if(ZIG_HOST_TARGET_OS STREQUAL "darwin") | |
| 712 | set(ZIG_HOST_TARGET_OS "macos") | |
| 713 | elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos") | |
| 714 | check_symbol_exists(__illumos__ "" ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO) | |
| 715 | if (ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO) | |
| 716 | set(ZIG_HOST_TARGET_OS "illumos") | |
| 717 | else() | |
| 718 | set(ZIG_HOST_TARGET_OS "solaris") | |
| 719 | endif() | |
| 720 | endif() | |
| 721 | ||
| 709 | 722 | string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH) |
| 710 | 723 | if(ZIG_HOST_TARGET_ARCH MATCHES "^i[3-9]86$") |
| 711 | set(ZIG_HOST_TARGET_ARCH "x86") | |
| 724 | if (ZIG_HOST_TARGET_OS MATCHES "(solaris|illumos)") | |
| 725 | set(ZIG_HOST_TARGET_ARCH "x86_64") | |
| 726 | else() | |
| 727 | set(ZIG_HOST_TARGET_ARCH "x86") | |
| 728 | endif() | |
| 712 | 729 | elseif(ZIG_HOST_TARGET_ARCH STREQUAL "amd64") |
| 713 | 730 | set(ZIG_HOST_TARGET_ARCH "x86_64") |
| 714 | 731 | elseif(ZIG_HOST_TARGET_ARCH STREQUAL "arm64") |
| ... | ... | @@ -720,7 +737,6 @@ elseif(ZIG_HOST_TARGET_ARCH STREQUAL "armv7b") |
| 720 | 737 | endif() |
| 721 | 738 | string(REGEX REPLACE "^((arm|thumb)(hf?)?)el$" "\\1" ZIG_HOST_TARGET_ARCH "${ZIG_HOST_TARGET_ARCH}") |
| 722 | 739 | if(ZIG_HOST_TARGET_ARCH MATCHES "^arm(hf?)?(eb)?$") |
| 723 | include(CheckSymbolExists) | |
| 724 | 740 | check_symbol_exists(__thumb__ "" ZIG_HOST_TARGET_DEFAULTS_TO_THUMB) |
| 725 | 741 | if(ZIG_HOST_TARGET_DEFAULTS_TO_THUMB) |
| 726 | 742 | string(REGEX REPLACE "^arm" "thumb" ZIG_HOST_TARGET_ARCH "${ZIG_HOST_TARGET_ARCH}") |
| ... | ... | @@ -728,11 +744,6 @@ if(ZIG_HOST_TARGET_ARCH MATCHES "^arm(hf?)?(eb)?$") |
| 728 | 744 | endif() |
| 729 | 745 | string(REGEX REPLACE "^ppc((64)?(le)?)$" "powerpc\\1" ZIG_HOST_TARGET_ARCH "${ZIG_HOST_TARGET_ARCH}") |
| 730 | 746 | |
| 731 | string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS) | |
| 732 | if(ZIG_HOST_TARGET_OS STREQUAL "darwin") | |
| 733 | set(ZIG_HOST_TARGET_OS "macos") | |
| 734 | endif() | |
| 735 | ||
| 736 | 747 | if(MSVC) |
| 737 | 748 | set(ZIG_HOST_TARGET_ABI "-msvc") |
| 738 | 749 | elseif(MINGW) |
| ... | ... | @@ -759,6 +770,9 @@ else() |
| 759 | 770 | set(ZIG2_LINK_FLAGS "-Wl,-stack_size,0x10000000") |
| 760 | 771 | elseif(MINGW) |
| 761 | 772 | set(ZIG2_LINK_FLAGS "-Wl,--stack,0x10000000") |
| 773 | # Solaris/illumos ld(1) does not provide a --stack-size option. | |
| 774 | elseif(CMAKE_HOST_SOLARIS) | |
| 775 | unset(ZIG2_LINK_FLAGS) | |
| 762 | 776 | else() |
| 763 | 777 | set(ZIG2_LINK_FLAGS "-Wl,-z,stack-size=0x10000000") |
| 764 | 778 | endif() |
| ... | ... | @@ -832,7 +846,7 @@ add_custom_command( |
| 832 | 846 | add_executable(zig2 ${ZIG2_C_SOURCE} ${ZIG_COMPILER_RT_C_SOURCE}) |
| 833 | 847 | set_target_properties(zig2 PROPERTIES |
| 834 | 848 | COMPILE_FLAGS ${ZIG2_COMPILE_FLAGS} |
| 835 | LINK_FLAGS ${ZIG2_LINK_FLAGS} | |
| 849 | LINK_FLAGS "${ZIG2_LINK_FLAGS}" | |
| 836 | 850 | ) |
| 837 | 851 | target_include_directories(zig2 PUBLIC "${CMAKE_SOURCE_DIR}/stage1") |
| 838 | 852 | target_link_libraries(zig2 LINK_PUBLIC zigcpp) |
build.zig+4| ... | ... | @@ -673,6 +673,10 @@ fn addCmakeCfgOptionsToExe( |
| 673 | 673 | try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); |
| 674 | 674 | } |
| 675 | 675 | }, |
| 676 | .solaris, .illumos => { | |
| 677 | try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes); | |
| 678 | try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes); | |
| 679 | }, | |
| 676 | 680 | else => {}, |
| 677 | 681 | } |
| 678 | 682 | } |
lib/std/Thread.zig+4-4| ... | ... | @@ -43,7 +43,7 @@ pub const max_name_len = switch (target.os.tag) { |
| 43 | 43 | .freebsd => 15, |
| 44 | 44 | .openbsd => 23, |
| 45 | 45 | .dragonfly => 1023, |
| 46 | .solaris => 31, | |
| 46 | .solaris, .illumos => 31, | |
| 47 | 47 | else => 0, |
| 48 | 48 | }; |
| 49 | 49 | |
| ... | ... | @@ -123,7 +123,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void { |
| 123 | 123 | else => |e| return os.unexpectedErrno(e), |
| 124 | 124 | } |
| 125 | 125 | }, |
| 126 | .netbsd, .solaris => if (use_pthreads) { | |
| 126 | .netbsd, .solaris, .illumos => if (use_pthreads) { | |
| 127 | 127 | const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null); |
| 128 | 128 | switch (err) { |
| 129 | 129 | .SUCCESS => return, |
| ... | ... | @@ -229,7 +229,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co |
| 229 | 229 | else => |e| return os.unexpectedErrno(e), |
| 230 | 230 | } |
| 231 | 231 | }, |
| 232 | .netbsd, .solaris => if (use_pthreads) { | |
| 232 | .netbsd, .solaris, .illumos => if (use_pthreads) { | |
| 233 | 233 | const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1); |
| 234 | 234 | switch (err) { |
| 235 | 235 | .SUCCESS => return std.mem.sliceTo(buffer, 0), |
| ... | ... | @@ -636,7 +636,7 @@ const PosixThreadImpl = struct { |
| 636 | 636 | }; |
| 637 | 637 | return @as(usize, @intCast(count)); |
| 638 | 638 | }, |
| 639 | .solaris => { | |
| 639 | .solaris, .illumos => { | |
| 640 | 640 | // The "proper" way to get the cpu count would be to query |
| 641 | 641 | // /dev/kstat via ioctls, and traverse a linked list for each |
| 642 | 642 | // cpu. |
lib/std/c.zig+1-1| ... | ... | @@ -49,7 +49,7 @@ pub usingnamespace switch (builtin.os.tag) { |
| 49 | 49 | .openbsd => @import("c/openbsd.zig"), |
| 50 | 50 | .haiku => @import("c/haiku.zig"), |
| 51 | 51 | .hermit => @import("c/hermit.zig"), |
| 52 | .solaris => @import("c/solaris.zig"), | |
| 52 | .solaris, .illumos => @import("c/solaris.zig"), | |
| 53 | 53 | .fuchsia => @import("c/fuchsia.zig"), |
| 54 | 54 | .minix => @import("c/minix.zig"), |
| 55 | 55 | .emscripten => @import("c/emscripten.zig"), |
lib/std/c/solaris.zig+15| ... | ... | @@ -498,6 +498,7 @@ pub const NI = struct { |
| 498 | 498 | pub const MAXSERV = 32; |
| 499 | 499 | }; |
| 500 | 500 | |
| 501 | pub const NAME_MAX = 255; | |
| 501 | 502 | pub const PATH_MAX = 1024; |
| 502 | 503 | pub const IOV_MAX = 1024; |
| 503 | 504 | |
| ... | ... | @@ -1069,7 +1070,21 @@ pub const mcontext_t = extern struct { |
| 1069 | 1070 | }; |
| 1070 | 1071 | |
| 1071 | 1072 | pub const REG = struct { |
| 1073 | pub const R15 = 0; | |
| 1074 | pub const R14 = 1; | |
| 1075 | pub const R13 = 2; | |
| 1076 | pub const R12 = 3; | |
| 1077 | pub const R11 = 4; | |
| 1078 | pub const R10 = 5; | |
| 1079 | pub const R9 = 6; | |
| 1080 | pub const R8 = 7; | |
| 1081 | pub const RDI = 8; | |
| 1082 | pub const RSI = 9; | |
| 1072 | 1083 | pub const RBP = 10; |
| 1084 | pub const RBX = 11; | |
| 1085 | pub const RDX = 12; | |
| 1086 | pub const RCX = 13; | |
| 1087 | pub const RAX = 14; | |
| 1073 | 1088 | pub const RIP = 17; |
| 1074 | 1089 | pub const RSP = 20; |
| 1075 | 1090 | }; |
lib/std/crypto/Certificate/Bundle.zig+10| ... | ... | @@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void { |
| 64 | 64 | .netbsd => return rescanBSD(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"), |
| 65 | 65 | .dragonfly => return rescanBSD(cb, gpa, "/usr/local/etc/ssl/cert.pem"), |
| 66 | 66 | .windows => return rescanWindows(cb, gpa), |
| 67 | .solaris, .illumos => return rescanSolaris(cb, gpa, "/etc/ssl/cacert.pem"), | |
| 67 | 68 | else => {}, |
| 68 | 69 | } |
| 69 | 70 | } |
| ... | ... | @@ -151,6 +152,15 @@ fn rescanWindows(cb: *Bundle, gpa: Allocator) RescanWindowsError!void { |
| 151 | 152 | cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len); |
| 152 | 153 | } |
| 153 | 154 | |
| 155 | const RescanSolarisError = AddCertsFromFilePathError; | |
| 156 | ||
| 157 | fn rescanSolaris(cb: *Bundle, gpa: Allocator, cert_file_path: []const u8) RescanSolarisError!void { | |
| 158 | cb.bytes.clearRetainingCapacity(); | |
| 159 | cb.map.clearRetainingCapacity(); | |
| 160 | try addCertsFromFilePathAbsolute(cb, gpa, cert_file_path); | |
| 161 | cb.bytes.shrinkAndFree(gpa, cb.bytes.items.len); | |
| 162 | } | |
| 163 | ||
| 154 | 164 | pub const AddCertsFromDirPathError = fs.File.OpenError || AddCertsFromDirError; |
| 155 | 165 | |
| 156 | 166 | pub fn addCertsFromDirPath( |
lib/std/crypto/tlcsprng.zig+1| ... | ... | @@ -25,6 +25,7 @@ const os_has_fork = switch (builtin.os.tag) { |
| 25 | 25 | .netbsd, |
| 26 | 26 | .openbsd, |
| 27 | 27 | .solaris, |
| 28 | .illumos, | |
| 28 | 29 | .tvos, |
| 29 | 30 | .watchos, |
| 30 | 31 | .haiku, |
lib/std/debug.zig+4-2| ... | ... | @@ -990,6 +990,7 @@ pub fn openSelfDebugInfo(allocator: mem.Allocator) OpenSelfDebugInfoError!DebugI |
| 990 | 990 | .openbsd, |
| 991 | 991 | .macos, |
| 992 | 992 | .solaris, |
| 993 | .illumos, | |
| 993 | 994 | .windows, |
| 994 | 995 | => return try DebugInfo.init(allocator), |
| 995 | 996 | else => return error.UnsupportedOperatingSystem, |
| ... | ... | @@ -2228,7 +2229,7 @@ pub const ModuleDebugInfo = switch (native_os) { |
| 2228 | 2229 | }; |
| 2229 | 2230 | } |
| 2230 | 2231 | }, |
| 2231 | .linux, .netbsd, .freebsd, .dragonfly, .openbsd, .haiku, .solaris => struct { | |
| 2232 | .linux, .netbsd, .freebsd, .dragonfly, .openbsd, .haiku, .solaris, .illumos => struct { | |
| 2232 | 2233 | base_address: usize, |
| 2233 | 2234 | dwarf: DW.DwarfInfo, |
| 2234 | 2235 | mapped_memory: []align(mem.page_size) const u8, |
| ... | ... | @@ -2313,6 +2314,7 @@ pub const have_segfault_handling_support = switch (native_os) { |
| 2313 | 2314 | .macos, |
| 2314 | 2315 | .netbsd, |
| 2315 | 2316 | .solaris, |
| 2317 | .illumos, | |
| 2316 | 2318 | .windows, |
| 2317 | 2319 | => true, |
| 2318 | 2320 | |
| ... | ... | @@ -2386,7 +2388,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any |
| 2386 | 2388 | .freebsd, .macos => @intFromPtr(info.addr), |
| 2387 | 2389 | .netbsd => @intFromPtr(info.info.reason.fault.addr), |
| 2388 | 2390 | .openbsd => @intFromPtr(info.data.fault.addr), |
| 2389 | .solaris => @intFromPtr(info.reason.fault.addr), | |
| 2391 | .solaris, .illumos => @intFromPtr(info.reason.fault.addr), | |
| 2390 | 2392 | else => unreachable, |
| 2391 | 2393 | }; |
| 2392 | 2394 |
lib/std/dwarf/abi.zig+8-5| ... | ... | @@ -6,11 +6,11 @@ const mem = std.mem; |
| 6 | 6 | pub fn supportsUnwinding(target: std.Target) bool { |
| 7 | 7 | return switch (target.cpu.arch) { |
| 8 | 8 | .x86 => switch (target.os.tag) { |
| 9 | .linux, .netbsd, .solaris => true, | |
| 9 | .linux, .netbsd, .solaris, .illumos => true, | |
| 10 | 10 | else => false, |
| 11 | 11 | }, |
| 12 | 12 | .x86_64 => switch (target.os.tag) { |
| 13 | .linux, .netbsd, .freebsd, .openbsd, .macos, .ios, .solaris => true, | |
| 13 | .linux, .netbsd, .freebsd, .openbsd, .macos, .ios, .solaris, .illumos => true, | |
| 14 | 14 | else => false, |
| 15 | 15 | }, |
| 16 | 16 | .arm => switch (target.os.tag) { |
| ... | ... | @@ -194,7 +194,7 @@ pub fn regBytes( |
| 194 | 194 | const ucontext_ptr = thread_context_ptr; |
| 195 | 195 | return switch (builtin.cpu.arch) { |
| 196 | 196 | .x86 => switch (builtin.os.tag) { |
| 197 | .linux, .netbsd, .solaris => switch (reg_number) { | |
| 197 | .linux, .netbsd, .solaris, .illumos => switch (reg_number) { | |
| 198 | 198 | 0 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.EAX]), |
| 199 | 199 | 1 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.ECX]), |
| 200 | 200 | 2 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.EDX]), |
| ... | ... | @@ -229,7 +229,7 @@ pub fn regBytes( |
| 229 | 229 | else => error.UnimplementedOs, |
| 230 | 230 | }, |
| 231 | 231 | .x86_64 => switch (builtin.os.tag) { |
| 232 | .linux, .solaris => switch (reg_number) { | |
| 232 | .linux, .solaris, .illumos => switch (reg_number) { | |
| 233 | 233 | 0 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.RAX]), |
| 234 | 234 | 1 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.RDX]), |
| 235 | 235 | 2 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.RCX]), |
| ... | ... | @@ -247,7 +247,10 @@ pub fn regBytes( |
| 247 | 247 | 14 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.R14]), |
| 248 | 248 | 15 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.R15]), |
| 249 | 249 | 16 => mem.asBytes(&ucontext_ptr.mcontext.gregs[os.REG.RIP]), |
| 250 | 17...32 => |i| mem.asBytes(&ucontext_ptr.mcontext.fpregs.xmm[i - 17]), | |
| 250 | 17...32 => |i| if (builtin.os.tag.isSolarish()) | |
| 251 | mem.asBytes(&ucontext_ptr.mcontext.fpregs.chip_state.xmm[i - 17]) | |
| 252 | else | |
| 253 | mem.asBytes(&ucontext_ptr.mcontext.fpregs.xmm[i - 17]), | |
| 251 | 254 | else => error.InvalidRegister, |
| 252 | 255 | }, |
| 253 | 256 | .freebsd => switch (reg_number) { |
lib/std/dynamic_library.zig+2-2| ... | ... | @@ -10,7 +10,7 @@ const system = std.os.system; |
| 10 | 10 | pub const DynLib = switch (builtin.os.tag) { |
| 11 | 11 | .linux => if (builtin.link_libc) DlDynlib else ElfDynLib, |
| 12 | 12 | .windows => WindowsDynLib, |
| 13 | .macos, .tvos, .watchos, .ios, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris => DlDynlib, | |
| 13 | .macos, .tvos, .watchos, .ios, .freebsd, .netbsd, .openbsd, .dragonfly, .solaris, .illumos => DlDynlib, | |
| 14 | 14 | else => void, |
| 15 | 15 | }; |
| 16 | 16 | |
| ... | ... | @@ -388,7 +388,7 @@ pub const DlDynlib = struct { |
| 388 | 388 | |
| 389 | 389 | test "dynamic_library" { |
| 390 | 390 | const libname = switch (builtin.os.tag) { |
| 391 | .linux, .freebsd, .openbsd => "invalid_so.so", | |
| 391 | .linux, .freebsd, .openbsd, .solaris, .illumos => "invalid_so.so", | |
| 392 | 392 | .windows => "invalid_dll.dll", |
| 393 | 393 | .macos, .tvos, .watchos, .ios => "invalid_dylib.dylib", |
| 394 | 394 | else => return error.SkipZigTest, |
lib/std/fs.zig+7-7| ... | ... | @@ -39,7 +39,7 @@ pub const Watch = @import("fs/watch.zig").Watch; |
| 39 | 39 | /// fit into a UTF-8 encoded array of this length. |
| 40 | 40 | /// The byte count includes room for a null sentinel byte. |
| 41 | 41 | pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 42 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .solaris, .plan9 => os.PATH_MAX, | |
| 42 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .haiku, .solaris, .illumos, .plan9 => os.PATH_MAX, | |
| 43 | 43 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. |
| 44 | 44 | // If it would require 4 UTF-8 bytes, then there would be a surrogate |
| 45 | 45 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. |
| ... | ... | @@ -59,10 +59,9 @@ pub const MAX_PATH_BYTES = switch (builtin.os.tag) { |
| 59 | 59 | /// (depending on the platform) this assumption may not hold for every configuration. |
| 60 | 60 | /// The byte count does not include a null sentinel byte. |
| 61 | 61 | pub const MAX_NAME_BYTES = switch (builtin.os.tag) { |
| 62 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly => os.NAME_MAX, | |
| 62 | .linux, .macos, .ios, .freebsd, .openbsd, .netbsd, .dragonfly, .solaris, .illumos => os.NAME_MAX, | |
| 63 | 63 | // Haiku's NAME_MAX includes the null terminator, so subtract one. |
| 64 | 64 | .haiku => os.NAME_MAX - 1, |
| 65 | .solaris => os.system.MAXNAMLEN, | |
| 66 | 65 | // Each UTF-16LE character may be expanded to 3 UTF-8 bytes. |
| 67 | 66 | // If it would require 4 UTF-8 bytes, then there would be a surrogate |
| 68 | 67 | // pair in the UTF-16LE, and we (over)account 3 bytes for it that way. |
| ... | ... | @@ -326,7 +325,7 @@ pub const IterableDir = struct { |
| 326 | 325 | const IteratorError = error{ AccessDenied, SystemResources } || os.UnexpectedError; |
| 327 | 326 | |
| 328 | 327 | pub const Iterator = switch (builtin.os.tag) { |
| 329 | .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => struct { | |
| 328 | .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => struct { | |
| 330 | 329 | dir: Dir, |
| 331 | 330 | seek: i64, |
| 332 | 331 | buf: [1024]u8, // TODO align(@alignOf(os.system.dirent)), |
| ... | ... | @@ -344,7 +343,7 @@ pub const IterableDir = struct { |
| 344 | 343 | switch (builtin.os.tag) { |
| 345 | 344 | .macos, .ios => return self.nextDarwin(), |
| 346 | 345 | .freebsd, .netbsd, .dragonfly, .openbsd => return self.nextBsd(), |
| 347 | .solaris => return self.nextSolaris(), | |
| 346 | .solaris, .illumos => return self.nextSolaris(), | |
| 348 | 347 | else => @compileError("unimplemented"), |
| 349 | 348 | } |
| 350 | 349 | } |
| ... | ... | @@ -898,6 +897,7 @@ pub const IterableDir = struct { |
| 898 | 897 | .dragonfly, |
| 899 | 898 | .openbsd, |
| 900 | 899 | .solaris, |
| 900 | .illumos, | |
| 901 | 901 | => return Iterator{ |
| 902 | 902 | .dir = self.dir, |
| 903 | 903 | .seek = 0, |
| ... | ... | @@ -1841,7 +1841,7 @@ pub const Dir = struct { |
| 1841 | 1841 | error.AccessDenied => |e| switch (builtin.os.tag) { |
| 1842 | 1842 | // non-Linux POSIX systems return EPERM when trying to delete a directory, so |
| 1843 | 1843 | // we need to handle that case specifically and translate the error |
| 1844 | .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => { | |
| 1844 | .macos, .ios, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => { | |
| 1845 | 1845 | // Don't follow symlinks to match unlinkat (which acts on symlinks rather than follows them) |
| 1846 | 1846 | const fstat = os.fstatatZ(self.fd, sub_path_c, os.AT.SYMLINK_NOFOLLOW) catch return e; |
| 1847 | 1847 | const is_dir = fstat.mode & os.S.IFMT == os.S.IFDIR; |
| ... | ... | @@ -3007,7 +3007,7 @@ pub fn selfExePath(out_buffer: []u8) SelfExePathError![]u8 { |
| 3007 | 3007 | } |
| 3008 | 3008 | switch (builtin.os.tag) { |
| 3009 | 3009 | .linux => return os.readlinkZ("/proc/self/exe", out_buffer), |
| 3010 | .solaris => return os.readlinkZ("/proc/self/path/a.out", out_buffer), | |
| 3010 | .solaris, .illumos => return os.readlinkZ("/proc/self/path/a.out", out_buffer), | |
| 3011 | 3011 | .freebsd, .dragonfly => { |
| 3012 | 3012 | var mib = [4]c_int{ os.CTL.KERN, os.KERN.PROC, os.KERN.PROC_PATHNAME, -1 }; |
| 3013 | 3013 | var out_len: usize = out_buffer.len; |
lib/std/fs/file.zig+2-2| ... | ... | @@ -359,7 +359,7 @@ pub const File = struct { |
| 359 | 359 | os.S.IFSOCK => break :blk .unix_domain_socket, |
| 360 | 360 | else => {}, |
| 361 | 361 | } |
| 362 | if (builtin.os.tag == .solaris) switch (m) { | |
| 362 | if (builtin.os.tag.isSolarish()) switch (m) { | |
| 363 | 363 | os.S.IFDOOR => break :blk .door, |
| 364 | 364 | os.S.IFPORT => break :blk .event_port, |
| 365 | 365 | else => {}, |
| ... | ... | @@ -685,7 +685,7 @@ pub const File = struct { |
| 685 | 685 | else => {}, |
| 686 | 686 | } |
| 687 | 687 | |
| 688 | if (builtin.os.tag == .solaris) switch (m) { | |
| 688 | if (builtin.os.tag.isSolarish()) switch (m) { | |
| 689 | 689 | os.S.IFDOOR => return .door, |
| 690 | 690 | os.S.IFPORT => return .event_port, |
| 691 | 691 | else => {}, |
lib/std/fs/get_app_data_dir.zig+1-1| ... | ... | @@ -44,7 +44,7 @@ pub fn getAppDataDir(allocator: mem.Allocator, appname: []const u8) GetAppDataDi |
| 44 | 44 | }; |
| 45 | 45 | return fs.path.join(allocator, &[_][]const u8{ home_dir, "Library", "Application Support", appname }); |
| 46 | 46 | }, |
| 47 | .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris => { | |
| 47 | .linux, .freebsd, .netbsd, .dragonfly, .openbsd, .solaris, .illumos => { | |
| 48 | 48 | if (os.getenv("XDG_DATA_HOME")) |xdg| { |
| 49 | 49 | return fs.path.join(allocator, &[_][]const u8{ xdg, appname }); |
| 50 | 50 | } |
lib/std/os.zig+4-2| ... | ... | @@ -33,6 +33,7 @@ pub const haiku = std.c; |
| 33 | 33 | pub const netbsd = std.c; |
| 34 | 34 | pub const openbsd = std.c; |
| 35 | 35 | pub const solaris = std.c; |
| 36 | pub const illumos = std.c; | |
| 36 | 37 | pub const linux = @import("os/linux.zig"); |
| 37 | 38 | pub const plan9 = @import("os/plan9.zig"); |
| 38 | 39 | pub const uefi = @import("os/uefi.zig"); |
| ... | ... | @@ -1821,7 +1822,7 @@ pub fn execveZ( |
| 1821 | 1822 | .BADARCH => return error.InvalidExe, |
| 1822 | 1823 | else => return unexpectedErrno(err), |
| 1823 | 1824 | }, |
| 1824 | .linux, .solaris => switch (err) { | |
| 1825 | .linux => switch (err) { | |
| 1825 | 1826 | .LIBBAD => return error.InvalidExe, |
| 1826 | 1827 | else => return unexpectedErrno(err), |
| 1827 | 1828 | }, |
| ... | ... | @@ -5226,6 +5227,7 @@ pub fn isGetFdPathSupportedOnTarget(os: std.Target.Os) bool { |
| 5226 | 5227 | .macos, .ios, .watchos, .tvos, |
| 5227 | 5228 | .linux, |
| 5228 | 5229 | .solaris, |
| 5230 | .illumos, | |
| 5229 | 5231 | .freebsd, |
| 5230 | 5232 | => true, |
| 5231 | 5233 | // zig fmt: on |
| ... | ... | @@ -5280,7 +5282,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 { |
| 5280 | 5282 | }; |
| 5281 | 5283 | return target; |
| 5282 | 5284 | }, |
| 5283 | .solaris => { | |
| 5285 | .solaris, .illumos => { | |
| 5284 | 5286 | var procfs_buf: ["/proc/self/path/-2147483648\x00".len]u8 = undefined; |
| 5285 | 5287 | const proc_path = std.fmt.bufPrintZ(procfs_buf[0..], "/proc/self/path/{d}", .{fd}) catch unreachable; |
| 5286 | 5288 |
lib/std/os/test.zig+5-5| ... | ... | @@ -234,7 +234,7 @@ test "link with relative paths" { |
| 234 | 234 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 235 | 235 | |
| 236 | 236 | switch (native_os) { |
| 237 | .wasi, .linux, .solaris => {}, | |
| 237 | .wasi, .linux, .solaris, .illumos => {}, | |
| 238 | 238 | else => return error.SkipZigTest, |
| 239 | 239 | } |
| 240 | 240 | if (true) { |
| ... | ... | @@ -277,7 +277,7 @@ test "linkat with different directories" { |
| 277 | 277 | if (native_os == .wasi and builtin.link_libc) return error.SkipZigTest; |
| 278 | 278 | |
| 279 | 279 | switch (native_os) { |
| 280 | .wasi, .linux, .solaris => {}, | |
| 280 | .wasi, .linux, .solaris, .illumos => {}, | |
| 281 | 281 | else => return error.SkipZigTest, |
| 282 | 282 | } |
| 283 | 283 | if (true) { |
| ... | ... | @@ -706,7 +706,7 @@ test "fcntl" { |
| 706 | 706 | |
| 707 | 707 | test "signalfd" { |
| 708 | 708 | switch (native_os) { |
| 709 | .linux, .solaris => {}, | |
| 709 | .linux, .solaris, .illumos => {}, | |
| 710 | 710 | else => return error.SkipZigTest, |
| 711 | 711 | } |
| 712 | 712 | _ = &os.signalfd; |
| ... | ... | @@ -732,7 +732,7 @@ test "sync" { |
| 732 | 732 | |
| 733 | 733 | test "fsync" { |
| 734 | 734 | switch (native_os) { |
| 735 | .linux, .windows, .solaris => {}, | |
| 735 | .linux, .windows, .solaris, .illumos => {}, | |
| 736 | 736 | else => return error.SkipZigTest, |
| 737 | 737 | } |
| 738 | 738 | |
| ... | ... | @@ -870,7 +870,7 @@ test "sigaction" { |
| 870 | 870 | |
| 871 | 871 | test "dup & dup2" { |
| 872 | 872 | switch (native_os) { |
| 873 | .linux, .solaris => {}, | |
| 873 | .linux, .solaris, .illumos => {}, | |
| 874 | 874 | else => return error.SkipZigTest, |
| 875 | 875 | } |
| 876 | 876 |
lib/std/process.zig+12-1| ... | ... | @@ -959,7 +959,18 @@ pub const UserInfo = struct { |
| 959 | 959 | /// POSIX function which gets a uid from username. |
| 960 | 960 | pub fn getUserInfo(name: []const u8) !UserInfo { |
| 961 | 961 | return switch (builtin.os.tag) { |
| 962 | .linux, .macos, .watchos, .tvos, .ios, .freebsd, .netbsd, .openbsd, .haiku, .solaris => posixGetUserInfo(name), | |
| 962 | .linux, | |
| 963 | .macos, | |
| 964 | .watchos, | |
| 965 | .tvos, | |
| 966 | .ios, | |
| 967 | .freebsd, | |
| 968 | .netbsd, | |
| 969 | .openbsd, | |
| 970 | .haiku, | |
| 971 | .solaris, | |
| 972 | .illumos, | |
| 973 | => posixGetUserInfo(name), | |
| 963 | 974 | else => @compileError("Unsupported OS"), |
| 964 | 975 | }; |
| 965 | 976 | } |
lib/std/target.zig+11-2| ... | ... | @@ -58,6 +58,7 @@ pub const Target = struct { |
| 58 | 58 | glsl450, |
| 59 | 59 | vulkan, |
| 60 | 60 | plan9, |
| 61 | illumos, | |
| 61 | 62 | other, |
| 62 | 63 | |
| 63 | 64 | pub inline fn isDarwin(tag: Tag) bool { |
| ... | ... | @@ -74,6 +75,10 @@ pub const Target = struct { |
| 74 | 75 | }; |
| 75 | 76 | } |
| 76 | 77 | |
| 78 | pub inline fn isSolarish(tag: Tag) bool { | |
| 79 | return tag == .solaris or tag == .illumos; | |
| 80 | } | |
| 81 | ||
| 77 | 82 | pub fn dynamicLibSuffix(tag: Tag) [:0]const u8 { |
| 78 | 83 | if (tag.isDarwin()) { |
| 79 | 84 | return ".dylib"; |
| ... | ... | @@ -266,6 +271,7 @@ pub const Target = struct { |
| 266 | 271 | .glsl450, // TODO: GLSL versions |
| 267 | 272 | .vulkan, |
| 268 | 273 | .plan9, |
| 274 | .illumos, | |
| 269 | 275 | .other, |
| 270 | 276 | => return .{ .none = {} }, |
| 271 | 277 | |
| ... | ... | @@ -409,6 +415,7 @@ pub const Target = struct { |
| 409 | 415 | .openbsd, |
| 410 | 416 | .haiku, |
| 411 | 417 | .solaris, |
| 418 | .illumos, | |
| 412 | 419 | => true, |
| 413 | 420 | |
| 414 | 421 | .linux, |
| ... | ... | @@ -526,7 +533,6 @@ pub const Target = struct { |
| 526 | 533 | .cloudabi, |
| 527 | 534 | .dragonfly, |
| 528 | 535 | .lv2, |
| 529 | .solaris, | |
| 530 | 536 | .zos, |
| 531 | 537 | .minix, |
| 532 | 538 | .rtems, |
| ... | ... | @@ -569,6 +575,8 @@ pub const Target = struct { |
| 569 | 575 | .driverkit, |
| 570 | 576 | .shadermodel, |
| 571 | 577 | .liteos, // TODO: audit this |
| 578 | .solaris, | |
| 579 | .illumos, | |
| 572 | 580 | => return .none, |
| 573 | 581 | } |
| 574 | 582 | } |
| ... | ... | @@ -1575,7 +1583,7 @@ pub const Target = struct { |
| 1575 | 1583 | .netbsd => return copy(&result, "/libexec/ld.elf_so"), |
| 1576 | 1584 | .openbsd => return copy(&result, "/usr/libexec/ld.so"), |
| 1577 | 1585 | .dragonfly => return copy(&result, "/libexec/ld-elf.so.2"), |
| 1578 | .solaris => return copy(&result, "/lib/64/ld.so.1"), | |
| 1586 | .solaris, .illumos => return copy(&result, "/lib/64/ld.so.1"), | |
| 1579 | 1587 | .linux => switch (self.cpu.arch) { |
| 1580 | 1588 | .x86, |
| 1581 | 1589 | .sparc, |
| ... | ... | @@ -2115,6 +2123,7 @@ pub const Target = struct { |
| 2115 | 2123 | .emscripten, |
| 2116 | 2124 | .plan9, |
| 2117 | 2125 | .solaris, |
| 2126 | .illumos, | |
| 2118 | 2127 | .haiku, |
| 2119 | 2128 | .ananas, |
| 2120 | 2129 | .fuchsia, |
lib/std/zig/CrossTarget.zig+2| ... | ... | @@ -111,6 +111,7 @@ fn updateOsVersionRange(self: *CrossTarget, os: Target.Os) void { |
| 111 | 111 | .kfreebsd, |
| 112 | 112 | .lv2, |
| 113 | 113 | .solaris, |
| 114 | .illumos, | |
| 114 | 115 | .zos, |
| 115 | 116 | .haiku, |
| 116 | 117 | .minix, |
| ... | ... | @@ -709,6 +710,7 @@ fn parseOs(result: *CrossTarget, diags: *ParseOptions.Diagnostics, text: []const |
| 709 | 710 | .kfreebsd, |
| 710 | 711 | .lv2, |
| 711 | 712 | .solaris, |
| 713 | .illumos, | |
| 712 | 714 | .zos, |
| 713 | 715 | .haiku, |
| 714 | 716 | .minix, |
lib/std/zig/system/NativePaths.zig+1-1| ... | ... | @@ -89,7 +89,7 @@ pub fn detect(arena: Allocator, native_info: NativeTargetInfo) !NativePaths { |
| 89 | 89 | return self; |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | if (builtin.os.tag == .solaris) { | |
| 92 | if (builtin.os.tag.isSolarish()) { | |
| 93 | 93 | try self.addLibDir("/usr/lib/64"); |
| 94 | 94 | try self.addLibDir("/usr/local/lib/64"); |
| 95 | 95 | try self.addLibDir("/lib/64"); |
lib/std/zig/system/NativeTargetInfo.zig+4-2| ... | ... | @@ -51,7 +51,7 @@ pub fn detect(cross_target: CrossTarget) DetectError!NativeTargetInfo { |
| 51 | 51 | error.InvalidVersion => {}, |
| 52 | 52 | } |
| 53 | 53 | }, |
| 54 | .solaris => { | |
| 54 | .solaris, .illumos => { | |
| 55 | 55 | const uts = std.os.uname(); |
| 56 | 56 | const release = mem.sliceTo(&uts.release, 0); |
| 57 | 57 | if (std.SemanticVersion.parse(release)) |ver| { |
| ... | ... | @@ -257,10 +257,12 @@ fn detectAbiAndDynamicLinker( |
| 257 | 257 | ) DetectError!NativeTargetInfo { |
| 258 | 258 | const native_target_has_ld = comptime builtin.target.hasDynamicLinker(); |
| 259 | 259 | const is_linux = builtin.target.os.tag == .linux; |
| 260 | const is_solarish = builtin.target.os.tag.isSolarish(); | |
| 260 | 261 | const have_all_info = cross_target.dynamic_linker.get() != null and |
| 261 | 262 | cross_target.abi != null and (!is_linux or cross_target.abi.?.isGnu()); |
| 262 | 263 | const os_is_non_native = cross_target.os_tag != null; |
| 263 | if (!native_target_has_ld or have_all_info or os_is_non_native) { | |
| 264 | // The Solaris/illumos environment is always the same. | |
| 265 | if (!native_target_has_ld or have_all_info or os_is_non_native or is_solarish) { | |
| 264 | 266 | return defaultAbiAndDynamicLinker(cpu, os, cross_target); |
| 265 | 267 | } |
| 266 | 268 | if (cross_target.abi) |abi| { |
src/codegen/llvm.zig+2-2| ... | ... | @@ -120,7 +120,7 @@ pub fn targetTriple(allocator: Allocator, target: std.Target) ![]const u8 { |
| 120 | 120 | .lv2 => "lv2", |
| 121 | 121 | .netbsd => "netbsd", |
| 122 | 122 | .openbsd => "openbsd", |
| 123 | .solaris => "solaris", | |
| 123 | .solaris, .illumos => "solaris", | |
| 124 | 124 | .windows => "windows", |
| 125 | 125 | .zos => "zos", |
| 126 | 126 | .haiku => "haiku", |
| ... | ... | @@ -231,7 +231,7 @@ pub fn targetOs(os_tag: std.Target.Os.Tag) llvm.OSType { |
| 231 | 231 | .macos => .MacOSX, |
| 232 | 232 | .netbsd => .NetBSD, |
| 233 | 233 | .openbsd => .OpenBSD, |
| 234 | .solaris => .Solaris, | |
| 234 | .solaris, .illumos => .Solaris, | |
| 235 | 235 | .zos => .ZOS, |
| 236 | 236 | .haiku => .Haiku, |
| 237 | 237 | .minix => .Minix, |
src/crash_report.zig+1-1| ... | ... | @@ -190,7 +190,7 @@ fn handleSegfaultPosix(sig: i32, info: *const os.siginfo_t, ctx_ptr: ?*const any |
| 190 | 190 | .freebsd, .macos => @intFromPtr(info.addr), |
| 191 | 191 | .netbsd => @intFromPtr(info.info.reason.fault.addr), |
| 192 | 192 | .openbsd => @intFromPtr(info.data.fault.addr), |
| 193 | .solaris => @intFromPtr(info.reason.fault.addr), | |
| 193 | .solaris, .illumos => @intFromPtr(info.reason.fault.addr), | |
| 194 | 194 | else => @compileError("TODO implement handleSegfaultPosix for new POSIX OS"), |
| 195 | 195 | }; |
| 196 | 196 |
src/libc_installation.zig+5-1| ... | ... | @@ -213,11 +213,15 @@ pub const LibCInstallation = struct { |
| 213 | 213 | try self.findNativeIncludeDirPosix(args); |
| 214 | 214 | try self.findNativeCrtBeginDirHaiku(args); |
| 215 | 215 | self.crt_dir = try args.allocator.dupeZ(u8, "/system/develop/lib"); |
| 216 | } else if (builtin.target.os.tag.isSolarish()) { | |
| 217 | // There is only one libc, and its headers/libraries are always in the same spot. | |
| 218 | self.include_dir = try args.allocator.dupeZ(u8, "/usr/include"); | |
| 219 | self.sys_include_dir = try args.allocator.dupeZ(u8, "/usr/include"); | |
| 220 | self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"); | |
| 216 | 221 | } else if (std.process.can_spawn) { |
| 217 | 222 | try self.findNativeIncludeDirPosix(args); |
| 218 | 223 | switch (builtin.target.os.tag) { |
| 219 | 224 | .freebsd, .netbsd, .openbsd, .dragonfly => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib"), |
| 220 | .solaris => self.crt_dir = try args.allocator.dupeZ(u8, "/usr/lib/64"), | |
| 221 | 225 | .linux => try self.findNativeCrtDirPosix(args), |
| 222 | 226 | else => {}, |
| 223 | 227 | } |
src/libcxx.zig+1-1| ... | ... | @@ -150,7 +150,7 @@ pub fn buildLibCXX(comp: *Compilation, prog_node: *std.Progress.Node) !void { |
| 150 | 150 | |
| 151 | 151 | if (std.mem.startsWith(u8, cxx_src, "src/support/win32/") and target.os.tag != .windows) |
| 152 | 152 | continue; |
| 153 | if (std.mem.startsWith(u8, cxx_src, "src/support/solaris/") and target.os.tag != .solaris) | |
| 153 | if (std.mem.startsWith(u8, cxx_src, "src/support/solaris/") and !target.os.tag.isSolarish()) | |
| 154 | 154 | continue; |
| 155 | 155 | if (std.mem.startsWith(u8, cxx_src, "src/support/ibm/") and target.os.tag != .zos) |
| 156 | 156 | continue; |
src/link/Elf.zig+1-1| ... | ... | @@ -3818,7 +3818,7 @@ const CsuObjects = struct { |
| 3818 | 3818 | .static_pie => result.set( "start_dyn.o", "crti.o", "crtbeginS.o", "crtendS.o", "crtn.o" ), |
| 3819 | 3819 | // zig fmt: on |
| 3820 | 3820 | }, |
| 3821 | .solaris => switch (mode) { | |
| 3821 | .solaris, .illumos => switch (mode) { | |
| 3822 | 3822 | // zig fmt: off |
| 3823 | 3823 | .dynamic_lib => result.set( null, "crti.o", null, null, "crtn.o" ), |
| 3824 | 3824 | .dynamic_exe, |
src/target.zig+2-2| ... | ... | @@ -218,7 +218,7 @@ pub fn hasValgrindSupport(target: std.Target) bool { |
| 218 | 218 | .aarch64_32, |
| 219 | 219 | .aarch64_be, |
| 220 | 220 | => { |
| 221 | return target.os.tag == .linux or target.os.tag == .solaris or | |
| 221 | return target.os.tag == .linux or target.os.tag == .solaris or target.os.tag == .illumos or | |
| 222 | 222 | (target.os.tag == .windows and target.abi != .msvc); |
| 223 | 223 | }, |
| 224 | 224 | else => return false, |
| ... | ... | @@ -493,7 +493,7 @@ pub fn libcFullLinkFlags(target: std.Target) []const []const u8 { |
| 493 | 493 | "-lc", |
| 494 | 494 | "-lutil", |
| 495 | 495 | }, |
| 496 | .solaris => &[_][]const u8{ | |
| 496 | .solaris, .illumos => &[_][]const u8{ | |
| 497 | 497 | "-lm", |
| 498 | 498 | "-lsocket", |
| 499 | 499 | "-lnsl", |