diff --git a/config.sub b/config.sub index 63c1f1c8b..b10902c7c 100755 --- a/config.sub +++ b/config.sub @@ -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* \ diff --git a/newlib/configure.host b/newlib/configure.host index 5f427526d..1d49e7d8d 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -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 diff --git a/newlib/libc/sys/Makefile.inc b/newlib/libc/sys/Makefile.inc index 9f8758934..5d34a8f97 100644 --- a/newlib/libc/sys/Makefile.inc +++ b/newlib/libc/sys/Makefile.inc @@ -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 diff --git a/newlib/libc/sys/acadia/Makefile.inc b/newlib/libc/sys/acadia/Makefile.inc new file mode 100644 index 000000000..d0fbf7fb9 --- /dev/null +++ b/newlib/libc/sys/acadia/Makefile.inc @@ -0,0 +1 @@ +libc_a_SOURCES += syscalls.c crt0.c diff --git a/newlib/libc/sys/acadia/crt0.c b/newlib/libc/sys/acadia/crt0.c new file mode 100644 index 000000000..25cb8c296 --- /dev/null +++ b/newlib/libc/sys/acadia/crt0.c @@ -0,0 +1,11 @@ +#include + +extern void exit(int code); +extern int main(); +extern void _init_signal(); + +void _start() { + _init_signal(); + int ex = main(); + exit(ex); +} diff --git a/newlib/libc/sys/acadia/syscalls.c b/newlib/libc/sys/acadia/syscalls.c new file mode 100644 index 000000000..f45ebbf88 --- /dev/null +++ b/newlib/libc/sys/acadia/syscalls.c @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include +#include +#include + +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; }