Toolchain Version: riscv-none-embed-gcc-xpack v8.3.0-2.3, where the individual components’ versions are as follows:
BINUTILS_GIT_BRANCH=${BINUTILS_GIT_BRANCH:-"sifive-binutils-2.32-cache-control-patch-xpack"}
if [[ "${RELEASE_VERSION}" =~ 8\.3\.0-2\.[1] ]]
then
BINUTILS_GIT_COMMIT=${BINUTILS_GIT_COMMIT:-"d005a513ac8469bf23a1a7655a6d372a7f470dd3"}
else
BINUTILS_GIT_COMMIT=${BINUTILS_GIT_COMMIT:-"c46d3912cd901db4bdc331bd394aa97d85ac1746"}
fi
GCC_GIT_BRANCH=${GCC_GIT_BRANCH:-"sifive-gcc-8.3.0-xpack"}
GCC_GIT_COMMIT=${GCC_GIT_COMMIT:-"e195042babe2dc30d9fabb88d336d8c8679b3702"}
NEWLIB_GIT_BRANCH=${NEWLIB_GIT_BRANCH:-"fix-S5CSD-1486-xpack"}
NEWLIB_GIT_COMMIT=${NEWLIB_GIT_COMMIT:-"dd7f1b85e9bb29a97d9357a617b6ff29a7d2f19a"}
GDB_SRC_FOLDER_NAME=${GDB_SRC_FOLDER_NAME:-"binutils-gdb.git"}
GDB_GIT_BRANCH=${GDB_GIT_BRANCH:-"gdb-8.3-release-cache-control-patch-xpack"}
GDB_GIT_COMMIT=${GDB_GIT_COMMIT:-"ee1f38cc20612d5a570cab0e818ee40fc31b148a"}
I got the following linkage errors with -O0 -ggdb
options, while it’s okay with -Os
and without -ggdb
option.
build/kernel/libcpu/risc-v/k210/startup_gcc.o: in function `.L0 ':
/home/remember/my_work/k210-openmv_release/src/rt-thread/libcpu/risc-v/k210/startup_gcc.S:125:(.start+0x134): relocation truncated to fit: R_RISCV_JAL against symbol `secondary_cpu_c_start' defined in .text.secondary_cpu_c_start section in build/kernel/libcpu/risc-v/k210/cpuport_smp.o
build/kernel/libcpu/risc-v/common/context_gcc.o: in function `.L0 ':
/home/remember/my_work/k210-openmv_release/src/rt-thread/libcpu/risc-v/common/context_gcc.S:50:(.text+0x12): relocation truncated to fit: R_RISCV_JAL against symbol `rt_cpus_lock_status_restore' defined in .text.rt_cpus_lock_status_restore section in build/kernel/src/cpu.o
build/kernel/libcpu/risc-v/k210/interrupt_gcc.o: in function `.L0 ':
/home/remember/my_work/k210-openmv_release/src/rt-thread/libcpu/risc-v/k210/interrupt_gcc.S:77:(.text.entry+0x7c): relocation truncated to fit: R_RISCV_JAL against symbol `rt_hw_context_switch_exit' defined in .text section in build/kernel/libcpu/risc-v/common/context_gcc.o
collect2: error: ld returned 1 exit status
scons: *** [rtthread.elf] Error 1
scons: building terminated because of errors.