Compilation for mips-mti-elf fails

Marian Buschsieweke marian.buschsieweke@ovgu.de
Thu Nov 25 21:04:13 GMT 2021


Hi,

compiling for newlib with GCC 11.2.0 for mips-mti-elf with multilib
now fails with "Error: unrecognized opcode `cfc1 $3,$31'" while compiling
newlib/libm/machine/mips/fenv.c

More precisely, newlib/libc/machine/mips/machine/fenv-fp.h included by fenv.c
contains multiple calls of the function line macro __cfc1() which is defined in
newlib/libc/machine/mips/sys/fenv.h as

	#define __cfc1(__fcsr)  __asm __volatile("cfc1 %0, $31" : "=r" (__fcsr))

Apparently, this is not compatible with mips16. Adding -mno-mips16 to the
invocation of the compiler fixes the comiplation. (The same was already done for
cma101.c and cygmon.c in libgloss.)

Attached is a potential fix.

Kind regards,
Marian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-mips-mti-elf.patch
Type: text/x-patch
Size: 1420 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20211125/79174759/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 228 bytes
Desc: OpenPGP digital signature
URL: <https://sourceware.org/pipermail/newlib/attachments/20211125/79174759/attachment.sig>


More information about the Newlib mailing list