nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

risc-v/sg2000: Kernel fails to boot with GCC `-O2`

Open lupyuen opened this issue 1 year ago • 0 comments

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:

  1. tools/configure.sh milkv_duos:nsh
  2. Edit arch/risc-v/src/common/Toolchain.defs
  3. Change ARCHOPTIMIZATION += -Os to ARCHOPTIMIZATION += -O2
  4. 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.

lupyuen avatar Jul 17 '24 10:07 lupyuen