[rtems commit] riscv: Fix global construction
Sebastian Huber
sebh at rtems.org
Fri Jun 29 10:01:10 UTC 2018
Module: rtems
Branch: master
Commit: 995e91e84760855da7935afe51d44f99f95284c7
Changeset: http://git.rtems.org/rtems/commit/?id=995e91e84760855da7935afe51d44f99f95284c7
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Thu Jun 28 08:21:44 2018 +0200
riscv: Fix global construction
Update #3433.
---
cpukit/libcsupport/src/newlibc_exit.c | 2 +-
cpukit/score/cpu/riscv/cpu.c | 9 +++++----
cpukit/score/src/threadhandler.c | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/cpukit/libcsupport/src/newlibc_exit.c b/cpukit/libcsupport/src/newlibc_exit.c
index 53f97b0..4af153f 100644
--- a/cpukit/libcsupport/src/newlibc_exit.c
+++ b/cpukit/libcsupport/src/newlibc_exit.c
@@ -20,7 +20,7 @@
/* FIXME: These defines are a blatant hack */
#if defined(__USE_INIT_FINI__)
- #if defined(__ARM_EABI__)
+ #if defined(__ARM_EABI__) || defined(__riscv)
#define FINI_SYMBOL __libc_fini_array
#else
#define FINI_SYMBOL _fini
diff --git a/cpukit/score/cpu/riscv/cpu.c b/cpukit/score/cpu/riscv/cpu.c
index 87e61f1..508f0c8 100644
--- a/cpukit/score/cpu/riscv/cpu.c
+++ b/cpukit/score/cpu/riscv/cpu.c
@@ -97,14 +97,15 @@ RTEMS_STATIC_ASSERT(
*/
extern char bsp_start_vector_table_begin[];
-void init(void);
-void fini(void);
+void _init(void);
-void _init()
+void _fini(void);
+
+void _init(void)
{
}
-void _fini()
+void _fini(void)
{
}
diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c
index 9201c55..31e1a3d 100644
--- a/cpukit/score/src/threadhandler.c
+++ b/cpukit/score/src/threadhandler.c
@@ -29,7 +29,7 @@
* initialization this target and compiler version uses.
*/
#if defined(__USE_INIT_FINI__)
- #if defined(__ARM_EABI__)
+ #if defined(__ARM_EABI__) || defined(__riscv)
#define INIT_NAME __libc_init_array
#else
#define INIT_NAME _init
More information about the vc
mailing list