| author | |
| committer | |
| log | 8219c86100b9679255ad06bf6a743716bef26102 |
| tree | 9462d2c68a8c73c2c0fb87fdd87a11b5933c647e |
| parent | 3210dc4b006cd8718e5fee5530ad4383b0230959 |
Reviewed-on: https://codeberg.org/ziglang/zig/pulls/359545 files changed, 26 insertions(+), 4 deletions(-)
lib/std/Build/Configuration.zig+3| ... | ... | @@ -2635,6 +2635,7 @@ pub const TargetQuery = struct { |
| 2635 | 2635 | opengl, |
| 2636 | 2636 | vulkan, |
| 2637 | 2637 | tios, |
| 2638 | ashetos, | |
| 2638 | 2639 | |
| 2639 | 2640 | default, |
| 2640 | 2641 | |
| ... | ... | @@ -2685,6 +2686,7 @@ pub const TargetQuery = struct { |
| 2685 | 2686 | .opengl => .opengl, |
| 2686 | 2687 | .vulkan => .vulkan, |
| 2687 | 2688 | .tios => .tios, |
| 2689 | .ashetos => .ashetos, | |
| 2688 | 2690 | }; |
| 2689 | 2691 | } |
| 2690 | 2692 | |
| ... | ... | @@ -2735,6 +2737,7 @@ pub const TargetQuery = struct { |
| 2735 | 2737 | .opengl => .opengl, |
| 2736 | 2738 | .vulkan => .vulkan, |
| 2737 | 2739 | .tios => .tios, |
| 2740 | .ashetos => .ashetos, | |
| 2738 | 2741 | |
| 2739 | 2742 | .default => null, |
| 2740 | 2743 | }; |
lib/std/Target.zig+15-1| ... | ... | @@ -72,6 +72,8 @@ pub const Os = struct { |
| 72 | 72 | |
| 73 | 73 | tios, |
| 74 | 74 | |
| 75 | ashetos, | |
| 76 | ||
| 75 | 77 | // LLVM tags deliberately omitted: |
| 76 | 78 | // - bridgeos |
| 77 | 79 | // - cheriotrtos |
| ... | ... | @@ -175,6 +177,8 @@ pub const Os = struct { |
| 175 | 177 | .emscripten, |
| 176 | 178 | |
| 177 | 179 | .mesa3d, |
| 180 | ||
| 181 | .ashetos, | |
| 178 | 182 | => .none, |
| 179 | 183 | |
| 180 | 184 | .contiki, |
| ... | ... | @@ -412,6 +416,8 @@ pub const Os = struct { |
| 412 | 416 | .emscripten, |
| 413 | 417 | |
| 414 | 418 | .mesa3d, |
| 419 | ||
| 420 | .ashetos, | |
| 415 | 421 | => .{ .none = {} }, |
| 416 | 422 | |
| 417 | 423 | .contiki => .{ |
| ... | ... | @@ -957,6 +963,8 @@ pub const Abi = enum { |
| 957 | 963 | .vita => .eabihf, |
| 958 | 964 | .wasi, .emscripten => .musl, |
| 959 | 965 | |
| 966 | .ashetos => .eabi, | |
| 967 | ||
| 960 | 968 | .contiki, |
| 961 | 969 | .hermit, |
| 962 | 970 | .illumos, |
| ... | ... | @@ -2321,6 +2329,7 @@ pub fn requiresLibC(target: *const Target) bool { |
| 2321 | 2329 | .@"3ds", |
| 2322 | 2330 | .tios, |
| 2323 | 2331 | .wiiu, |
| 2332 | .ashetos, | |
| 2324 | 2333 | => false, |
| 2325 | 2334 | }; |
| 2326 | 2335 | } |
| ... | ... | @@ -2489,6 +2498,7 @@ pub const DynamicLinker = struct { |
| 2489 | 2498 | .vita, |
| 2490 | 2499 | |
| 2491 | 2500 | .tios, |
| 2501 | .ashetos, | |
| 2492 | 2502 | => .none, |
| 2493 | 2503 | }; |
| 2494 | 2504 | } |
| ... | ... | @@ -2910,6 +2920,7 @@ pub const DynamicLinker = struct { |
| 2910 | 2920 | .vulkan, |
| 2911 | 2921 | |
| 2912 | 2922 | .tios, |
| 2923 | .ashetos, | |
| 2913 | 2924 | => none, |
| 2914 | 2925 | |
| 2915 | 2926 | // TODO go over each item in this list and either move it to the above list, or |
| ... | ... | @@ -3174,7 +3185,10 @@ pub fn cTypeByteSize(t: *const Target, c_type: CType) u16 { |
| 3174 | 3185 | |
| 3175 | 3186 | pub fn cTypeBitSize(target: *const Target, c_type: CType) u16 { |
| 3176 | 3187 | switch (target.os.tag) { |
| 3177 | .freestanding, .other => switch (target.cpu.arch) { | |
| 3188 | .freestanding, | |
| 3189 | .other, | |
| 3190 | .ashetos, | |
| 3191 | => switch (target.cpu.arch) { | |
| 3178 | 3192 | .msp430, |
| 3179 | 3193 | .x86_16, |
| 3180 | 3194 | => switch (c_type) { |
src/Compilation/Config.zig+1-3| ... | ... | @@ -453,9 +453,7 @@ pub fn resolve(options: Options) ResolveError!Config { |
| 453 | 453 | |
| 454 | 454 | const pie = b: { |
| 455 | 455 | switch (options.output_mode) { |
| 456 | .Exe => if (target.os.tag == .fuchsia or | |
| 457 | (target.abi.isAndroid() and link_mode == .dynamic)) | |
| 458 | { | |
| 456 | .Exe => if (target_util.requiresPie(target, link_mode)) { | |
| 459 | 457 | if (options.pie == false) return error.TargetRequiresPie; |
| 460 | 458 | break :b true; |
| 461 | 459 | }, |
src/codegen/llvm.zig+1| ... | ... | @@ -251,6 +251,7 @@ pub fn targetTriple(allocator: Allocator, target: *const std.Target) ![]const u8 |
| 251 | 251 | .vita, |
| 252 | 252 | .tios, |
| 253 | 253 | .wiiu, |
| 254 | .ashetos, | |
| 254 | 255 | => "unknown", |
| 255 | 256 | }; |
| 256 | 257 | try llvm_triple.appendSlice(llvm_os); |
src/target.zig+6| ... | ... | @@ -61,6 +61,12 @@ pub fn libCxxNeedsLibUnwind(target: *const std.Target) bool { |
| 61 | 61 | }; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | pub fn requiresPie(target: *const std.Target, link_mode: std.lang.LinkMode) bool { | |
| 65 | return target.os.tag == .fuchsia or | |
| 66 | (target.abi.isAndroid() and link_mode == .dynamic) or | |
| 67 | target.os.tag == .ashetos; | |
| 68 | } | |
| 69 | ||
| 64 | 70 | /// This function returns whether non-pic code is completely invalid on the given target. |
| 65 | 71 | pub fn requiresPic(target: *const std.Target, linking_libc: bool) bool { |
| 66 | 72 | return ((target.os.tag == .windows or target.os.tag == .uefi) and (target.cpu.arch == .aarch64 or target.cpu.arch == .x86_64)) or |