From 995e91e84760855da7935afe51d44f99f95284c7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 28 Jun 2018 08:21:44 +0200 Subject: 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 53f97b0731..4af153fa2f 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 87e61f1ec9..508f0c83b2 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 9201c55607..31e1a3de49 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 -- cgit v1.2.3