Skip to content

Commit 90accbb

Browse files
committed
docs: the no-package iOS path is reported, not refused
1 parent 434fef1 commit 90accbb

3 files changed

Lines changed: 39 additions & 28 deletions

File tree

.agents/docs/2026-09-13-630-what-a-framework-still-hits-in-the-engine.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,20 @@ and the row table names none. The alternatives and why they are not taken:
432432
SDK a machine has. The `llvm@20.1.7` workaround is this alternative done by
433433
hand, and it holds only until the next SDK.
434434

435-
**What the engine does when no package is declared.** Rule C still binds:
436-
the runtime is the SDK's, so the headers are the SDK's
435+
**What the engine does when no package is declared.** The runtime is the
436+
SDK's. A graph that does not import `std` takes the SDK's headers
437437
(`-nostdinc++ -isystem <sdk>/usr/include/c++/v1`; clang's Darwin driver
438-
would otherwise prefer the libc++ installed beside the compiler), and the
439-
std module is withdrawn: the SDKs ship no module sources (measured above)
440-
and the engine does not consume one, so a program that imports `std` is
441-
refused with a message naming the two package lines, and a program that does
442-
not is unaffected. This is honest where today's default is a coincidence,
443-
and it is the same `HostCoupled` cell the macOS fallback already occupies.
438+
would otherwise prefer the libc++ installed beside the compiler): one libc++
439+
on every line, which Rule C asks for. A graph that imports `std` keeps the
440+
payload's module and headers over the SDK's dylib, which is what every iOS
441+
build got before this batch; the SDKs ship no module sources (measured
442+
above) and the engine does not consume one, so there is no consistent pair
443+
to switch to. That pairing is reported once as a degradation
444+
(`target/cxx-runtime`) naming the hazard and the two package lines, and the
445+
build proceeds. A refusal was written first and withdrawn on review: it
446+
would have broken a program that built the day before, while the
447+
degradation names the remedy at the first build and costs nothing until an
448+
inline path reaches an export the older dylib lacks.
444449

445450
The engine change, in full:
446451

@@ -466,10 +471,12 @@ The engine change, in full:
466471
5. The std-module adoption at `prepare.cppm:10362` accepts
467472
`mcpp:c++-abi=libc++` as the current spelling of `hosted-standard-library`
468473
and continues to accept the older one.
469-
6. On an Apple cross target without a graph C++ runtime: the compile side
470-
emits `-nostdinc++ -isystem <sdk>/usr/include/c++/v1`; `hasImportStd`
471-
is false, and a graph that imports `std` is refused with the message
472-
naming `llvm.libcxx` and `llvm.compiler-rt-builtins`.
474+
6. On an Apple cross target without a graph C++ runtime: when the graph
475+
does not import `std`, `Toolchain::appleSdkCxxHeaders` is set and the
476+
compile side emits `-nostdinc++ -isystem <sdk>/usr/include/c++/v1`; when
477+
it does, the payload's module stays and prepare reports the
478+
`target/cxx-runtime` degradation naming `llvm.libcxx` and
479+
`llvm.compiler-rt-builtins`.
473480
7. The builtins archive. Clang's Darwin driver adds
474481
`libclang_rt.<platform>.a` from its own resource directory and, when the
475482
file is absent, continues without it (its source says missing runtime
@@ -515,10 +522,10 @@ the engine's part is measured first:
515522
carries `-nostdlib++` and no `-lc++`.
516523
- `aarch64-macos` with a floor: command lines unchanged from today, byte for
517524
byte (the `SelfContained` row must not move).
518-
- `aarch64-ios-sim` without the declaration: the compile command carries
519-
`-isystem <sdk>/usr/include/c++/v1` and no payload `-isystem`; a program
520-
that does not import `std` links `-lc++` and runs; one that does is refused
521-
with the message naming `llvm.libcxx`.
525+
- `aarch64-ios-sim` without the declaration: a program that does not import
526+
`std` carries `-isystem <sdk>/usr/include/c++/v1` and no payload
527+
`-isystem`, links `-lc++` and prints no `target/cxx-runtime` line; one that
528+
does still builds and the degradation names `llvm.libcxx`.
522529
- Builtins: `aarch64-ios-sim` with `llvm.compiler-rt-builtins` declared and
523530
a program whose source contains `if (__builtin_available(iOS 17, *))`
524531
links and runs; without the declaration the same program fails at link

docs/20-toolchains.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -690,13 +690,16 @@ and the artifact's load commands name no `libc++.1.dylib`: the headers a
690690
translation unit is compiled against, the module it imports and the objects it
691691
links are one release by construction.
692692

693-
Without the first declaration the runtime is the SDK's libc++, so the headers
694-
are the SDK's too (`-nostdinc++ -isystem <sdk>/usr/include/c++/v1`), and
695-
`import std` is refused with a message naming the package: the SDK ships no
696-
module sources, and the payload's describe a different libc++. A program that
697-
does not import `std` builds and links `-lc++`. Without the second, prepare
698-
reports once that the payload has no compiler runtime for the platform; a
699-
program that never reaches an availability check links regardless.
693+
Without the first declaration the runtime is the SDK's libc++. A program that
694+
does not import `std` then takes the SDK's headers too
695+
(`-nostdinc++ -isystem <sdk>/usr/include/c++/v1`) and links `-lc++`. A program
696+
that imports `std` keeps the payload's module and headers over the SDK's
697+
dylib, as every iOS build did before this release; the two are different
698+
releases of libc++, and prepare reports the pairing once, naming the two lines
699+
above, because it links until an inline path in the newer headers names an
700+
export the older dylib lacks. Without the second declaration, prepare reports
701+
once that the payload has no compiler runtime for the platform; a program that
702+
never reaches an availability check links regardless.
700703

701704
### The deployment target
702705

docs/zh/20-toolchains.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -622,11 +622,12 @@ llvm.compiler-rt-builtins = "22.1.8.3" # __isPlatformVersionAtLeast 与通用
622622
产物的加载命令不含 `libc++.1.dylib`:翻译单元编译所用的头、导入的模块与链接的目标文件按构造
623623
是同一个发布版本。
624624

625-
不声明第一行时,运行时是 SDK 的 libc++,头文件因此也取 SDK 的
626-
(`-nostdinc++ -isystem <sdk>/usr/include/c++/v1`),`import std` 被拒绝并在消息里点名该包:
627-
SDK 不附带模块源,而载荷的模块源描述的是另一个 libc++。不导入 `std` 的程序照常构建并链接
628-
`-lc++`。不声明第二行时,prepare 报告一次「载荷没有这个平台的编译器运行时」;从不触及可用性
629-
检查的程序照常链接。
625+
不声明第一行时,运行时是 SDK 的 libc++。不导入 `std` 的程序随之取 SDK 的头文件
626+
(`-nostdinc++ -isystem <sdk>/usr/include/c++/v1`)并链接 `-lc++`。导入 `std` 的程序仍用载荷的
627+
模块与头文件配 SDK 的 dylib,与此版本之前每一次 iOS 构建相同;二者是 libc++ 的两个发布版本,
628+
prepare 报告一次这对搭配并点名上面两行,因为它只在较新头文件里的内联路径没有引用旧 dylib 缺失的
629+
导出时才能链接。不声明第二行时,prepare 报告一次「载荷没有这个平台的编译器运行时」;从不触及
630+
可用性检查的程序照常链接。
630631

631632
### 部署目标
632633

0 commit comments

Comments
 (0)