docs(rkdeveloptool): add macOS Apple Silicon VLA build note#1816
Open
tangzz-radxa wants to merge 1 commit into
Open
docs(rkdeveloptool): add macOS Apple Silicon VLA build note#1816tangzz-radxa wants to merge 1 commit into
tangzz-radxa wants to merge 1 commit into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-extensionbuild failure that hits users on Apple Silicon (M1 / M2 / M3).In
main.cppthe twoBYTE pBuf[nSectorSize * DEFAULT_RW_LBA]arrays use a non-constexprnSectorSize, which Apple Clang rejects as a C++ VLA extension. Because the Makefile builds with-Werror, the wholemake -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:CXXFLAGS="-Wno-vla-cxx-extension"to./configure(no source patch required).main.cppand change the twoint nSectorSize = 512;lines toconstexpr int nSectorSize = 512;, then rebuild.Both zh (
docs/common/dev/_rkdeveloptool.mdx) and en (i18n/en/.../_rkdeveloptool.mdx) are updated in sync.Source
main.cpp:2563:12: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension]Risk
docs-only, single scope (
docs/common/dev). Touches the shared_rkdeveloptool.mdxMDX file, which is imported by ~9 product pages, so all of them will pick up the new note uniformly.