MIPS(64) HardFP With Newlib Unknown Operation Addsf3 (and others...)
segaloco via Gcc-help <[email protected]> Mon, 16 Mar 2026 04:15:55 +0000
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <ZnP-8uZwin7imRDhDerj6-OzC7GDfuHTl9j7oX-5vMLqTZT7cLBZMTeERFX4SxrxEeiab4_fFDh6DgUv9IIpeWmMXlN6v5SdvLgHev4xbjA=@protonmail.com> |
Hopefully the title gets all the relevant points. I'm building some
cross-compilers lately, which have gone well until MIPS and MIPS64. In
both the case of mipsel-unknown-elf and mips64-unknown-elf, I find
myself getting the following build error in libgcc:
../../../../libgcc/config/hardfp.c:61:2: error: #error Unknown operation
61 | #error Unknown operation
| ^~~~~
Brought about by:
/usr/local/src/gcc-15.2.0/build/./gcc/xgcc -B/usr/local/src/gcc-15.2.0/build/./gcc/ -B/usr/local/mips64-unknown-elf/bin/ -B/usr/local/mips64-unknown-elf/lib/el/ -isystem /usr/local/mips64-unknown-elf/include -isystem /usr/local/mips64-unknown-elf/sys-include -g -O2 -EL -O2 -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-error=narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -G 0 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -G 0 -I. -I. -I../../.././gcc -I../../../../libgcc -I../../../../libgcc/. -I../../../../libgcc/../gcc -I../../../../libgcc/../include -DHAVE_CC_TLS -o addsf3.o -MT addsf3.o -MD -MP -MF addsf3.dep addsf3 -c ../../../../libgcc/config/hardfp.c -fvisibility=hidden -DHIDE_EXPORTS -Wno-missing-prototypes
Which happens eventually in a build started with:
../configure --target=<target> --without-headers --with-newlib --enable-languages=c --disable-libatomic --disable-libgomp --disable-libquadmath --disable-libvtv --disable-libssp --disable-libstdcxx --disable-threads --disable-shared --with-system-zlib
This has worked fine on top of an appropriate GNU binutils for all
other targets I've built. If I try to add jobs to the make (-j4) then
I see other such libgcc math operations trying to compile. These
problems only arise on the hardfp multilib parts of libgcc. I've tried
a build with "-msoft-float" added to C(XX)FLAGS as well as using
--disable-multilib to perhaps only get one of the software floating
point variants. Neither did this, and the only way I managed to build
libgcc at one point was to manually tweak things to omit the hardfp
multilibs. This still was not very stable. Some other system details:
Host Arch: x86_64
Kernel: Darwin 25.3.0 (Tahoe 26.3)
Host C Compiler: Apple Clang 17.0.0
Cross Assembler/Linker: GNU binutils 2.46.0
Happy to provide further info, but the above configuration appears to
crash out consistently for me. I'll probably be trying this on a
GCC platform at some point. If it winds up being an llvm-ism, I could
try and build yet another cross-compiler on one of the other boxen to
spit out a Mach-O for macOS....
Thanks for any help!
- Matt G.