Skip to content

docs(plan): 「libstdc++ 一个宏就行」是错的 - #477

Merged
Sunrisepeak merged 1 commit into
mainfrom
docs/which-stdlib-is-not-the-question
Aug 20, 2026
Merged

docs(plan): 「libstdc++ 一个宏就行」是错的#477
Sunrisepeak merged 1 commit into
mainfrom
docs/which-stdlib-is-not-the-question

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

只动文档。

同一批头、同一份 libstdc++、同样 -D_GLIBCXX_HOSTED=0,只换目标:宿主 40/40,裸机 0/40,全部倒在 features.h

⇒ 原来那个 29/34 是在宿主目标上量的 —— 它证明「libstdc++ 支持 freestanding 模式」,而不是「libstdc++ 能服务裸机目标」。

⭐ 提法要改:重点不是用哪个标准库,而是那份标准库有没有为这个目标 configure 过⚠️ MSVC STL 一栏标为未测量。

同一批 40 个 freestanding 头、同一份 libstdc++ 16.1.0、同样 -D_GLIBCXX_HOSTED=0,
只换目标:

    x86_64-linux-gnu(宿主)   40 / 40 编过
    riscv64-none-elf(裸机)    0 / 40,全部倒在同一处

    bits/c++config.h:733: bits/os_defines.h:39: 'features.h' file not found

⇒ 原来那个 29/34 是在**宿主目标**上量的。它证明的是「libstdc++ 支持 freestanding
模式」,而不是「libstdc++ 能服务一个裸机目标」—— 而后者才是这个包的用途。

⭐ 问题的提法因此要改:重点不是**用哪个标准库**,而是**那份标准库有没有为这个目标
configure 过**。libc++ 的逐目标配置是一个扁平宏列表(可以 sed 合成,本仓库已经这么
做);libstdc++ 的是 configure 的产物,且把宿主 C 库拖进来。

⚠️ MSVC STL 一栏标为**未测量** —— 本机没有 MSVC 载荷,不能声称验证过。

这条理由比原先的「配置层很小」更准确也更有用:它说明**换实现解决不了 Windows 的
问题**。
@Sunrisepeak
Sunrisepeak merged commit ccd0792 into main Aug 20, 2026
18 checks passed
@Sunrisepeak
Sunrisepeak deleted the docs/which-stdlib-is-not-the-question branch August 20, 2026 22:10
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.

2 participants