From 2fe70d89d91e0079764fe19b9c1d5cce01ac4711 Mon Sep 17 00:00:00 2001 From: tannevaled Date: Fri, 10 Jul 2026 19:03:46 +0200 Subject: [PATCH] fix(llvm.org): ship libc++/libc++abi/libunwind on linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The linux bottle built only compiler-rt as a runtime, so it shipped clang with NO libc++ at all — no libc++.so, no headers (include/c++/v1). Anything that requires `-stdlib=libc++` therefore fails with "'iostream'/'string' file not found". Notably this blocks envoyproxy.io, which dropped gcc/libstdc++ support in 1.21+ and must be built with libc++. Add libcxx;libcxxabi;libunwind to LLVM_ENABLE_RUNTIMES on linux. This is additive: CLANG_DEFAULT_CXX_STDLIB=libstdc++ keeps gcc's libstdc++ as the default, and libc++ is now available on request (`-stdlib=libc++`). Darwin keeps getting libc++ from the SDK, so the extra runtimes are linux-only. Verified on x86-64 (Debian bullseye): the built bottle now ships include/c++/v1 + libc++.so/libc++abi.so/libunwind.so, and the freshly built clang++ -stdlib=libc++ compiles, links and runs a program using /. Co-Authored-By: Claude Opus 4.8 (1M context) --- projects/llvm.org/package.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/projects/llvm.org/package.yml b/projects/llvm.org/package.yml index 1363f32974..8f3630f87e 100644 --- a/projects/llvm.org/package.yml +++ b/projects/llvm.org/package.yml @@ -40,9 +40,20 @@ build: script: # Building compiler-rt on darwin+aarch64 fails for versions less than # 14 with the below configuration. FIXME if possible, of course. + # + # On linux we ALSO build libc++/libc++abi/libunwind as runtimes so the + # bottle ships a usable libc++ (headers under include/c++/v1 + the + # shared libs). Without it, clang has no libc++ at all on linux — only + # gcc's libstdc++ (which stays the default via CLANG_DEFAULT_CXX_STDLIB + # below) — so anything requiring `-stdlib=libc++` (e.g. envoyproxy.io, + # which dropped gcc/libstdc++ support in 1.21+) fails with + # "'iostream'/'string' file not found". This is additive: libstdc++ + # remains the default; libc++ is now available on request. Darwin gets + # libc++ from the SDK, so we only add these on linux. - run: | RUNTIMES="-DLLVM_ENABLE_RUNTIMES='compiler-rt'" if test "{{hw.platform}}" = "linux"; then + RUNTIMES="-DLLVM_ENABLE_RUNTIMES='compiler-rt;libcxx;libcxxabi;libunwind'" ARGS="$ARGS $RUNTIMES" elif semverator satisfies '>=14' {{version}}; then ARGS="$ARGS $RUNTIMES"