Skip to content

docs(rkdeveloptool): add macOS Apple Silicon VLA build note#1816

Open
tangzz-radxa wants to merge 1 commit into
radxa-docs:mainfrom
tangzz-radxa:docs/cm3-rkdeveloptool-macos-vla-1813
Open

docs(rkdeveloptool): add macOS Apple Silicon VLA build note#1816
tangzz-radxa wants to merge 1 commit into
radxa-docs:mainfrom
tangzz-radxa:docs/cm3-rkdeveloptool-macos-vla-1813

Conversation

@tangzz-radxa

Copy link
Copy Markdown
Contributor

Fixes #1813

Summary

The macOS build instructions for rkdeveloptool (the common MDX file imported by CM3, CM5, Rock 3A/3C, Rock 4C+, Rock Pi S0, Zero 3, NX5, etc.) did not mention the Apple Clang -Werror,-Wvla-cxx-extension build failure that hits users on Apple Silicon (M1 / M2 / M3).

In main.cpp the two BYTE pBuf[nSectorSize * DEFAULT_RW_LBA] arrays use a non-constexpr nSectorSize, which Apple Clang rejects as a C++ VLA extension. Because the Makefile builds with -Werror, the whole make -j $(nproc) aborts and the user is left with no documented workaround.

Change

Add a :::warning[macOS 编译报错] / :::warning[macOS build error] callout inside the macOS tab, in both zh and en, with two workable workarounds:

  1. Pass CXXFLAGS="-Wno-vla-cxx-extension" to ./configure (no source patch required).
  2. Edit main.cpp and change the two int nSectorSize = 512; lines to constexpr int nSectorSize = 512;, then rebuild.

Both zh (docs/common/dev/_rkdeveloptool.mdx) and en (i18n/en/.../_rkdeveloptool.mdx) are updated in sync.

Source

Risk

docs-only, single scope (docs/common/dev). Touches the shared _rkdeveloptool.mdx MDX file, which is imported by ~9 product pages, so all of them will pick up the new note uniformly.

…cs#1813)

The macOS build instructions for rkdeveloptool did not mention the
-Werror,-Wvla-cxx-extension build failure that Apple Clang produces
on Apple Silicon (M1/M2/M3), where `BYTE pBuf[nSectorSize * DEFAULT_RW_LBA]`
in main.cpp is treated as a C++ VLA extension and fails the build.

Add a :::warning callout in the macOS tab with two workarounds:
- pass CXXFLAGS='-Wno-vla-cxx-extension' to ./configure
- or change the two `int nSectorSize = 512;` lines to constexpr

Both zh and en are updated in sync.
@tangzz-radxa tangzz-radxa requested a review from a team as a code owner June 9, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue from som/cm/cm3/low-level-dev/rkdeveloptool

1 participant