Allow Zig programs to implement their own startup (_start) for ELF executables.

/home/shawn/git/zig-simd/build/lib/zig/std/special/start.zig:23:40: error: exported symbol collision: '_start'
        @export("_start", _start, .Strong);
        ^
/home/shawn/git/zig-simd/build/d.zig:1:1: note: other symbol is here
pub export fn _start() void {
^
/home/shawn/git/zig-simd/build/lib/zig/std/special/start.zig:124:35: error: root source file has no member called 'main'
    switch (@typeInfo(@typeOf(root.main).ReturnType)) {
This commit is contained in:
Shawn Landden 2019-07-28 18:18:35 -05:00 committed by Andrew Kelley
parent 7ebb7ca580
commit c9937f4a2b

View File

@ -23,7 +23,7 @@ comptime {
} else if (builtin.os == .uefi) {
@export("EfiMain", EfiMain, .Strong);
} else {
@export("_start", _start, .Strong);
if (!@hasDecl(root, "_start")) @export("_start", _start, .Strong);
}
}