cnlohr / ch32v003fun

Open source minimal stack for the ch32 line of WCH processors, including the ch32v003, a 10¢ 48 MHz RISC-V Microcontroller - as well as many other chips within the ch32v/x line.
MIT License
951 stars 146 forks source link

[Report] Wiki-Arch toolchain #378

Closed StewartBie closed 2 months ago

StewartBie commented 2 months ago

Refer to Wiki - Installation - Arch/Manjaro the AUR package riscv64-unknown-elf-newlib was last updated 2020-03-23 20:29 (UTC) so there are many obstacles to installing this AUR pac. Here are some errors when installing

../../../../../../../newlib-3.3.0/newlib/libc/reent/closer.c:47:14: error: implicit declaration of function '_close'; did you mean 'close'? [-Wimplicit-function-declaration]
   47 |   if ((ret = _close (fd)) == -1 && errno != 0)
      |              ^~~~~~
      |              close
make[8]: *** [Makefile:439: lib_a-closer.o] Error 1
......
../../../../../../../newlib-3.3.0/newlib/libc/syscalls/sysisatty.c:12:10: error: implicit declaration of function '_isatty'; did you mean 'isatty'? [-Wimplicit-function-declaration]
   12 |   return _isatty (fd);
      |          ^~~~~~~
      |          isatty
make[8]: *** [Makefile:416: lib_a-sysisatty.o] Error 1
make[8]: Leaving directory '/home/ze/.cache/yay/riscv64-unknown-elf-newlib/src/build-newlib/riscv64-unknown-elf/rv32i/ilp32/newlib/libc/syscalls'
Making all in ssp

I wonder whether these package can replace.(WCH MRS toolchain) image

TheComputerGuy96 commented 2 months ago

The attached image file is corrupted (according to pngcheck) :frog:

StewartBie commented 2 months ago
my bad. I'll try to show it in the table below. Name Version Votes Popularity? Description Maintainer Last Updated
mounriver-studio-toolchain-bin 1.91-0 4 0.00 This MRS Toolchain includes the tool chain for RISC-V kernel chip under Linux x64 and the debug download tool OpenOCD. taotieren 2024-04-21 09:17 (UTC)
mounriver-studio-toolchain-openocd-bin 1.91-0 4 0.00 MRS Toolchain OpenOCD supports erasure, programming, verification and debugging of the chip. taotieren 2024-04-21 09:17 (UTC)
mounriver-studio-toolchain-riscv-gcc-bin 1.91-0 4 0.00 MRS Toolchain Support for RISC-V assembly and GNU C compilation, link operation. taotieren 2024-04-21 09:17 (UTC)
mounriver-studio-toolchain-riscv-gcc12-bin 1.91-0 4 0.00 MRS Toolchain Support for RISC-V assembly and GNU C compilation, link operation. taotieren 2024-04-21 09:17 (UTC)

This package dedends on the three others mounriver-studio-toolchain-bin Thanks for your reply. ^.^

TommyMurphyTM1234 commented 2 months ago

I'm not sure that I fully understand the original issue but if the problem is getting a working (and maybe more up to date?) RISC-V bare metal toolchain for use on Arch Linux then would the xPack binary toolchain builds be of any use?

The only dependency that the Linux builds should have is on a minimum GLIBC version (>= 2.27 right now):

Bear in mind that the xPack toolchain uses a different tool prefix string than the riscv-gnu-toolchain one - riscv-none-elf-* versus riscv64-unknown-elf-* or riscv32-unknown-elf-*:

TommyMurphyTM1234 commented 2 months ago

FWIW I did a quick install of a VirtualBox VM running Arch Linux 2024.08.01, downloaded and extracted the latest xPack RISC-V GCC (14.2.0-1) and using it I was able to compile and link a simple "Hello world" program.

doragasu commented 2 months ago

As an Arch user (BTW), I have two suggestions:

  1. Report problems with AUR packages to the specific AUR package page. In this case: https://aur.archlinux.org/packages/riscv64-unknown-elf-newlib
  2. Do not install AUR packages when there is a better alternative on the official repos. I have the following packages installed and the toolchain works perfect: riscv64-elf-binutils riscv64-elf-gcc riscv64-elf-gdb riscv64-elf-newlib.
StewartBie commented 2 months ago

Thanks for all your replies. My problems are solved.

  1. I know that xpack is another standalone toolchain and it works
  2. There is a better choice on the official repos riscv64-elf-binutils riscv64-elf-gcc riscv64-elf-gdb riscv64-elf-newlib
  3. I'll keep in mind all your seggestions. ^.^

I think it's time to close this issues. Thanks a lot.