2015-12-15 09:47:39 +00:00
|
|
|
use "std.zig";
|
2015-12-10 22:34:38 +00:00
|
|
|
|
2016-01-04 10:31:57 +00:00
|
|
|
// The compiler treats this file special by implicitly importing the function `main`
|
|
|
|
// from the root source file.
|
|
|
|
|
2015-12-10 22:34:38 +00:00
|
|
|
#attribute("naked")
|
|
|
|
export fn _start() -> unreachable {
|
2015-12-23 22:49:34 +00:00
|
|
|
const argc = asm("mov (%%rsp), %[argc]" : [argc] "=r" (-> isize));
|
|
|
|
const argv = asm("lea 0x8(%%rsp), %[argv]" : [argv] "=r" (-> &&u8));
|
|
|
|
const env = asm("lea 0x10(%%rsp,%%rdi,8), %[env]" : [env] "=r" (-> &&u8));
|
2015-12-15 09:47:39 +00:00
|
|
|
exit(main(argc, argv, env))
|
2015-12-10 22:34:38 +00:00
|
|
|
}
|