Commit df67537
committed
fix(bench): macOS must not be handed the payload's libc++ — Apple's ld links against libc++ too
上一版给 clang 加 `-L<registry>/lib -Wl,-rpath,...` 之后,macOS 上 cmake / bazel /
参照 mcpp 依旧全挂,而日志终于说清了是谁在挂:
dyld: Symbol not found: __ZdaPv
Referenced from: /Applications/Xcode_15.4.app/.../usr/bin/ld
Expected in: .../registry/.../lib/libc++.1.0.dylib
**是 Apple 自己的 `ld` 被解析到了载荷的 libc++ 上**,还没开始链接就 abort 了。
把 registry 的 lib 目录摆到平台工具链够得着的地方,就是在给系统里塞第二份
libc++,而 `ld` 自己就链 libc++。
判据在同一次运行里:**被测的 mcpp 那条臂 18 个格子全绿** —— 同一台 runner、同一个
载荷。也就是说 mcpp 在 macOS 上根本不发这些 flag。载荷里的 clang 自己知道它的
libc++ 在哪,`-isysroot` 也由 cmake 自己补。
所以 macOS 上不发 libc++ 相关的任何 payload flag。同样的隐患也存在于
`hermetic_payload.cmake` 的 Clang 分支(此前 macOS 的 projects 臂本来就没跑通,
所以没暴露),一并加上 `AND NOT APPLE`。1 parent 4284eb0 commit df67537
2 files changed
Lines changed: 27 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
176 | 194 | | |
177 | 195 | | |
178 | 196 | | |
| |||
0 commit comments