| author | |
| committer | |
| log | dfd7b7f2337d84ce660253a37079489f7780b055 |
| tree | f66bd79c031553c05c159f1e0fc3b1d3e21cc821 |
| parent | 92bc619c49fb4b7281bdc1c3c0bc3e41a9d20d4d |
There is approximately zero chance of the Zig team ever spending any effort on
supporting Cygwin; the MSVC and MinGW-w64 ABIs are superior in every way that
matters, and not least because they lead to binaries that just run natively on
Windows without needing a POSIX emulation environment installed.7 files changed, 9 insertions(+), 27 deletions(-)
lib/compiler/aro/aro/Compilation.zig+2-9| ... | ... | @@ -292,16 +292,9 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void { |
| 292 | 292 | } |
| 293 | 293 | try define(w, "__MSVCRT__"); |
| 294 | 294 | try define(w, "__MINGW32__"); |
| 295 | } else if (comp.target.abi == .cygnus) { | |
| 296 | try define(w, "__CYGWIN__"); | |
| 297 | if (ptr_width == 64) { | |
| 298 | try define(w, "__CYGWIN64__"); | |
| 299 | } else { | |
| 300 | try define(w, "__CYGWIN32__"); | |
| 301 | } | |
| 302 | 295 | } |
| 303 | 296 | |
| 304 | if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { | |
| 297 | if (comp.target.abi.isGnu()) { | |
| 305 | 298 | // MinGW and Cygwin define __declspec(a) to __attribute((a)). |
| 306 | 299 | // Like Clang we make the define no op if -fdeclspec is enabled. |
| 307 | 300 | if (comp.langopts.declspec_attrs) { |
| ... | ... | @@ -370,7 +363,7 @@ fn generateSystemDefines(comp: *Compilation, w: *Io.Writer) !void { |
| 370 | 363 | .ps4, |
| 371 | 364 | .ps5, |
| 372 | 365 | => try defineStd(w, "unix", is_gnu), |
| 373 | .windows => if (comp.target.abi.isGnu() or comp.target.abi == .cygnus) { | |
| 366 | .windows => if (comp.target.abi.isGnu()) { | |
| 374 | 367 | try defineStd(w, "unix", is_gnu); |
| 375 | 368 | }, |
| 376 | 369 | else => {}, |
lib/compiler/aro/aro/target.zig+1-2| ... | ... | @@ -375,7 +375,7 @@ pub fn isWindowsMSVCEnvironment(target: std.Target) bool { |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | pub fn isCygwinMinGW(target: std.Target) bool { |
| 378 | return target.os.tag == .windows and (target.abi == .gnu or target.abi == .cygnus); | |
| 378 | return target.os.tag == .windows and (target.abi == .gnu); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | pub fn isPS(target: std.Target) bool { |
| ... | ... | @@ -727,7 +727,6 @@ pub fn toLLVMTriple(target: std.Target, buf: []u8) []const u8 { |
| 727 | 727 | .muslx32 => "muslx32", |
| 728 | 728 | .msvc => "msvc", |
| 729 | 729 | .itanium => "itanium", |
| 730 | .cygnus => "cygnus", | |
| 731 | 730 | .simulator => "simulator", |
| 732 | 731 | .macabi => "macabi", |
| 733 | 732 | .ohos => "ohos", |
lib/std/Target.zig+5-9| ... | ... | @@ -758,7 +758,6 @@ pub const Abi = enum { |
| 758 | 758 | muslx32, |
| 759 | 759 | msvc, |
| 760 | 760 | itanium, |
| 761 | cygnus, | |
| 762 | 761 | simulator, |
| 763 | 762 | macabi, |
| 764 | 763 | ohos, |
| ... | ... | @@ -3208,7 +3207,7 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3208 | 3207 | .long, .ulong => return 32, |
| 3209 | 3208 | .longlong, .ulonglong, .double => return 64, |
| 3210 | 3209 | .longdouble => switch (target.abi) { |
| 3211 | .gnu, .ilp32, .cygnus => return 80, | |
| 3210 | .gnu, .ilp32 => return 80, | |
| 3212 | 3211 | else => return 64, |
| 3213 | 3212 | }, |
| 3214 | 3213 | }, |
| ... | ... | @@ -3216,13 +3215,10 @@ pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3216 | 3215 | .char => return 8, |
| 3217 | 3216 | .short, .ushort => return 16, |
| 3218 | 3217 | .int, .uint, .float => return 32, |
| 3219 | .long, .ulong => switch (target.abi) { | |
| 3220 | .cygnus => return 64, | |
| 3221 | else => return 32, | |
| 3222 | }, | |
| 3218 | .long, .ulong => return 32, | |
| 3223 | 3219 | .longlong, .ulonglong, .double => return 64, |
| 3224 | 3220 | .longdouble => switch (target.abi) { |
| 3225 | .gnu, .ilp32, .cygnus => return 80, | |
| 3221 | .gnu, .ilp32 => return 80, | |
| 3226 | 3222 | else => return 64, |
| 3227 | 3223 | }, |
| 3228 | 3224 | }, |
| ... | ... | @@ -3331,7 +3327,7 @@ pub fn cTypeAlignment(target: *const Target, c_type: CType) u16 { |
| 3331 | 3327 | .windows, .uefi => switch (c_type) { |
| 3332 | 3328 | .longlong, .ulonglong, .double => return 8, |
| 3333 | 3329 | .longdouble => switch (target.abi) { |
| 3334 | .gnu, .ilp32, .cygnus => return 4, | |
| 3330 | .gnu, .ilp32 => return 4, | |
| 3335 | 3331 | else => return 8, |
| 3336 | 3332 | }, |
| 3337 | 3333 | else => {}, |
| ... | ... | @@ -3438,7 +3434,7 @@ pub fn cTypePreferredAlignment(target: *const Target, c_type: CType) u16 { |
| 3438 | 3434 | .x86 => switch (target.os.tag) { |
| 3439 | 3435 | .windows, .uefi => switch (c_type) { |
| 3440 | 3436 | .longdouble => switch (target.abi) { |
| 3441 | .gnu, .ilp32, .cygnus => return 4, | |
| 3437 | .gnu, .ilp32 => return 4, | |
| 3442 | 3438 | else => return 8, |
| 3443 | 3439 | }, |
| 3444 | 3440 | else => {}, |
lib/std/zig/LibCDirs.zig-1| ... | ... | @@ -262,7 +262,6 @@ fn libCGenericName(target: *const std.Target) [:0]const u8 { |
| 262 | 262 | .androideabi, |
| 263 | 263 | .msvc, |
| 264 | 264 | .itanium, |
| 265 | .cygnus, | |
| 266 | 265 | .simulator, |
| 267 | 266 | .macabi, |
| 268 | 267 | => unreachable, |
src/codegen/llvm.zig-2| ... | ... | @@ -295,7 +295,6 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8 |
| 295 | 295 | .muslx32 => "muslx32", |
| 296 | 296 | .msvc => "msvc", |
| 297 | 297 | .itanium => "itanium", |
| 298 | .cygnus => "cygnus", | |
| 299 | 298 | .simulator => "simulator", |
| 300 | 299 | .macabi => "macabi", |
| 301 | 300 | .ohos, .ohoseabi => "ohos", |
| ... | ... | @@ -420,7 +419,6 @@ pub fn dataLayout(target: *const std.Target) []const u8 { |
| 420 | 419 | .sparc64 => "E-m:e-i64:64-i128:128-n32:64-S128", |
| 421 | 420 | .s390x => "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64", |
| 422 | 421 | .x86 => if (target.os.tag == .windows or target.os.tag == .uefi) switch (target.abi) { |
| 423 | .cygnus => "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32", | |
| 424 | 422 | .gnu => if (target.ofmt == .coff) |
| 425 | 423 | "e-m:x-p:32:32-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:32-n8:16:32-a:0:32-S32" |
| 426 | 424 | else |
src/target.zig+1-2| ... | ... | @@ -63,7 +63,7 @@ pub fn supports_fpic(target: *const std.Target) bool { |
| 63 | 63 | return switch (target.os.tag) { |
| 64 | 64 | .windows, |
| 65 | 65 | .uefi, |
| 66 | => target.abi == .gnu or target.abi == .cygnus, | |
| 66 | => target.abi == .gnu, | |
| 67 | 67 | else => true, |
| 68 | 68 | }; |
| 69 | 69 | } |
| ... | ... | @@ -93,7 +93,6 @@ pub fn useEmulatedTls(target: *const std.Target) bool { |
| 93 | 93 | if (target.abi.isOpenHarmony()) return true; |
| 94 | 94 | return switch (target.os.tag) { |
| 95 | 95 | .openbsd => true, |
| 96 | .windows => target.abi == .cygnus, | |
| 97 | 96 | else => false, |
| 98 | 97 | }; |
| 99 | 98 | } |
test/llvm_targets.zig-2| ... | ... | @@ -299,7 +299,6 @@ const targets = [_]std.Target.Query{ |
| 299 | 299 | .{ .cpu_arch = .x86, .os_tag = .openbsd, .abi = .none }, |
| 300 | 300 | .{ .cpu_arch = .x86, .os_tag = .rtems, .abi = .none }, |
| 301 | 301 | .{ .cpu_arch = .x86, .os_tag = .uefi, .abi = .none }, |
| 302 | .{ .cpu_arch = .x86, .os_tag = .windows, .abi = .cygnus }, | |
| 303 | 302 | .{ .cpu_arch = .x86, .os_tag = .windows, .abi = .gnu }, |
| 304 | 303 | .{ .cpu_arch = .x86, .os_tag = .windows, .abi = .itanium }, |
| 305 | 304 | .{ .cpu_arch = .x86, .os_tag = .windows, .abi = .msvc }, |
| ... | ... | @@ -333,7 +332,6 @@ const targets = [_]std.Target.Query{ |
| 333 | 332 | .{ .cpu_arch = .x86_64, .os_tag = .rtems, .abi = .none }, |
| 334 | 333 | .{ .cpu_arch = .x86_64, .os_tag = .serenity, .abi = .none }, |
| 335 | 334 | .{ .cpu_arch = .x86_64, .os_tag = .uefi, .abi = .none }, |
| 336 | .{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .cygnus }, | |
| 337 | 335 | .{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .gnu }, |
| 338 | 336 | .{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .itanium }, |
| 339 | 337 | .{ .cpu_arch = .x86_64, .os_tag = .windows, .abi = .msvc }, |