Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2021-08-24 19:24:19 +0300
committerCorinna Vinschen <corinna@vinschen.de>2021-08-25 11:20:27 +0300
commit6bb96d13a2d7f652b614850eb341905031101d32 (patch)
treec0619f4dbf59c8796a7d20b7992c4f2b1f2064c0 /newlib/configure.host
parent1a821390d11d3bc66e6858f27dceeef67e14078d (diff)
nvptx: Emulate clock and other machine stubs.
This patch to the libc/machine/nvptx port of newlib implements an approximation of "clock" and provides some additional stub routines. These changes not only reduce the number of (link) failures in the GCC testsuite when targeting nvptx-none, but also allow the NIST scimark4 benchmark to compile and run without modification. newlib already contains support for backends to provide their own clock implementations via -DCLOCK_PROVIDED. That functionality is used here to return an approximate elapsed time based on the NVidia GPU's clock64 cycle counter. Although not great, this is better than the current behaviour of link error from the unresolved symbol _times_r. The other part of the patch is to add a small number of stub functions to nvptx's misc.c. Adding isatty, for example, resolves linking problems in libc from the dependency in __smakebuf_r, and the sync stub, for example, fixes the failure with GCC's testsuite/gfortran.dg/ISO_Fortran_binding_14.f90 [which simply tests that gfortran can call a/any C function]. newlib/ configure.host: Add -DCLOCK_PROVIDED to newlib_cflags on nvptx*. newlib/libc/machine/nvptx Makefile.am: Add clock.c to lib_a_SOURCES. clock.c: New source file to implement/approximate clock(). misc.c: Add stubs for fstat, isatty, open, sync and unlink.
Diffstat (limited to 'newlib/configure.host')
-rw-r--r--newlib/configure.host2
1 files changed, 1 insertions, 1 deletions
diff --git a/newlib/configure.host b/newlib/configure.host
index 4ac53342a..ef481ff52 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