riscv – RISC-V GCC missing mm_malloc.h

I downloaded RISC-V cross compilers on a x86 Ubuntu following the instructions:

github.com/riscv-collab/riscv-gnu-toolchain

I’m trying to compile code that compiles fine in the native GCC installation version 9.4, but in RISC-V’s GCC version 12.2 it can’t find mm_malloc.h:

/home/user/risc-v/riscv-gnu-toolchain/gcc/gcc/config/i386/xmmintrin.h:34:10: fatal error: mm_malloc.h: No such file or directory
34 | #include <mm_malloc.h>
| ^~~~~~~~~~~~~
compilation terminated.
In file included from /home/user/risc-v/riscv-gnu-toolchain/gcc/gcc/config/i386/emmintrin.h:31,
from /home/user/risc-v/riscv-gnu-toolchain/gcc/gcc/config/i386/pmmintrin.h:31,
from /home/user/risc-v/riscv-gnu-toolchain/gcc/gcc/config/i386/tmmintrin.h:31,
from /home/user/risc-v/riscv-gnu-toolchain/gcc/gcc/config/i386/smmintrin.h:32,
from ../src/Main.hpp:38,
from src/TriSolve.hpp:4,
from src/TriSolve.cpp:1:

Line 38 of Main.hpp is:

#include <smmintrin.h>

It seems something is missing in RISC-V GNU setup, or there is a version mismatch. Any ideas would be great. Thanks in advance.

I tried compiling with the latest RISC-V GNU toolchain, both G++ and GCC, with the same parameters. The result I explain above. I expected a successful compilation and a RISC-V binary.

Read more here: Source link