Skip to content

Commit b32eed8

Browse files
committed
fix(build): drop explicit -lc++abi from the test stdlib link
libc++.1.dylib reexports its abi; linking libc++abi.dylib explicitly alongside the system abi (loaded transitively via macOS frameworks) doubled the __cxa_* runtime state — every test binary aborted before main (exit 6) on the first macOS CI round.
1 parent 9c5365b commit b32eed8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/build/flags.cppm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,8 +402,13 @@ CompileFlags compute_flags(const BuildPlan& plan) {
402402
auto libDir = llvmRootForStdlib / "lib";
403403
if (std::filesystem::exists(libDir / "libc++.dylib")
404404
|| std::filesystem::exists(libDir / "libc++.1.dylib")) {
405+
// No explicit -lc++abi: libc++.1.dylib reexports its abi,
406+
// and adding the abi dylib EXPLICITLY next to the system one
407+
// (pulled in transitively by macOS frameworks) doubles the
408+
// __cxa_* runtime state — every binary aborted at load
409+
// (SIGABRT before main) on the first CI round of this fix.
405410
f.ldStdlibTest = " -nostdlib++ -L" + escape_path(libDir)
406-
+ " -lc++ -lc++abi"
411+
+ " -lc++"
407412
+ " -Wl,-rpath," + escape_path(libDir);
408413
}
409414
}

0 commit comments

Comments
 (0)