diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-10-06 00:11:39 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-06 00:11:39 -0400 |
| commit | d40c4e7c896c5dfed9dd35e8c0d2117f7cf5c53c (patch) | |
| tree | 07f7204287159ca5c9926e797144ef91ab35cdb6 /std/special/bootstrap.zig | |
| parent | 5b84192f07d5e4b3f5ebcd3e08d79852710c04f4 (diff) | |
| parent | 2d2734172484871eb56705e77acca50a8c83d8ae (diff) | |
| download | zig-d40c4e7c896c5dfed9dd35e8c0d2117f7cf5c53c.tar.gz zig-d40c4e7c896c5dfed9dd35e8c0d2117f7cf5c53c.zip | |
Merge pull request #1429 from shawnl/arm64
initial arm64 support
Diffstat (limited to 'std/special/bootstrap.zig')
| -rw-r--r-- | std/special/bootstrap.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/std/special/bootstrap.zig b/std/special/bootstrap.zig index 47b57c6c23..feaa04332b 100644 --- a/std/special/bootstrap.zig +++ b/std/special/bootstrap.zig @@ -30,6 +30,11 @@ nakedcc fn _start() noreturn { : [argc] "=r" (-> [*]usize) ); }, + builtin.Arch.aarch64v8 => { + argc_ptr = asm ("mov %[argc], sp" + : [argc] "=r" (-> [*]usize) + ); + }, else => @compileError("unsupported arch"), } // If LLVM inlines stack variables into _start, they will overwrite @@ -54,11 +59,8 @@ fn posixCallMainAndExit() noreturn { const envp = @ptrCast([*][*]u8, envp_optional)[0..envp_count]; if (builtin.os == builtin.Os.linux) { const auxv = @ptrCast([*]usize, envp.ptr + envp_count + 1); - var i: usize = 0; - while (auxv[i] != 0) : (i += 2) { - if (auxv[i] < std.os.linux_aux_raw.len) std.os.linux_aux_raw[auxv[i]] = auxv[i + 1]; - } - std.debug.assert(std.os.linux_aux_raw[std.elf.AT_PAGESZ] == std.os.page_size); + std.os.linux_elf_aux_maybe = @ptrCast([*]std.elf.Auxv, auxv); + std.debug.assert(std.os.linuxGetAuxVal(std.elf.AT_PAGESZ) == std.os.page_size); } std.os.posix.exit(callMainWithArgs(argc, argv, envp)); |
