diff --git a/newlib/configure.host b/newlib/configure.host index 4ac5334..ef481ff 100644 --- a/newlib/configure.host +++ b/newlib/configure.host @@ -289,7 +289,7 @@ case "${host_cpu}" in ;; nvptx*) machine_dir=nvptx - newlib_cflags="${newlib_cflags} -DMALLOC_PROVIDED" + newlib_cflags="${newlib_cflags} -DCLOCK_PROVIDED -DMALLOC_PROVIDED" ;; or1k*|or1knd*) machine_dir=or1k diff --git a/newlib/libc/machine/nvptx/Makefile.am b/newlib/libc/machine/nvptx/Makefile.am index 66664d3..0cb20cc 100644 --- a/newlib/libc/machine/nvptx/Makefile.am +++ b/newlib/libc/machine/nvptx/Makefile.am @@ -10,7 +10,7 @@ noinst_LIBRARIES = lib.a lib_a_SOURCES = calloc.c callocr.c malloc.c mallocr.c realloc.c reallocr.c \ free.c write.c assert.c puts.c putchar.c printf.c abort.c \ - exit.c misc.c + exit.c misc.c clock.c lib_a_CFLAGS = $(AM_CFLAGS) ACLOCAL_AMFLAGS = -I ../../.. -I ../../../.. diff --git a/newlib/libc/machine/nvptx/misc.c b/newlib/libc/machine/nvptx/misc.c index ed1bc34..3609241 100644 --- a/newlib/libc/machine/nvptx/misc.c +++ b/newlib/libc/machine/nvptx/misc.c @@ -15,6 +15,7 @@ #include #include +#include #undef errno extern int errno; @@ -23,12 +24,37 @@ close(int fd) { return -1; } +int +fstat (int fd, struct stat *buf) { + return -1; +} + +int +isatty (int fd) { + return fd == 1; +} + off_t lseek(int fd, off_t offset, int whence) { return 0; } int +open (const char *pathname, int flags, ...) { + return -1; +} + +int read(int fd, void *buf, size_t count) { return 0; } + +void +sync (void) { +} + +int +unlink (const char *pathname) { + return -1; +} +