4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-19 12:59:21 +08:00

GCN: Implement '_exit' instead of 'exit'

... so that all of 'exit', '_exit', '_Exit' work.  'exit' thus becomes the
standard 'newlib/libc/stdlib/exit.c'.  (Getting 'atexit' functional needs
further work elsewhere.)

See also commit 5841b2f6a4208682264d03e3edfa0a09881932a6
"nvptx: Implement '_exit' instead of 'exit'".
This commit is contained in:
Thomas Schwinge 2023-11-06 16:48:20 +01:00
parent 1df8f9f09b
commit 1a177610d8
4 changed files with 24 additions and 25 deletions

View File

@ -630,8 +630,8 @@ check_PROGRAMS =
@HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/strrchr.S
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@am__append_67 = \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/_exit.c \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/abort.c \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/exit.c \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/atexit.c \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/mlock.c \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/getreent.c \
@ -1892,8 +1892,8 @@ am__objects_51 = libc/ssp/libc_a-chk_fail.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/libc_a-strnlen.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/libc_a-strrchr-stub.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AARCH64_TRUE@ libc/machine/aarch64/libc_a-strrchr.$(OBJEXT)
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@am__objects_78 = libc/machine/amdgcn/libc_a-abort.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/libc_a-exit.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@am__objects_78 = libc/machine/amdgcn/libc_a-_exit.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/libc_a-abort.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/libc_a-atexit.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/libc_a-mlock.$(OBJEXT) \
@HAVE_LIBC_MACHINE_AMDGCN_TRUE@ libc/machine/amdgcn/libc_a-getreent.$(OBJEXT) \
@ -8161,10 +8161,10 @@ libc/machine/amdgcn/$(am__dirstamp):
libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) libc/machine/amdgcn/$(DEPDIR)
@: > libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp)
libc/machine/amdgcn/libc_a-abort.$(OBJEXT): \
libc/machine/amdgcn/libc_a-_exit.$(OBJEXT): \
libc/machine/amdgcn/$(am__dirstamp) \
libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp)
libc/machine/amdgcn/libc_a-exit.$(OBJEXT): \
libc/machine/amdgcn/libc_a-abort.$(OBJEXT): \
libc/machine/amdgcn/$(am__dirstamp) \
libc/machine/amdgcn/$(DEPDIR)/$(am__dirstamp)
libc/machine/amdgcn/libc_a-atexit.$(OBJEXT): \
@ -12816,9 +12816,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/aarch64/$(DEPDIR)/libc_a-strnlen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/aarch64/$(DEPDIR)/libc_a-strrchr-stub.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/aarch64/$(DEPDIR)/libc_a-strrchr.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-abort.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-atexit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-getreent.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-mlock.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@libc/machine/amdgcn/$(DEPDIR)/libc_a-signal.Po@am__quote@
@ -33347,6 +33347,20 @@ libc/machine/aarch64/libc_a-strrchr-stub.obj: libc/machine/aarch64/strrchr-stub.
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/aarch64/libc_a-strrchr-stub.obj `if test -f 'libc/machine/aarch64/strrchr-stub.c'; then $(CYGPATH_W) 'libc/machine/aarch64/strrchr-stub.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/aarch64/strrchr-stub.c'; fi`
libc/machine/amdgcn/libc_a-_exit.o: libc/machine/amdgcn/_exit.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-_exit.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Tpo -c -o libc/machine/amdgcn/libc_a-_exit.o `test -f 'libc/machine/amdgcn/_exit.c' || echo '$(srcdir)/'`libc/machine/amdgcn/_exit.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/amdgcn/_exit.c' object='libc/machine/amdgcn/libc_a-_exit.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-_exit.o `test -f 'libc/machine/amdgcn/_exit.c' || echo '$(srcdir)/'`libc/machine/amdgcn/_exit.c
libc/machine/amdgcn/libc_a-_exit.obj: libc/machine/amdgcn/_exit.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-_exit.obj -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Tpo -c -o libc/machine/amdgcn/libc_a-_exit.obj `if test -f 'libc/machine/amdgcn/_exit.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/_exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/_exit.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-_exit.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/amdgcn/_exit.c' object='libc/machine/amdgcn/libc_a-_exit.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-_exit.obj `if test -f 'libc/machine/amdgcn/_exit.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/_exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/_exit.c'; fi`
libc/machine/amdgcn/libc_a-abort.o: libc/machine/amdgcn/abort.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-abort.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-abort.Tpo -c -o libc/machine/amdgcn/libc_a-abort.o `test -f 'libc/machine/amdgcn/abort.c' || echo '$(srcdir)/'`libc/machine/amdgcn/abort.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-abort.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-abort.Po
@ -33361,20 +33375,6 @@ libc/machine/amdgcn/libc_a-abort.obj: libc/machine/amdgcn/abort.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-abort.obj `if test -f 'libc/machine/amdgcn/abort.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/abort.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/abort.c'; fi`
libc/machine/amdgcn/libc_a-exit.o: libc/machine/amdgcn/exit.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-exit.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Tpo -c -o libc/machine/amdgcn/libc_a-exit.o `test -f 'libc/machine/amdgcn/exit.c' || echo '$(srcdir)/'`libc/machine/amdgcn/exit.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/amdgcn/exit.c' object='libc/machine/amdgcn/libc_a-exit.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-exit.o `test -f 'libc/machine/amdgcn/exit.c' || echo '$(srcdir)/'`libc/machine/amdgcn/exit.c
libc/machine/amdgcn/libc_a-exit.obj: libc/machine/amdgcn/exit.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-exit.obj -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Tpo -c -o libc/machine/amdgcn/libc_a-exit.obj `if test -f 'libc/machine/amdgcn/exit.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/exit.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-exit.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libc/machine/amdgcn/exit.c' object='libc/machine/amdgcn/libc_a-exit.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -c -o libc/machine/amdgcn/libc_a-exit.obj `if test -f 'libc/machine/amdgcn/exit.c'; then $(CYGPATH_W) 'libc/machine/amdgcn/exit.c'; else $(CYGPATH_W) '$(srcdir)/libc/machine/amdgcn/exit.c'; fi`
libc/machine/amdgcn/libc_a-atexit.o: libc/machine/amdgcn/atexit.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libc_a_CPPFLAGS) $(CPPFLAGS) $(libc_a_CFLAGS) $(CFLAGS) -MT libc/machine/amdgcn/libc_a-atexit.o -MD -MP -MF libc/machine/amdgcn/$(DEPDIR)/libc_a-atexit.Tpo -c -o libc/machine/amdgcn/libc_a-atexit.o `test -f 'libc/machine/amdgcn/atexit.c' || echo '$(srcdir)/'`libc/machine/amdgcn/atexit.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libc/machine/amdgcn/$(DEPDIR)/libc_a-atexit.Tpo libc/machine/amdgcn/$(DEPDIR)/libc_a-atexit.Po

View File

@ -1,6 +1,6 @@
libc_a_SOURCES += \
%D%/_exit.c \
%D%/abort.c \
%D%/exit.c \
%D%/atexit.c \
%D%/mlock.c \
%D%/getreent.c \

View File

@ -13,11 +13,11 @@
* they apply.
*/
#include <stdlib.h>
#include <unistd.h>
#include "exit-value.h"
void __attribute__((noreturn))
exit (int val)
_exit (int val)
{
exit_with_status_and_signal (val, 0);
}

View File

@ -18,8 +18,7 @@
int
atexit (void (*function)(void))
{
/* Our current implementation of exit does not run functions registered with
atexit, so fail here. */
/* Fail here. */
abort ();
return 1;
}