Appearance
Native Mac Builds for Rockchip and D-Robotics Platforms
On an Apple Silicon Mac, full-build both the Rockchip RV1126B and D-Robotics S100P embedded SDKs with native arm64 containers. kernel builds get 4–7× faster, the amd64/x86 path is untouched, and both platforms have been flashed and verified on hardware.
Results
| Metric | Notes |
|---|---|
| ~7× | S100P kernel: 63.5 → 9.1 min (under gcc's integer-heavy load, Rosetta's overhead far exceeds estimates) |
| ~4.1× | RV1126B kernel: 1217s → 293s (-j14 parallelism dilutes the per-core overhead, so the speedup is lower than S100P's) |
| Full chain | S100P: mcu / kernel / deb-all / full image ✓; RV1126B: kernel / buildroot / recovery / update.img / AMP RISC-V MCU ✓ |
| Non-breaking | native x86 Linux, Mac+Rosetta and native Mac arm64 all coexist, switched with the same command |
Overview: How It Runs
Switching platforms is one environment variable, and the default is still amd64 (zero impact on colleagues' x86 hosts):
| Platform | Command |
|---|---|
| RV1126B | RV1126B_BUILD_PLATFORM=linux/arm64 scripts/docker/build.sh kernel |
| S100P | S100_BUILD_PLATFORM=linux/arm64 west s100-build kernel |
Two Entry Gates
Hard-won prerequisite
Without a case-sensitive volume as the foundation, nothing else works — macOS silently merges the kernel's paired netfilter files.
Breakthrough One: The Vendor Ships No aarch64 Host Toolchain
The central porting problem: the SDK hard-codes the aarch64-none-linux-gnu-* prefix, but ARM/Linaro never publish that toolchain for aarch64 hosts.
Supporting fixes (all because GCC 11.4 is stricter than the old toolchain):
| Symptom | Root cause | Fix |
|---|---|---|
RV1126B's get_toolchain just exit 1s | nobody wrote the "aarch64 host building an aarch64 target" branch | add a native branch that returns the shim prefix |
| the rtl8733bu driver fails to compile | CONFIG_WERROR=y plus GCC 11's stricter -Wmisleading-indentation | append KCFLAGS=-Wno-error for native builds |
Breakthrough Two: rkbin Is x86-only, but Only for Packaging
Testing also cleared up a handover myth: check-sdk does no arch check at all (it only checks the FSTYPE whitelist and that the tools exist), so an arm64 container passes straight through — the only real x86-only piece is rkbin.
S100P Full Chain
| Stage | Pitfall | Fix |
|---|---|---|
| deb-all | depends on the rootfs sysroot; running it bare just fails | run image-prepare first (downloads a 2.5GB samplefs) |
| image-prepare | tar --same-owner is rejected on virtiofs (container root is really uid 501) | detect virtiofs and skip the owner fixup |
| Image building | mkfs.ext4 -d reports ENOENT on symlinks (1.46 is too old) | build e2fsprogs 1.47 + -E no_copy_xattrs |
| First-boot resize fails | 1.47 enables orphan_file by default and the board's 1.46 doesn't understand it | add -O ^orphan_file to mke2fs |
| adb won't start | see the "three-layer diagnosis" below | bake fix_rootfs_ld_path() into the image |
The adb Case: -ENODEV Isn't a Missing Driver Patch
RV1126B Full Chain
Five Pitfalls in a Row on the AMP MCU (Getting the RISC-V Firmware to Build)
A pitfall the compiler can't catch
The AMP shared-memory address is hard-coded once in each place — link.lds / the ITS / the DTS / three source files — so changing the layout means syncing six of them, and a mismatch only shows up once it's on the board.
buildroot Pitfalls
| Pitfall | Fix |
|---|---|
| the Go 1.4 bootstrap doesn't support aarch64 | swap in a prebuilt Go 1.19 as stage1 |
| sources.buildroot.net runs at ~1KB/s from China | download the big tarballs by hand into dl/ |
rkaiq's j2s host tool hard-codes x86 flags (-m64 etc.) | just delete it (it's redundant anyway) |
rsync --exclude 'rockdev/' also hits the packaging tool directory | anchor it at the top level instead: '/rockdev/' |
Flashing: Two Different Mechanisms
| RV1126B(Rockchip) | S100P(D-Robotics) | |
|---|---|---|
| Tool | upgrade_tool / rkdeveloptool | Horizon fastboot (flash_all.sh -m all) |
| Enter download mode | adb reboot loader, wait 5–18s for enumeration (Vid 0x2207) | send Ctrl+C repeatedly on the serial port to break the zero-delay autoboot → Hobot$ → fastboot 0 |
| Key detail | the mac builds of the tools need unzip + chmod | \x03 must be sent one byte at a time at ~100ms intervals; every 10ms floods the U-Boot input buffer and actually fails |
Toolchain Distribution: Host the Important Tools Yourself
New machine, new colleague or a dead upstream link — no problem: it's fetched automatically at build time, measured at 24 MB/s over the public internet.
Pitfall Cheat Sheet
| Symptom | Root cause | Fix |
|---|---|---|
| Paired kernel files go missing | APFS is case-insensitive | use a case-sensitive volume |
| check-sdk flags ext4 | virtiofs isn't in the whitelist | build inside a Docker volume |
| apt proxy refused inside the container | 127.0.0.1 inside the container is the container itself | point the proxy at host.docker.internal |
| "no name for user ID 501" | the Mac uid has no matching container user | create the user dynamically via a Dockerfile ARG |
| docker build times out fetching metadata | auth.docker.io needs the proxy | proxy only the metadata; let apt go direct |
| Edited the source but it still reports the old error | buildroot's .stamp_extracted gate | rm -rf output/*/build/<pkg>-* |
| adb reports more than one with several boards | two boards connected at once | pick one with ANDROID_SERIAL=<序列号> |