| author | |
| committer | |
| log | 10e172b1d77619469653b0521d8f65604fa549c7 |
| tree | 28ab1c6f77f8cd51483ff1f58ce2c1a2b942675a |
| parent | 44e896f613b8fa9b74e3fa992b265d8a5f052aad |
| signature |
5 files changed, 21 insertions(+), 8 deletions(-)
lib/std/special/start.zig+8-6| ... | ... | @@ -32,14 +32,16 @@ comptime { |
| 32 | 32 | if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup")) { |
| 33 | 33 | @export("WinMainCRTStartup", WinMainCRTStartup, .Strong); |
| 34 | 34 | } |
| 35 | } else if (is_wasm and builtin.os == .freestanding) { | |
| 36 | if (!@hasDecl(root, "_start")) @export("_start", wasm_freestanding_start, .Strong); | |
| 37 | 35 | } else if (builtin.os == .uefi) { |
| 38 | 36 | if (!@hasDecl(root, "EfiMain")) @export("EfiMain", EfiMain, .Strong); |
| 39 | } else if (is_mips) { | |
| 40 | if (!@hasDecl(root, "__start")) @export("__start", _start, .Strong); | |
| 41 | } else { | |
| 42 | if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong); | |
| 37 | } else if (builtin.os != .freestanding) { | |
| 38 | if (is_mips) { | |
| 39 | if (!@hasDecl(root, "__start")) @export("__start", _start, .Strong); | |
| 40 | } else { | |
| 41 | if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong); | |
| 42 | } | |
| 43 | } else if (is_wasm) { | |
| 44 | if (!@hasDecl(root, "_start")) @export("_start", wasm_freestanding_start, .Strong); | |
| 43 | 45 | } |
| 44 | 46 | } |
| 45 | 47 | } |
lib/std/target.zig+2| ... | ... | @@ -46,6 +46,7 @@ pub const Target = union(enum) { |
| 46 | 46 | wasi, |
| 47 | 47 | emscripten, |
| 48 | 48 | uefi, |
| 49 | other, | |
| 49 | 50 | }; |
| 50 | 51 | |
| 51 | 52 | pub const Arch = union(enum) { |
| ... | ... | @@ -432,6 +433,7 @@ pub const Target = union(enum) { |
| 432 | 433 | .contiki, |
| 433 | 434 | .amdpal, |
| 434 | 435 | .hermit, |
| 436 | .other, | |
| 435 | 437 | => return .eabi, |
| 436 | 438 | .openbsd, |
| 437 | 439 | .macosx, |
src-self-hosted/c_int.zig+1-1| ... | ... | @@ -71,7 +71,7 @@ pub const CInt = struct { |
| 71 | 71 | pub fn sizeInBits(cint: CInt, self: Target) u32 { |
| 72 | 72 | const arch = self.getArch(); |
| 73 | 73 | switch (self.getOs()) { |
| 74 | .freestanding => switch (self.getArch()) { | |
| 74 | .freestanding, .other => switch (self.getArch()) { | |
| 75 | 75 | .msp430 => switch (cint.id) { |
| 76 | 76 | .Short, |
| 77 | 77 | .UShort, |
src/target.cpp+9-1| ... | ... | @@ -180,6 +180,7 @@ static const Os os_list[] = { |
| 180 | 180 | OsWASI, |
| 181 | 181 | OsEmscripten, |
| 182 | 182 | OsUefi, |
| 183 | OsOther, | |
| 183 | 184 | }; |
| 184 | 185 | |
| 185 | 186 | // Coordinate with zig_llvm.h |
| ... | ... | @@ -268,6 +269,7 @@ Os target_os_enum(size_t index) { |
| 268 | 269 | ZigLLVM_OSType get_llvm_os_type(Os os_type) { |
| 269 | 270 | switch (os_type) { |
| 270 | 271 | case OsFreestanding: |
| 272 | case OsOther: | |
| 271 | 273 | return ZigLLVM_UnknownOS; |
| 272 | 274 | case OsAnanas: |
| 273 | 275 | return ZigLLVM_Ananas; |
| ... | ... | @@ -425,6 +427,8 @@ const char *target_os_name(Os os_type) { |
| 425 | 427 | return "freestanding"; |
| 426 | 428 | case OsUefi: |
| 427 | 429 | return "uefi"; |
| 430 | case OsOther: | |
| 431 | return "other"; | |
| 428 | 432 | case OsAnanas: |
| 429 | 433 | case OsCloudABI: |
| 430 | 434 | case OsDragonFly: |
| ... | ... | @@ -1005,6 +1009,7 @@ uint32_t target_arch_largest_atomic_bits(ZigLLVM_ArchType arch) { |
| 1005 | 1009 | uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) { |
| 1006 | 1010 | switch (target->os) { |
| 1007 | 1011 | case OsFreestanding: |
| 1012 | case OsOther: | |
| 1008 | 1013 | switch (target->arch) { |
| 1009 | 1014 | case ZigLLVM_msp430: |
| 1010 | 1015 | switch (id) { |
| ... | ... | @@ -1134,7 +1139,8 @@ bool target_allows_addr_zero(const ZigTarget *target) { |
| 1134 | 1139 | const char *target_o_file_ext(const ZigTarget *target) { |
| 1135 | 1140 | if (target->abi == ZigLLVM_MSVC || |
| 1136 | 1141 | (target->os == OsWindows && !target_abi_is_gnu(target->abi)) || |
| 1137 | target->os == OsUefi) { | |
| 1142 | target->os == OsUefi) | |
| 1143 | { | |
| 1138 | 1144 | return ".obj"; |
| 1139 | 1145 | } else { |
| 1140 | 1146 | return ".o"; |
| ... | ... | @@ -1376,6 +1382,7 @@ const char *target_dynamic_linker(const ZigTarget *target) { |
| 1376 | 1382 | case OsUefi: |
| 1377 | 1383 | case OsWindows: |
| 1378 | 1384 | case OsEmscripten: |
| 1385 | case OsOther: | |
| 1379 | 1386 | return nullptr; |
| 1380 | 1387 | |
| 1381 | 1388 | case OsAnanas: |
| ... | ... | @@ -1650,6 +1657,7 @@ ZigLLVM_EnvironmentType target_default_abi(ZigLLVM_ArchType arch, Os os) { |
| 1650 | 1657 | case OsContiki: |
| 1651 | 1658 | case OsAMDPAL: |
| 1652 | 1659 | case OsHermitCore: |
| 1660 | case OsOther: | |
| 1653 | 1661 | return ZigLLVM_EABI; |
| 1654 | 1662 | case OsOpenBSD: |
| 1655 | 1663 | case OsMacOSX: |
src/target.hpp+1| ... | ... | @@ -50,6 +50,7 @@ enum Os { |
| 50 | 50 | OsWASI, |
| 51 | 51 | OsEmscripten, |
| 52 | 52 | OsUefi, |
| 53 | OsOther, | |
| 53 | 54 | }; |
| 54 | 55 | |
| 55 | 56 | // Synchronize with target.cpp::subarch_list_list |