Skip to content

Commit 16354af

Browse files
alexrpTibboddiT
authored andcommitted
remove all Oracle Solaris support
There is no straightforward way for the Zig team to access the Solaris system headers; to do this, one has to create an Oracle account, accept their EULA to download the installer ISO, and finally install it on a machine or VM. We do not have to jump through hoops like this for any other OS that we support, and no one on the team has expressed willingness to do it. As a result, we cannot audit any Solaris contributions to std.c or other similarly sensitive parts of the standard library. The best we would be able to do is assume that Solaris and illumos are 100% compatible with no way to verify that assumption. But at that point, the solaris and illumos OS tags would be functionally identical anyway. For Solaris especially, any contributions that involve APIs introduced after the OS was made closed-source would also be inherently more risky than equivalent contributions for other proprietary OSs due to the case of Google LLC v. Oracle America, Inc., wherein Oracle clearly demonstrated its willingness to pursue legal action against entities that merely copy API declarations. Finally, Oracle laid off most of the Solaris team in 2017; the OS has been in maintenance mode since, presumably to be retired completely sometime in the 2030s. For these reasons, this commit removes all Oracle Solaris support. Anyone who still wishes to use Zig on Solaris can try their luck by simply using illumos instead of solaris in target triples - chances are it'll work. But there will be no effort from the Zig team to support this use case; we recommend that people move to illumos instead.
1 parent 3fdff80 commit 16354af

37 files changed

+209
-308
lines changed

CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -738,17 +738,12 @@ string(TOLOWER "${CMAKE_HOST_SYSTEM_NAME}" ZIG_HOST_TARGET_OS)
738738
if(ZIG_HOST_TARGET_OS STREQUAL "darwin")
739739
set(ZIG_HOST_TARGET_OS "macos")
740740
elseif(ZIG_HOST_TARGET_OS STREQUAL "sunos")
741-
check_symbol_exists(__illumos__ "" ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO)
742-
if (ZIG_HOST_TARGET_HAS_ILLUMOS_MACRO)
743-
set(ZIG_HOST_TARGET_OS "illumos")
744-
else()
745-
set(ZIG_HOST_TARGET_OS "solaris")
746-
endif()
741+
set(ZIG_HOST_TARGET_OS "illumos")
747742
endif()
748743

749744
string(TOLOWER "${CMAKE_HOST_SYSTEM_PROCESSOR}" ZIG_HOST_TARGET_ARCH)
750745
if(ZIG_HOST_TARGET_ARCH MATCHES "^i[3-9]86$")
751-
if (ZIG_HOST_TARGET_OS MATCHES "(solaris|illumos)")
746+
if (ZIG_HOST_TARGET_OS STREQUAL "illumos")
752747
set(ZIG_HOST_TARGET_ARCH "x86_64")
753748
else()
754749
set(ZIG_HOST_TARGET_ARCH "x86")

build.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ fn addCmakeCfgOptionsToExe(
818818
try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
819819
if (static) try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
820820
},
821-
.solaris, .illumos => {
821+
.illumos => {
822822
try addCxxKnownPath(b, cfg, exe, b.fmt("libstdc++.{s}", .{lib_suffix}), null, need_cpp_includes);
823823
try addCxxKnownPath(b, cfg, exe, b.fmt("libgcc_eh.{s}", .{lib_suffix}), null, need_cpp_includes);
824824
},

lib/compiler/aro/aro/Compilation.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
337337
.netbsd => try define(w, "__NetBSD__"),
338338
.openbsd => try define(w, "__OpenBSD__"),
339339
.dragonfly => try define(w, "__DragonFly__"),
340-
.solaris => try defineStd(w, "sun", is_gnu),
340+
.illumos => try defineStd(w, "sun", is_gnu),
341341
.macos,
342342
.tvos,
343343
.ios,
@@ -361,7 +361,7 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
361361
.linux,
362362
.haiku,
363363
.hurd,
364-
.solaris,
364+
.illumos,
365365
.aix,
366366
.emscripten,
367367
.ps4,
@@ -618,15 +618,15 @@ fn generateSystemDefines(comp: *Compilation, w: *std.Io.Writer) !void {
618618
try defineStd(w, "sparc", is_gnu);
619619
try define(w, "__sparc_v9__");
620620
try define(w, "__arch64__");
621-
if (comp.target.os.tag != .solaris) {
621+
if (comp.target.os.tag != .illumos) {
622622
try define(w, "__sparc64__");
623623
try define(w, "__sparc_v9__");
624624
try define(w, "__sparcv9__");
625625
}
626626
},
627627
.sparc => {
628628
try defineStd(w, "sparc", is_gnu);
629-
if (comp.target.os.tag == .solaris) {
629+
if (comp.target.os.tag == .illumos) {
630630
try define(w, "__sparcv8");
631631
}
632632
},

lib/compiler/aro/aro/Toolchain.zig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ fn getUnwindLibKind(tc: *const Toolchain) !UnwindLibKind {
391391
}
392392
}
393393

394-
fn getAsNeededOption(is_solaris: bool, needed: bool) []const u8 {
395-
if (is_solaris) {
394+
fn getAsNeededOption(is_illumos: bool, needed: bool) []const u8 {
395+
if (is_illumos) {
396396
return if (needed) "-zignore" else "-zrecord";
397397
} else {
398398
return if (needed) "--as-needed" else "--no-as-needed";
@@ -412,7 +412,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
412412

413413
try argv.ensureUnusedCapacity(tc.driver.comp.gpa, 3);
414414
if (as_needed) {
415-
argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, true));
415+
argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, true));
416416
}
417417
switch (unw) {
418418
.none => return,
@@ -435,7 +435,7 @@ fn addUnwindLibrary(tc: *const Toolchain, argv: *std.ArrayList([]const u8)) !voi
435435
}
436436

437437
if (as_needed) {
438-
argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .solaris, false));
438+
argv.appendAssumeCapacity(getAsNeededOption(target.os.tag == .illumos, false));
439439
}
440440
}
441441

lib/compiler/aro/aro/target.zig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ pub fn systemCompiler(target: std.Target) LangOpts.Compiler {
252252
target.abi.isAndroid() or
253253
target.os.tag.isBSD() or
254254
target.os.tag == .fuchsia or
255-
target.os.tag == .solaris or
255+
target.os.tag == .illumos or
256256
target.os.tag == .haiku or
257257
target.cpu.arch == .hexagon)
258258
{
@@ -281,7 +281,7 @@ pub fn hasFloat128(target: std.Target) bool {
281281
.haiku,
282282
.linux,
283283
.openbsd,
284-
.solaris,
284+
.illumos,
285285
=> target.cpu.arch.isX86(),
286286
else => false,
287287
};
@@ -654,8 +654,7 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 {
654654
.ps3 => "lv2",
655655
.netbsd => "netbsd",
656656
.openbsd => "openbsd",
657-
.solaris => "solaris",
658-
.illumos => "illumos",
657+
.illumos => "solaris",
659658
.windows => "windows",
660659
.zos => "zos",
661660
.haiku => "haiku",
@@ -755,7 +754,7 @@ pub fn isPIEDefault(target: std.Target) DefaultPIStatus {
755754
.dragonfly,
756755
.netbsd,
757756
.freebsd,
758-
.solaris,
757+
.illumos,
759758

760759
.cuda,
761760
.amdhsa,
@@ -838,7 +837,7 @@ pub fn isPICdefault(target: std.Target) DefaultPIStatus {
838837
.openbsd,
839838
.netbsd,
840839
.freebsd,
841-
.solaris,
840+
.illumos,
842841
.hurd,
843842
=> {
844843
return switch (target.cpu.arch) {
@@ -897,7 +896,7 @@ pub fn isPICDefaultForced(target: std.Target) DefaultPIStatus {
897896
.openbsd,
898897
.netbsd,
899898
.freebsd,
900-
.solaris,
899+
.illumos,
901900
.cuda,
902901
.ps4,
903902
.ps5,

lib/std/Progress.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ fn handleSigWinch(sig: i32, info: *const posix.siginfo_t, ctx_ptr: ?*anyopaque)
15471547
const have_sigwinch = switch (builtin.os.tag) {
15481548
.linux,
15491549
.plan9,
1550-
.solaris,
1550+
.illumos,
15511551
.netbsd,
15521552
.openbsd,
15531553
.haiku,

lib/std/Target.zig

Lines changed: 15 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub const Os = struct {
2727
aix,
2828
haiku,
2929
hurd,
30+
illumos,
3031
linux,
3132
plan9,
3233
rtems,
@@ -45,9 +46,6 @@ pub const Os = struct {
4546
visionos,
4647
watchos,
4748

48-
illumos,
49-
solaris,
50-
5149
windows,
5250
uefi,
5351

@@ -98,10 +96,6 @@ pub const Os = struct {
9896
};
9997
}
10098

101-
pub inline fn isSolarish(tag: Tag) bool {
102-
return tag == .solaris or tag == .illumos;
103-
}
104-
10599
pub fn exeFileExt(tag: Tag, arch: Cpu.Arch) [:0]const u8 {
106100
return switch (tag) {
107101
.windows => ".exe",
@@ -163,11 +157,10 @@ pub const Os = struct {
163157
.managarm,
164158

165159
.haiku,
160+
.illumos,
166161
.plan9,
167162
.serenity,
168163

169-
.illumos,
170-
171164
.ps3,
172165
.ps4,
173166
.ps5,
@@ -197,8 +190,6 @@ pub const Os = struct {
197190
.visionos,
198191
.watchos,
199192

200-
.solaris,
201-
202193
.uefi,
203194

204195
.@"3ds",
@@ -395,11 +386,10 @@ pub const Os = struct {
395386
.managarm,
396387

397388
.haiku,
389+
.illumos,
398390
.plan9,
399391
.serenity,
400392

401-
.illumos,
402-
403393
.ps3,
404394
.ps4,
405395
.ps5,
@@ -597,13 +587,6 @@ pub const Os = struct {
597587
},
598588
},
599589

600-
.solaris => .{
601-
.semver = .{
602-
.min = .{ .major = 11, .minor = 0, .patch = 0 },
603-
.max = .{ .major = 11, .minor = 4, .patch = 0 },
604-
},
605-
},
606-
607590
.windows => .{
608591
.windows = .{
609592
.min = .win10,
@@ -930,15 +913,14 @@ pub const Abi = enum {
930913
.contiki,
931914
.fuchsia,
932915
.hermit,
916+
.illumos,
933917
.managarm,
934918
.plan9,
935919
.serenity,
936920
.zos,
937921
.dragonfly,
938922
.driverkit,
939923
.macos,
940-
.illumos,
941-
.solaris,
942924
.ps3,
943925
.ps4,
944926
.ps5,
@@ -2043,10 +2025,6 @@ pub const Cpu = struct {
20432025
else => &s390x.cpu.arch8,
20442026
},
20452027
.sparc => &sparc.cpu.v9, // glibc does not work with 'plain' v8.
2046-
.sparc64 => switch (os.tag) {
2047-
.solaris => &sparc.cpu.ultrasparc3,
2048-
else => generic(arch),
2049-
},
20502028
.x86 => &x86.cpu.pentium4,
20512029
.x86_64 => switch (os.tag) {
20522030
.driverkit => &x86.cpu.nehalem,
@@ -2175,6 +2153,7 @@ pub inline fn isWasiLibC(target: *const Target) bool {
21752153
pub fn requiresLibC(target: *const Target) bool {
21762154
return switch (target.os.tag) {
21772155
.aix,
2156+
.illumos,
21782157
.driverkit,
21792158
.macos,
21802159
.ios,
@@ -2184,8 +2163,6 @@ pub fn requiresLibC(target: *const Target) bool {
21842163
.dragonfly,
21852164
.openbsd,
21862165
.haiku,
2187-
.solaris,
2188-
.illumos,
21892166
.serenity,
21902167
=> true,
21912168

@@ -2332,6 +2309,7 @@ pub const DynamicLinker = struct {
23322309
.fuchsia,
23332310

23342311
.haiku,
2312+
.illumos,
23352313
.serenity,
23362314

23372315
.dragonfly,
@@ -2345,9 +2323,6 @@ pub const DynamicLinker = struct {
23452323
.tvos,
23462324
.visionos,
23472325
.watchos,
2348-
2349-
.illumos,
2350-
.solaris,
23512326
=> .arch_os,
23522327
.hurd,
23532328
.linux,
@@ -2439,6 +2414,14 @@ pub const DynamicLinker = struct {
24392414
else => none,
24402415
},
24412416

2417+
.illumos,
2418+
=> switch (cpu.arch) {
2419+
.x86,
2420+
.x86_64,
2421+
=> initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2422+
else => none,
2423+
},
2424+
24422425
.linux => if (abi.isAndroid())
24432426
switch (cpu.arch) {
24442427
.arm => if (abi == .androideabi) init("/system/bin/linker") else none,
@@ -2755,22 +2738,6 @@ pub const DynamicLinker = struct {
27552738
else => none,
27562739
},
27572740

2758-
.illumos,
2759-
=> switch (cpu.arch) {
2760-
.x86,
2761-
.x86_64,
2762-
=> initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2763-
else => none,
2764-
},
2765-
2766-
.solaris,
2767-
=> switch (cpu.arch) {
2768-
.sparc64,
2769-
.x86_64,
2770-
=> initFmt("/lib/{s}ld.so.1", .{if (ptrBitWidth_cpu_abi(cpu, .none) == 64) "64/" else ""}),
2771-
else => none,
2772-
},
2773-
27742741
// Operating systems in this list have been verified as not having a standard
27752742
// dynamic linker path.
27762743
.freestanding,
@@ -3134,6 +3101,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31343101
.aix,
31353102
.haiku,
31363103
.hurd,
3104+
.illumos,
31373105
.linux,
31383106
.plan9,
31393107
.rtems,
@@ -3145,9 +3113,6 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 {
31453113
.netbsd,
31463114
.openbsd,
31473115

3148-
.illumos,
3149-
.solaris,
3150-
31513116
.wasi,
31523117
.emscripten,
31533118
=> switch (target.cpu.arch) {

lib/std/Thread.zig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub const max_name_len = switch (native_os) {
120120
.freebsd => 15,
121121
.openbsd => 23,
122122
.dragonfly => 1023,
123-
.solaris, .illumos => 31,
123+
.illumos => 31,
124124
// https://github.com/SerenityOS/serenity/blob/6b4c300353da49d3508b5442cf61da70bd04d757/Kernel/Tasks/Thread.h#L102
125125
.serenity => 63,
126126
else => 0,
@@ -211,7 +211,7 @@ pub fn setName(self: Thread, name: []const u8) SetNameError!void {
211211
else => |e| return posix.unexpectedErrno(e),
212212
}
213213
},
214-
.netbsd, .solaris, .illumos => if (use_pthreads) {
214+
.netbsd, .illumos => if (use_pthreads) {
215215
const err = std.c.pthread_setname_np(self.getHandle(), name_with_terminator.ptr, null);
216216
switch (@as(posix.E, @enumFromInt(err))) {
217217
.SUCCESS => return,
@@ -324,7 +324,7 @@ pub fn getName(self: Thread, buffer_ptr: *[max_name_len:0]u8) GetNameError!?[]co
324324
else => |e| return posix.unexpectedErrno(e),
325325
}
326326
},
327-
.netbsd, .solaris, .illumos => if (use_pthreads) {
327+
.netbsd, .illumos => if (use_pthreads) {
328328
const err = std.c.pthread_getname_np(self.getHandle(), buffer.ptr, max_name_len + 1);
329329
switch (@as(posix.E, @enumFromInt(err))) {
330330
.SUCCESS => return std.mem.sliceTo(buffer, 0),
@@ -739,10 +739,10 @@ const PosixThreadImpl = struct {
739739
};
740740
return @as(usize, @intCast(count));
741741
},
742-
.solaris, .illumos, .serenity => {
742+
.illumos, .serenity => {
743743
// The "proper" way to get the cpu count would be to query
744744
// /dev/kstat via ioctls, and traverse a linked list for each
745-
// cpu. (solaris, illumos)
745+
// cpu. (illumos)
746746
const rc = c.sysconf(@intFromEnum(std.c._SC.NPROCESSORS_ONLN));
747747
return switch (posix.errno(rc)) {
748748
.SUCCESS => @as(usize, @intCast(rc)),

0 commit comments

Comments
 (0)