There's a closed pull request on the void-packages repository [WIP][RFC] New package: cross-riscv64-none-elf https://github.com/void-linux/void-packages/pull/48614 Description: I am trying to package cross toolchain for bare metal risc-v targets and have some difficulties with building GCC. The build fails with a lot of errors while building `libgcc`: ``` /builddir/cross-riscv64-none-elf-gcc-13.2.0/build/./gcc/xgcc -B/builddir/cross-riscv64-none-elf-gcc-13.2.0/build/./gcc/ -B/usr/riscv64-none-elf/bin/ -B/usr/riscv64-none-elf/l ib/ -isystem /usr/riscv64-none-elf/include -isystem /usr/riscv64-none-elf/sys-include -g -Os -mcmodel=medany -ffunction-sections -fdata-sections -march=rv32i -mabi=ilp32 - O2 -g -Os -mcmodel=medany -ffunction-sections -fdata-sections -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem ./include -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc -I. -I. -I../../../.././gcc -I../../. ./../../libgcc -I../../../../../libgcc/. -I../../../../../libgcc/../gcc -I../../../../../libgcc/../include -DHAVE_CC_TLS -o _gcov_interval_profiler.o -MT _gcov_interval_pr ofiler.o -MD -MP -MF _gcov_interval_profiler.dep -DL_gcov_interval_profiler -c ../../../../../libgcc/libgcov-profiler.c In file included from ../../../../../libgcc/libgcov-merge.c:26: ../../../../../libgcc/libgcov.h:49:10: fatal error: sys/mman.h: No such file or directory 49 | #include | ^~~~~~~~~~~~ compilation terminated. make[4]: *** [Makefile:924: _gcov_merge_add.o] Error 1 ``` And the file is actually there: ``` find . -name mman.h ./masterdir-x86_64/usr/include/bits/mman.h ./masterdir-x86_64/usr/include/asm/mman.h ./masterdir-x86_64/usr/include/sys/mman.h ./masterdir-x86_64/usr/include/asm-generic/mman.h ./masterdir-x86_64/usr/include/linux/mman.h ./masterdir-x86_64/builddir/cross-riscv64-none-elf-gcc-13.2.0/fixincludes/tests/base/sys/mman.h ```` There is a workaround with patching `libgconv.h` and disabling `HAVE_SYS_MMAN_H` or using `--disable-gcov` configuration flag, but I don't think this is the right way to go. At the same time I could successfully manually build it from sources on host system with almost the same set of configuration flags except for those pointing to different system directories. It looks like I am missing one step to build the package, and I would appreciate any help. I can attach full configuration and build logs if it will be helpful.