From 48dd7b8c2ef7056ff4730c378ccd7e9445b5e40f Mon Sep 17 00:00:00 2001 From: Kinsey Moore Date: Mon, 29 Jun 2020 14:35:08 -0500 Subject: score: Add CPU_USE_LIBC_INIT_FINI_ARRAY This introduces the CPU_USE_LIBC_INIT_FINI_ARRAY define for use by CPU ports to determine which global constructor and destructor methods are used instead of placing architecture defines where they shouldn't be. Close #4018 --- cpukit/score/src/threadhandler.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpukit/score/src/threadhandler.c') diff --git a/cpukit/score/src/threadhandler.c b/cpukit/score/src/threadhandler.c index acbe186a53..6742b0b391 100644 --- a/cpukit/score/src/threadhandler.c +++ b/cpukit/score/src/threadhandler.c @@ -28,9 +28,13 @@ * Conditional magic to determine what style of C++ constructor * initialization this target and compiler version uses. */ +RTEMS_STATIC_ASSERT( + CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE + || CPU_USE_LIBC_INIT_FINI_ARRAY == FALSE, + CPU_USE_LIBC_INIT_FINI_ARRAY +); #if defined(__USE_INIT_FINI__) - #if defined(__ARM_EABI__) || defined(__riscv) \ - || defined(__or1k__) || defined(__or1knd__) + #if CPU_USE_LIBC_INIT_FINI_ARRAY == TRUE #define INIT_NAME __libc_init_array #else #define INIT_NAME _init -- cgit v1.2.3