-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial arm64 support #1429
Merged
Merged
initial arm64 support #1429
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d956d30
this is not arch-specific
shawnl 4a8c992
os: use less syscalls
shawnl 342cff2
initial arm64 support
shawnl f8808ed
simplify f64_min to equivilent value
shawnl cba0d76
clone() on arm64
shawnl fdeb876
use vfork in stage1 compiler to avoid OOM
shawnl 7d6d1d1
NaNs do not have signedness.
shawnl 17cb69c
fix elf auxv handling
shawnl 2d27341
arm64: respond to code review
shawnl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -633,16 +633,21 @@ fn posixExecveErrnoToErr(err: usize) PosixExecveError { | |
}; | ||
} | ||
|
||
pub var linux_aux_raw = []usize{0} ** 38; | ||
pub var linux_elf_aux_maybe: ?[*]std.elf.Auxv = null; | ||
pub var posix_environ_raw: [][*]u8 = undefined; | ||
|
||
/// See std.elf for the constants. | ||
pub fn linuxGetAuxVal(index: usize) usize { | ||
if (builtin.link_libc) { | ||
return usize(std.c.getauxval(index)); | ||
} else { | ||
return linux_aux_raw[index]; | ||
} else if (linux_elf_aux_maybe) |auxv| { | ||
var i: usize = 0; | ||
while (auxv[i].a_type != std.elf.AT_NULL) : (i += 1) { | ||
if (auxv[i].a_type == index) | ||
return auxv[i].a_un.a_val; | ||
} | ||
} | ||
return 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should this return null, and make the return ?usize There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The libc version doesn't distinguish, so the zig-native version matches the API. |
||
} | ||
|
||
pub fn getBaseAddress() usize { | ||
|
@@ -1641,7 +1646,7 @@ pub const Dir = struct { | |
} | ||
|
||
while (true) { | ||
const result = posix.getdents(self.handle.fd, self.handle.buf.ptr, self.handle.buf.len); | ||
const result = posix.getdents64(self.handle.fd, self.handle.buf.ptr, self.handle.buf.len); | ||
const err = posix.getErrno(result); | ||
if (err > 0) { | ||
switch (err) { | ||
|
@@ -1659,7 +1664,7 @@ pub const Dir = struct { | |
break; | ||
} | ||
} | ||
const linux_entry = @ptrCast(*align(1) posix.dirent, &self.handle.buf[self.handle.index]); | ||
const linux_entry = @ptrCast(*align(1) posix.dirent64, &self.handle.buf[self.handle.index]); | ||
const next_index = self.handle.index + linux_entry.d_reclen; | ||
self.handle.index = next_index; | ||
|
||
|
@@ -1670,8 +1675,7 @@ pub const Dir = struct { | |
continue :start_over; | ||
} | ||
|
||
const type_char = self.handle.buf[next_index - 1]; | ||
const entry_kind = switch (type_char) { | ||
const entry_kind = switch (linux_entry.d_type) { | ||
posix.DT_BLK => Entry.Kind.BlockDevice, | ||
posix.DT_CHR => Entry.Kind.CharacterDevice, | ||
posix.DT_DIR => Entry.Kind.Directory, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you disable this test only for ARM?
if (builtin.arch ...