Compilation for mips-mti-elf fails

Jeff Johnston jjohnstn@redhat.com
Mon Nov 29 23:27:00 GMT 2021


Hi Marian,

Thanks for the patch.  That directory has a Makefile.am file so it must be
modified and the Makefile.in generated.
I have included a modified version of your patch.  If you have no
objections, I'll check it in.

Regards,

-- Jeff J.


On Thu, Nov 25, 2021 at 4:04 PM Marian Buschsieweke <
marian.buschsieweke@ovgu.de> wrote:

> 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: 0001-Modifying-patch-from-marian.buschsieweke-ovgu.de.patch
Type: text/x-patch
Size: 5011 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/newlib/attachments/20211129/00e9bac1/attachment.bin>


More information about the Newlib mailing list