Hello,
Currently building FreeRTOSv10.2.0, demo RISCV/QEMU using toolchain riscv64-unknown-elf-gcc
Please note, the toolchain riscv64-unknown-elf-gcc was built with multilib support (as much variants as possible of rv64 & rv32).
Unfortunately, the command
make clean && make CROSS_COMPILE_PREFIX=riscv64-unknown-elf
fails at link time with message such as
ABI is incompatible with that of selected emulation:
target emulation 'elf32-littleriscv' does not match 'elf64-littleriscv'
then later on
file class ELFCLASS32 incompatible with ELFCLASS64
As far as I know, this is due to the linker expecting natively ELF64 objects, whereas everything was built rv32imac/ilp32, thus producing ELF32 binaries.
I would suggest to fix BuildEnvironment.mk such as:
LDFLAGS := -Xlinker --gc-sections -Xlinker --defsym=stack_size=1K
LDFLAGS +=$(ARCH_FLAGS)
LDFLAGS += -O0 -g3
Please let me know,
All the best meanwhile
Jean-Francois
Which project were you building?