2018-04-14 03:42:37 +08:00
|
|
|
## Process this file with automake to generate Makefile.in
|
|
|
|
|
2022-02-14 13:52:55 +08:00
|
|
|
AM_CPPFLAGS = $(NEWLIB_CFLAGS) $(TARGET_CFLAGS)
|
2018-04-14 03:42:37 +08:00
|
|
|
|
2021-12-31 03:26:52 +08:00
|
|
|
AM_CCASFLAGS = $(AM_CPPFLAGS)
|
2018-04-14 03:42:37 +08:00
|
|
|
|
|
|
|
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 \
|
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.
2021-08-25 00:24:19 +08:00
|
|
|
exit.c misc.c clock.c
|
2018-04-14 03:42:37 +08:00
|
|
|
lib_a_CFLAGS = $(AM_CFLAGS)
|