From b415588677d0581e637e745545612793130a347f Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Fri, 9 Aug 2019 13:03:49 +0200 Subject: [PATCH] cpu/mips32r2: remove nomips16 attribute from _mips_handle_exception MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A note says "The nomips16 attribute should not really be needed, it works around a toolchain issue in 2016.05-03." In fact, in 2018.09-03, the attribute leads to this error: ```cpu/mips32r2_common/thread_arch.c:191:1: error: ‘_mips_handle_exception’ redeclared with conflicting ‘nomips16’ attributes``` This this commit removes the attribute. --- cpu/mips32r2_common/thread_arch.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cpu/mips32r2_common/thread_arch.c b/cpu/mips32r2_common/thread_arch.c index 4fae163d803f..e13e799de29c 100644 --- a/cpu/mips32r2_common/thread_arch.c +++ b/cpu/mips32r2_common/thread_arch.c @@ -182,11 +182,21 @@ mem_rw(const void *vaddr) extern int _dsp_save(struct dspctx *ctx); extern int _dsp_load(struct dspctx *ctx); #endif + /* - * The nomips16 attribute should not really be needed, it works around a toolchain - * issue in 2016.05-03. + * The official mips toolchain version 2016.05-03 needs this attribute. + * Newer versions (>=2017.10-05) don't. Those started being based on gcc 6, + * thus use that to guard the attribute. + * + * See https://github.com/RIOT-OS/RIOT/pull/11986. */ +#if __GNUC__ <= 4 void __attribute__((nomips16)) +#else +void +#endif + +/* note return type from above #ifdef */ _mips_handle_exception(struct gpctx *ctx, int exception) { unsigned int syscall_num = 0;