Hi guys,
I’m new to RISC-V and FreeRTOS, I am trying to follow the tutorial for creating a generic RISC-V project for FreeRTOS: RISC-V_RV32_QEMU_VIRT_GCC (as a new user I can’t post links )
I correctly compiled the 32-bit version but, unfortunately, could not compile the 64-bit version.
I have attached the error that I obtained below:
luca@Lenovo-V15-G3-ABA:~/FreeRTOS/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC$ make -C build/gcc/ RVA23=1
make: entering directory «/home/luca/FreeRTOS/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/build/gcc»
Using RVA23 build
--- Final linking ---
riscv64-unknown-elf-gcc ./output/tasks.o ./output/list.o ./output/queue.o ./output/timers.o ./output/event_groups.o ./output/stream_buffer.o ./output/heap_4.o ./output/port.o ./output/AbortDelay.o ./output/BlockQ.o ./output/blocktim.o ./output/countsem.o ./output/death.o ./output/dynamic.o ./output/EventGroupsDemo.o ./output/GenQTest.o ./output/integer.o ./output/IntSemTest.o ./output/MessageBufferAMP.o ./output/MessageBufferDemo.o ./output/PollQ.o ./output/QPeek.o ./output/QueueOverwrite.o ./output/QueueSet.o ./output/QueueSetPolling.o ./output/recmutex.o ./output/semtest.o ./output/StaticAllocation.o ./output/StreamBufferDemo.o ./output/StreamBufferInterrupt.o ./output/TaskNotify.o ./output/TaskNotifyArray.o ./output/TimerDemo.o ./output/main.o ./output/main_blinky.o ./output/main_full.o ./output/ns16550.o ./output/riscv-virt.o ./output/printf-stdarg.o ./output/portASM.o ./output/start.o ./output/RegTest.o ./output/vector.o -nostartfiles -Xlinker --gc-sections -Wl,-Map,./output/RTOSDemo.map -T./fake_rom.ld -march=rv64imafdc_zicsr_zicntr_zihpm_ziccif_ziccrse_ziccamoa_zicclsm_za64rs_zihintpause_zic64b_zicbom_zicbop_zicboz_zfhmin_zkt_zihintntl_zawrs -mabi=lp64d -mcmodel=medany -Xlinker --defsym=__stack_size=350 -Wl,--start-group -Wl,--end-group -Wl,--wrap=malloc -Wl,--wrap=free -Wl,--wrap=open -Wl,--wrap=lseek -Wl,--wrap=read -Wl,--wrap=write -Wl,--wrap=fstat -Wl,--wrap=stat -Wl,--wrap=close -Wl,--wrap=link -Wl,--wrap=unlink -Wl,--wrap=execve -Wl,--wrap=fork -Wl,--wrap=getpid -Wl,--wrap=kill -Wl,--wrap=wait -Wl,--wrap=isatty -Wl,--wrap=times -Wl,--wrap=sbrk -Wl,--wrap=puts -Wl,--wrap=_malloc -Wl,--wrap=_free -Wl,--wrap=_open -Wl,--wrap=_lseek -Wl,--wrap=_read -Wl,--wrap=_write -Wl,--wrap=_fstat -Wl,--wrap=_stat -Wl,--wrap=_close -Wl,--wrap=_link -Wl,--wrap=_unlink -Wl,--wrap=_execve -Wl,--wrap=_fork -Wl,--wrap=_getpid -Wl,--wrap=_kill -Wl,--wrap=_wait -Wl,--wrap=_isatty -Wl,--wrap=_times -Wl,--wrap=_sbrk -Wl,--wrap=__exit -Wl,--wrap=_puts -o ./output/RTOSDemo.elf
/home/luca/riscv-tools/lib/gcc/riscv64-unknown-elf/14.2.0/rv64imafdc/lp64d/libgcc.a(_clzsi2.o): in function `__clzdi2':
/home/luca/riscv-gnu-toolchain/build-gcc-newlib-stage2/riscv64-unknown-elf/rv64imafdc/lp64d/libgcc/../../../../.././gcc/libgcc/libgcc2.c:690:(.text+0x18): relocation truncated to fit: R_RISCV_HI20 against symbol `__clz_tab' defined in .rodata section in /home/luca/riscv-tools/lib/gcc/riscv64-unknown-elf/14.2.0/rv64imafdc/lp64d/libgcc.a(_clz.o)
collect2: error: ld returned 1 exit status
make: *** [Makefile:164: output/RTOSDemo.elf] Errore 1
make: exiting directory «/home/luca/FreeRTOS/FreeRTOS/Demo/RISC-V_RV32_QEMU_VIRT_GCC/build/gcc»
I followed the content of the readme file in that folder. Do you think there is a bug with this project? I saw that the 64-bit version was released one week ago…
I am using the self-built RISC-V toolchain downloaded from GitHub (again, I can’t put the link).
These are the details of my toolchain:
luca@Lenovo-V15-G3-ABA:~/riscv-tools$ riscv64-unknown-elf-gcc --version
riscv64-unknown-elf-gcc (g04696df096) 14.2.0
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
luca@Lenovo-V15-G3-ABA:~/riscv-tools$ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/home/luca/riscv-tools/libexec/gcc/riscv64-unknown-elf/14.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/luca/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-elf --prefix=/home/luca/riscv-tools --disable-shared --disable-threads --enable-languages=c,c++ --with-pkgversion=g04696df096 --with-system-zlib --enable-tls --with-newlib --with-sysroot=/home/luca/riscv-tools/riscv64-unknown-elf --with-native-system-header-dir=/include --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-tm-clone-registry --src=.././gcc --enable-multilib --with-abi=lp64d --with-arch=rv64gc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-Os -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib zstd
gcc version 14.2.0 (g04696df096)
Thank you very much for your support!
Regards,
Luca
P.S.: sorry if the category could be wrong… I didn’t find a RISC-V category