Skip to content

docs: embedded platform support design (#276)#277

Open
Sunrisepeak wants to merge 1 commit into
mainfrom
docs/embedded-platform-support-design
Open

docs: embedded platform support design (#276)#277
Sunrisepeak wants to merge 1 commit into
mainfrom
docs/embedded-platform-support-design

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

嵌入式平台支持方案文档(回应 #276 的本地设计调研,非 issue 评论),从「issue 分析」重构为正式方案文档,结构改为决策点+理由前置,详情后置

核心结论

  • 架构 = config②:mcpp 自带匹配-libc 的交叉编译器(最新 GCC),消费开发者提供的外部 sysroot;不做发行版构建器、不逐个适配厂商 SDK
  • 核心单点特性 = 开 sysroot 缝(L2):CLibMode::Sysroot 已能发 --sysroot、hermetic 白名单已含 tc.sysroot → 最小改动。
  • pkg-config、qemu 交叉 test-run = xlings provisioning 免费 + 薄接线。
  • 滩头 = 树莓派 aarch64
  • 元结论:config② 把 feat/RFC: 支持 Buildroot/OpenWrt/Yocto 等嵌入式 Linux SDK 的工程化集成 #276 最难的「厂商旧编译器 vs C++23」用「根本不用旧编译器」直接溶掉。

锁定的决策(16 条,含理由)

含:C++ 只源码 / 二进制只 C-ABI+封装;厂商 C++-only 库走用户建的 C 桥 .so;glibc 基线造 payload 时 pin 低(GCC 版本×glibc 解耦,payload 用最新 GCC 16,GCC 15 只是能力 floor);去掉 L4 后端、sysroot pinning、造 .pc、以及「编译器不支持 C++23」诊断(架构上该场景不存在)。

净工作

  • P0 sysroot 缝(L2)+ 匹配-libc 低-glibc GCC 16 payload(aarch64-gnu 首要)+ 一次 glibc 地板实证
  • P1 pkg-config(pkgconf via xlings)+ qemu 交叉 test-run

详见文档正文(决策表 + 现状核实/可行性/风险 + 关键文件索引 + Rust 对照)。

Design/proposal doc for entering the embedded Linux ecosystem, restructured
as decisions-first (with rationale) then supporting detail.

Positioning: mcpp brings its own matched-libc cross compiler (latest GCC) and
consumes an external device sysroot — it is NOT a distro builder and never
adapts per-vendor SDK. The single core change is opening the sysroot seam (L2);
the CLibMode::Sysroot mechanism and the hermetic allow-list already accept
tc.sysroot, so it's a minimal insertion. pkg-config and qemu cross test-run are
xlings provisioning + thin wiring.

Locks the maintainer decision register (16 decisions + rationale), incl.:
- C++ source-only; binary interop C-ABI only + wrapper; vendor C++-only libs via
  a user-built C-bridge .so (built in vendor ABI, pure-C boundary)
- glibc baseline pinned low when building payloads (GCC version x glibc decoupled);
  payloads use the latest GCC (16), GCC 15 is only the import-std capability floor
- dropped: L4 backend mode, sysroot pinning/mgmt, .pc synthesis, and the
  "compiler doesn't support C++23" diagnostic (config II makes that case
  architecturally impossible)

Beachhead: Raspberry Pi aarch64. Net work: P0 sysroot seam + matched-libc
low-glibc GCC 16 payloads (+ one glibc-floor validation); P1 pkg-config + qemu
test-run.

Supersedes the earlier issue-276 analysis note (renamed to a proper design doc).
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.

1 participant