Patch acadia support with stubs.

This commit is contained in:
Drew Galbraith 2023-06-20 21:08:20 -07:00
parent 6604db8b80
commit 6723b58e3d
6 changed files with 48 additions and 1 deletions

2
config.sub vendored
View File

@ -1695,7 +1695,7 @@ case $os in
# Now accept the basic system types.
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
gnu* | acadia* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
| *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
| hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
| sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \

View File

@ -419,6 +419,9 @@ fi
# THIS TABLE IS ALPHA SORTED. KEEP IT THAT WAY.
case "${host}" in
*-*-acadia*)
sys_dir=acadia
;;
*-*-cygwin*)
posix_dir=posix
xdr_dir=xdr

View File

@ -1,6 +1,9 @@
if HAVE_LIBC_SYS_A29KHIF_DIR
include %D%/a29khif/Makefile.inc
endif
if HAVE_LIBC_SYS_ACADIA_DIR
include %D%/acadia/Makefile.inc
endif
if HAVE_LIBC_SYS_AMDGCN_DIR
include %D%/amdgcn/Makefile.inc
endif

View File

@ -0,0 +1 @@
libc_a_SOURCES += syscalls.c crt0.c

View File

@ -0,0 +1,11 @@
#include <fcntl.h>
extern void exit(int code);
extern int main();
extern void _init_signal();
void _start() {
_init_signal();
int ex = main();
exit(ex);
}

View File

@ -0,0 +1,29 @@
#include <stdio.h>
#include <sys/errno.h>
#include <sys/fcntl.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/times.h>
#include <sys/types.h>
void _exit();
int close(int file) { return ENOSYS; }
char **environ; /* pointer to array of char * strings that define the current
environment variables */
int execve(char *name, char **argv, char **env) { return ENOSYS; }
int fork() { return ENOSYS; }
int fstat(int file, struct stat *st) { return ENOSYS; }
int getpid() { return ENOSYS; }
int isatty(int file) { return ENOSYS; }
int kill(int pid, int sig) { return ENOSYS; }
int link(char *old, char *new_l) { return ENOSYS; }
int lseek(int file, int ptr, int dir) { return ENOSYS; }
int open(const char *name, int flags, ...) { return ENOSYS; }
int read(int file, char *ptr, int len) { return ENOSYS; }
caddr_t sbrk(int incr) { return 0; }
int stat(const char *file, struct stat *st) { return ENOSYS; }
clock_t times(struct tms *buf) { return ENOSYS; }
int unlink(char *name) { return ENOSYS; }
int wait(int *status) { return ENOSYS; }
int write(int file, char *ptr, int len) { return ENOSYS; }
int gettimeofday(struct timeval *p, struct timezone *z) { return ENOSYS; }