|
1 | 1 | [package] |
2 | 2 | namespace = "mcpplibs" |
3 | 3 | name = "openkal-llvm-runtime" |
4 | | -version = "0.2.0" |
| 4 | +version = "0.3.0" |
5 | 5 | description = "LLVM's C++ runtime libraries — libc++, libc++abi and libunwind — configured for openkal-musl rather than for a host C library." |
6 | 6 | license = "Apache-2.0" |
7 | 7 | authors = ["mcpplibs"] |
@@ -147,58 +147,68 @@ std-module-flags = [ |
147 | 147 | # criterion the whole package exists to satisfy is the one openkal keeps |
148 | 148 | # returning to --- whether an implementation has been configured FOR this |
149 | 149 | # target, not whether its headers can be found. |
150 | | -# ⭐⭐ outline-atomics 的 125 个辅助函数,由本包供给 —— 因为本包就是那份 |
151 | | -# compiler-rt。 |
| 150 | +# ⭐⭐ THE 125 OUTLINE-ATOMICS HELPERS ARE SUPPLIED BY THIS PACKAGE, BECAUSE |
| 151 | +# THIS PACKAGE IS THAT compiler-rt. |
152 | 152 | # |
153 | | -# `--rtlib=compiler-rt` 让 clang 在 aarch64 上开启 `+outline-atomics`, |
154 | | -# 而它是对的:该特性的 `__aarch64_*` 辅助函数本来就住在 compiler-rt 里。 |
155 | | -# 此前本包不产出它们,于是特性被开启而没有人实现: |
| 153 | +# `--rtlib=compiler-rt` makes clang enable `+outline-atomics` on aarch64, and it |
| 154 | +# is right to: the feature's `__aarch64_*` helpers live in compiler-rt. This |
| 155 | +# package did not produce them, so the feature was enabled and nobody |
| 156 | +# implemented it: |
156 | 157 | # |
157 | 158 | # ld.lld: error: undefined symbol: __aarch64_swp4_acq |
158 | 159 | # ld.lld: error: undefined symbol: __aarch64_cas8_acq_rel |
159 | 160 | # |
160 | | -# ⚠️ 引用来自 `openkal-linux/src/memory.o` 与 `openkal-musl/port/src/okm_fd.o` |
161 | | -# —— 两个对这件事一无所知、只是用了原子操作的包。缺的是这份运行时该有的东西。 |
| 161 | +# ⚠️ The references came from `openkal-linux/src/memory.o` and |
| 162 | +# `openkal-musl/port/src/okm_fd.o` --- two packages that know nothing about any |
| 163 | +# of this and merely used an atomic operation. What was missing was something |
| 164 | +# this runtime is supposed to carry. |
162 | 165 | # |
163 | | -# upstream 的做法是把 `aarch64/lse.S` 编 125 遍,每遍给不同的 |
164 | | -# `-DL_<pat> -DSIZE=<n> -DMODEL=<m>`(6 模式 × 5 尺寸 × 5 模型, |
165 | | -# 非 cas 的 16 字节档不存在)。一个用 glob 表达 sources 的清单传不了 |
166 | | -# per-file 定义 —— 于是每个组合成为一个**自己声明宏、再 include 共享正文** |
167 | | -# 的文件。正文是 upstream 的,未经修改,仍在原处。 |
| 166 | +# Upstream compiles `aarch64/lse.S` 125 times, each with a different |
| 167 | +# `-DL_<pat> -DSIZE=<n> -DMODEL=<m>` (6 patterns x 5 sizes x 5 models; the |
| 168 | +# 16-byte width exists only for `cas`). A manifest that states its sources as a |
| 169 | +# glob cannot carry a per-file definition --- so each combination becomes a file |
| 170 | +# that DECLARES THE MACROS ITSELF AND THEN INCLUDES THE SHARED BODY. The body is |
| 171 | +# upstream's, unmodified, and stays where it is. |
168 | 172 | # |
169 | | -# ⭐ 这是把宏从**命令行**移到**文件内部**,而不是复制 125 份实现。 |
| 173 | +# ⭐ That moves the macros from the COMMAND LINE into the FILE, rather than |
| 174 | +# copying the implementation 125 times. |
170 | 175 | [target.'cfg(arch = "aarch64")'.build] |
171 | 176 | sources = [ |
172 | 177 | "llvm-generated/outline-atomics/*.S", |
173 | | - # ⚠️ 并且定义那个探测变量的文件。这 125 个辅助函数每一个都读 |
174 | | - # `__aarch64_have_lse_atomics` —— 它在运行时决定走 LSE 指令还是 |
175 | | - # load/store-exclusive 循环。少了它: |
| 178 | + # ⚠️ And the file that defines the probe. Every one of the 125 helpers reads |
| 179 | + # `__aarch64_have_lse_atomics`, which decides at run time between the LSE |
| 180 | + # instructions and a load/store-exclusive loop. Without it: |
176 | 181 | # |
177 | 182 | # ld.lld: error: undefined hidden symbol: __aarch64_have_lse_atomics |
178 | 183 | # |
179 | | - # ⭐ 它在 `cpu_model/aarch64.c`,而 `[build]` 段的 glob 是 |
180 | | - # `llvm/compiler-rt/lib/builtins/*.c` —— **不含子目录**,所以这个文件 |
181 | | - # 从未被编过。upstream 把它列在 `aarch64_SOURCES` 里,与本节同一批。 |
| 184 | + # ⭐ It is in `cpu_model/aarch64.c`, and the `[build]` section's glob is |
| 185 | + # `llvm/compiler-rt/lib/builtins/*.c` --- WHICH DOES NOT DESCEND INTO |
| 186 | + # SUBDIRECTORIES, so that file had never been compiled. Upstream lists it in |
| 187 | + # `aarch64_SOURCES`, in the same set as this section. |
182 | 188 | "llvm/compiler-rt/lib/builtins/cpu_model/aarch64.c", |
183 | 189 | ] |
184 | | -# ⚠️ FMV 关掉,而它不是可选的清理 —— 那半个文件在 macOS 宿主上根本编不过。 |
| 190 | +# ⚠️ FUNCTION MULTI-VERSIONING IS TURNED OFF, AND THAT IS NOT OPTIONAL TIDYING: |
| 191 | +# that half of the file does not compile on a macOS host at all. |
185 | 192 | # |
186 | | -# `cpu_model/aarch64.c` 的后半是函数多版本(FMV)的实现,按宿主分支 include |
187 | | -# 一个 `.inc`。Apple 那支拉的是系统头: |
| 193 | +# The second half of `cpu_model/aarch64.c` implements function multi-versioning, |
| 194 | +# and includes one `.inc` per host. Apple's branch reaches for a system header: |
188 | 195 | # |
189 | 196 | # aarch64/fmv/apple.inc:1:10: fatal error: 'TargetConditionals.h' file not found |
190 | 197 | # |
191 | | -# 而本包的 `include_dirs` 刻意不含任何来自机器的路径 —— 见该段的 |
192 | | -# ⭐⭐ NOTHING FROM THE MACHINE。⚠️ 本机 Linux 上编得过,CI 的 macOS 那格才炸, |
193 | | -# 是典型的「一台宿主看不见」的形状。 |
| 198 | +# and this package's `include_dirs` deliberately contains no path that comes |
| 199 | +# from the machine --- see ⭐⭐ NOTHING FROM THE MACHINE in that section. |
| 200 | +# ⚠️ It compiles on this Linux machine and fails only on the macOS row of |
| 201 | +# continuous integration, which is the shape one host cannot see. |
194 | 202 | # |
195 | | -# ⭐ 而本包**不需要** FMV:要的只是 `__aarch64_have_lse_atomics`, |
196 | | -# 它定义在 `#if !defined(DISABLE_AARCH64_FMV)` 之外。upstream 自己也有这个 |
197 | | -# 开关(`COMPILER_RT_DISABLE_AARCH64_FMV`),所以这是走它给的门,不是绕过。 |
| 203 | +# ⭐ And this package does NOT need multi-versioning: what it wants is |
| 204 | +# `__aarch64_have_lse_atomics`, which is defined outside |
| 205 | +# `#if !defined(DISABLE_AARCH64_FMV)`. Upstream has the same switch |
| 206 | +# (`COMPILER_RT_DISABLE_AARCH64_FMV`), so this goes through the door upstream |
| 207 | +# provides rather than around it. |
198 | 208 | cflags = ["-DDISABLE_AARCH64_FMV=1"] |
199 | 209 |
|
200 | 210 | [dependencies] |
201 | | -openkal-musl = "0.4.0" |
| 211 | +openkal-musl = "0.5.0" |
202 | 212 |
|
203 | 213 | [build] |
204 | 214 | cxx_standard = "c++23" |
|
0 commit comments