apache / apache/nuttx

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

Open
#12,723 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
4k
Forks
1.7k
Avg merge
1d 17h
Merged PRs (30d)
237

Description

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`
1. Edit `arch/risc-v/src/common/Toolchain.defs`
1. Change `ARCHOPTIMIZATION += -Os` to `ARCHOPTIMIZATION += -O2`
1. NuttX Kernel doesn't boot to NSH Shell

GCC `-O2` is desirable because we are comparing [CoreMark with SG2000 Debian](https://github.com/apache/nuttx/issues/12696#issuecomment-2232279326), 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.