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:
authorThomas Schwinge <thomas@codesourcery.com>2023-11-06 18:48:20 +0300
committerThomas Schwinge <thomas@codesourcery.com>2023-12-23 12:26:58 +0300
commit1a177610d8e181d09206a5a8ce2d873822751657 (patch)
treeb8acfbb9fc34d5c495fecf8a61d214c4575a377a /newlib/libc
parent1df8f9f09b0999e04bc0bbd7170ac7dbfa278213 (diff)
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'".
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/machine/amdgcn/Makefile.inc2
-rw-r--r--newlib/libc/machine/amdgcn/_exit.c (renamed from newlib/libc/machine/amdgcn/exit.c)4
-rw-r--r--newlib/libc/machine/amdgcn/atexit.c3
3 files changed, 4 insertions, 5 deletions
diff --git a/newlib/libc/machine/amdgcn/Makefile.inc b/newlib/libc/machine/amdgcn/Makefile.inc
index d26603aa8..e1fc5ae4d 100644
--- a/newlib/libc/machine/amdgcn/Makefile.inc
+++ b/newlib/libc/machine/amdgcn/Makefile.inc
@@ -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 \
diff --git a/newlib/libc/machine/amdgcn/exit.c b/newlib/libc/machine/amdgcn/_exit.c
index bdd532edd..82171aff9 100644
--- a/newlib/libc/machine/amdgcn/exit.c
+++ b/newlib/libc/machine/amdgcn/_exit.c
@@ -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);
}
diff --git a/newlib/libc/machine/amdgcn/atexit.c b/newlib/libc/machine/amdgcn/atexit.c
index 674571435..8ddd92cfa 100644
--- a/newlib/libc/machine/amdgcn/atexit.c
+++ b/newlib/libc/machine/amdgcn/atexit.c
@@ -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;
}