nuttx
nuttx copied to clipboard
risc-v/sg2000: Kernel fails to boot with GCC `-O2`
As noted in https://github.com/apache/nuttx/issues/12696#issuecomment-2232279326, NuttX Kernel fails to boot on Milk-V Duo S SBC (Sophgo SG2000 SoC) when we change GCC Option -Os to -O2:
-
tools/configure.sh milkv_duos:nsh - Edit
arch/risc-v/src/common/Toolchain.defs - Change
ARCHOPTIMIZATION += -OstoARCHOPTIMIZATION += -O2 - NuttX Kernel doesn't boot to NSH Shell
GCC -O2 is desirable because we are comparing CoreMark with SG2000 Debian, which compiles with -O2. And -Os is probably irrelevant for a 64-bit SBC with plenty of RAM.
I'll add more logs to troubleshoot the issue. It's possible that Ox64 BL808 SBC is also affected, since the code is nearly identical to SG2000 NuttX.