aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-04 14:42:18 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-12-04 14:42:40 -0500
commit10e172b1d77619469653b0521d8f65604fa549c7 (patch)
tree28ab1c6f77f8cd51483ff1f58ce2c1a2b942675a /lib/std
parent44e896f613b8fa9b74e3fa992b265d8a5f052aad (diff)
downloadzig-10e172b1d77619469653b0521d8f65604fa549c7.tar.gz
zig-10e172b1d77619469653b0521d8f65604fa549c7.zip
add `other` OS and fix regression in build-exe for freestanding
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/special/start.zig14
-rw-r--r--lib/std/target.zig2
2 files changed, 10 insertions, 6 deletions
diff --git a/lib/std/special/start.zig b/lib/std/special/start.zig
index a93b01c290..9c24e38137 100644
--- a/lib/std/special/start.zig
+++ b/lib/std/special/start.zig
@@ -32,14 +32,16 @@ comptime {
if (!@hasDecl(root, "WinMain") and !@hasDecl(root, "WinMainCRTStartup")) {
@export("WinMainCRTStartup", WinMainCRTStartup, .Strong);
}
- } else if (is_wasm and builtin.os == .freestanding) {
- if (!@hasDecl(root, "_start")) @export("_start", wasm_freestanding_start, .Strong);
} else if (builtin.os == .uefi) {
if (!@hasDecl(root, "EfiMain")) @export("EfiMain", EfiMain, .Strong);
- } else if (is_mips) {
- if (!@hasDecl(root, "__start")) @export("__start", _start, .Strong);
- } else {
- if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong);
+ } else if (builtin.os != .freestanding) {
+ if (is_mips) {
+ if (!@hasDecl(root, "__start")) @export("__start", _start, .Strong);
+ } else {
+ if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong);
+ }
+ } else if (is_wasm) {
+ if (!@hasDecl(root, "_start")) @export("_start", wasm_freestanding_start, .Strong);
}
}
}
diff --git a/lib/std/target.zig b/lib/std/target.zig
index cdabf7448d..e4beea4552 100644
--- a/lib/std/target.zig
+++ b/lib/std/target.zig
@@ -46,6 +46,7 @@ pub const Target = union(enum) {
wasi,
emscripten,
uefi,
+ other,
};
pub const Arch = union(enum) {
@@ -432,6 +433,7 @@ pub const Target = union(enum) {
.contiki,
.amdpal,
.hermit,
+ .other,
=> return .eabi,
.openbsd,
.macosx,