Skip to content

Conversation

@extinguish
Copy link
Contributor

Summary

Incorporate a set of production‑recommended Green Hills (GHS) compiler and linker options to enhance debugging, diagnostics, and build quality:

  1. Map file enhancements (-Mn -map_eofn_symbols -Mx -Ms -Mu -Ml): generate detailed symbol, section, and relocation information.
  2. Debug improvements (-dual_debug, -ignore_debug_references, -v, -gsize): enable dual debug format, ignore debug‑section references during -delete, verbose linking, and section‑size reporting.
  3. Additional compile‑time checks (--prototype_errors, --incorrect_pragma_warnings): flag missing prototypes and incorrect pragma syntax.
  4. Build utilities (-keeptempfiles, -list, -nostartfiles): retain intermediate files, produce assembly listings, and suppress standard startup files.

Impact

  1. Provides richer debug information and more precise map files for post‑build analysis.
  2. Catches potential code issues earlier through stricter prototype and pragma checking.

Testing

  1. Verified that all new options are accepted by the Green Hills toolchain and do not cause build errors.
  2. Confirmed that the enhanced map file (nuttx.map) contains the expected additional details (symbols, sections, relocations).
  3. Ensured debug builds still produce usable debug information and that -gsize generates the expected .siz file.

@github-actions github-actions bot added Arch: arm Issues related to ARM (32-bit) architecture Size: S The size of the change in this PR is small labels Jan 15, 2026
add new build option config that recommended from other mass-produced
products

Signed-off-by: guoshichao <guoshichao@xiaomi.com>
@extinguish extinguish force-pushed the ghs_sync_build_opts_with_products branch from 0db1ef0 to d9077db Compare January 15, 2026 03:05
@extinguish
Copy link
Contributor Author

the following are the detailed spell check failed info:

Used config files:
    1: .codespellrc
/home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/cmake/ghs.cmake:189: siz ==> size, six
/home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/common/Toolchain.defs:497: siz ==> size, six

However, since the file name of the size report generated by the GreenHills compiler itself ends with .siz, can this check be skipped for it?

@xiaoxiang781216
Copy link
Contributor

the following are the detailed spell check failed info:

Used config files:
    1: .codespellrc
/home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/cmake/ghs.cmake:189: siz ==> size, six
/home/runner/work/nuttx/nuttx/nuttx/arch/arm/src/common/Toolchain.defs:497: siz ==> size, six

However, since the file name of the size report generated by the GreenHills compiler itself ends with .siz, can this check be skipped for it?

ok, let's ignore them.

@GUIDINGLI
Copy link
Contributor

GUIDINGLI commented Jan 16, 2026

@extinguish
There are CI check faileds

Copy link
Contributor

@GUIDINGLI GUIDINGLI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix CI fail

@GUIDINGLI GUIDINGLI merged commit 5a9f6ef into apache:master Jan 16, 2026
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Issues related to ARM (32-bit) architecture Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants