Get TEST_LIBC_CALLS passing on AARCH64

This commit is contained in:
Justine Tunney 2023-05-13 02:41:41 -07:00
parent 802e7eb4ef
commit ba49e86e20
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
22 changed files with 65 additions and 7 deletions

View file

@ -64,9 +64,12 @@ int raise(int sig) {
if (sig == SIGTRAP) {
DebugBreak();
rc = 0;
#ifndef __aarch64__
} else if (sig == SIGFPE) {
// TODO(jart): Why doesn't AARCH64 raise SIGFPE?
RaiseSigFpe();
rc = 0;
#endif
} else if (!IsWindows() && !IsMetal()) {
rc = sys_tkill(gettid(), sig, 0);
} else {

View file

@ -96,10 +96,12 @@ static const struct sock_filter kUnveilBlacklistLatestAbi[] = {
};
static int landlock_abi_version;
static int landlock_abi_errno;
__attribute__((__constructor__)) void init_landlock_version() {
landlock_abi_version =
landlock_create_ruleset(0, 0, LANDLOCK_CREATE_RULESET_VERSION);
landlock_abi_errno = errno;
}
/**
@ -153,6 +155,7 @@ static int unveil_init(void) {
int rc, fd;
State.fs_mask = UNVEIL_READ | UNVEIL_WRITE | UNVEIL_EXEC | UNVEIL_CREATE;
if (landlock_abi_version == -1) {
errno = landlock_abi_errno;
if (errno == EOPNOTSUPP) {
errno = ENOSYS;
}