Skip to content

Commit 5e696c9

Browse files
authored
Merge pull request #57 from Mic92/aarch64-build
fix aarch64 build
2 parents 346c0c8 + a812f82 commit 5e696c9

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

garnix.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
builds:
2+
include:
3+
- '*.x86_64-linux.*'
4+
- '*.aarch64-linux.*'
5+
- nixosConfigurations.*

src/access.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#pragma once
2+
3+
#include <asm/unistd.h>
4+
5+
#define R_OK 4
6+
#define AT_FDCWD (-100)
7+
int access(const char *pathname, int mode) {
8+
return my_syscall4(__NR_faccessat, AT_FDCWD, (long)pathname, mode, 0);
9+
}

src/nix-ld.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44

55
#include <nolibc.h>
66

7-
#include "strerror.h"
87
#include <stdio.h>
98
#include <config.h>
109

10+
#include "strerror.h"
11+
#include "access.h"
12+
1113
#define alloca __builtin_alloca
1214

1315
static inline void closep(const int *fd) { close(*fd); }
@@ -387,10 +389,6 @@ static void* get_at_base(size_t *auxv) {
387389
return NULL;
388390
}
389391

390-
#define R_OK 4
391-
int access(const char *pathname, int mode) {
392-
return my_syscall2(__NR_access, (long)pathname, mode);
393-
}
394392

395393
int main(int argc, char** argv, char** envp) {
396394
size_t *auxv;

0 commit comments

Comments
 (0)