fix(llvm.org): ship libc++/libc++abi/libunwind on linux#13771
Open
tannevaled wants to merge 1 commit into
Open
fix(llvm.org): ship libc++/libc++abi/libunwind on linux#13771tannevaled wants to merge 1 commit into
tannevaled wants to merge 1 commit into
Conversation
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 <iostream>/<vector>. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
is this not handled by, or better under libcxx.llvm.org? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The linux
llvm.orgbottle builds onlycompiler-rtas a runtime, so it ships clang with no libc++ at all — nolibc++.so, no headers (include/c++/v1). Anything requiring-stdlib=libc++fails with'iostream'/'string'file not found.This blocks envoyproxy.io (#13046): Envoy dropped gcc/libstdc++ support in 1.21+ and must be built with libc++, but there's no libc++ in the bottle to build against.
Fix
Add
libcxx;libcxxabi;libunwindtoLLVM_ENABLE_RUNTIMESon linux only.This is additive:
CLANG_DEFAULT_CXX_STDLIB=libstdc++still makes gcc's libstdc++ the default, so existing consumers are unaffected; libc++ is simply now available for those who ask (-stdlib=libc++). Darwin already gets libc++ from the SDK, so the extra runtimes stay linux-only.Verification (x86-64, Debian bullseye)
Built the bottle with this change and confirmed:
include/c++/v1(e.g.iostream)libc++.so.1,libc++abi.so.1,libunwind.so.1install underlib/<triple>/(the recipe's existing "move linux libs into /lib" step then relocates them tolib/)clang++ -stdlib=libc++compiles, links and runs a program using<iostream>/<vector>(exit 0 with libc++ on the loader path)Unblocks #13046 (Envoy). The Envoy recipe already forwards
-isystem{{deps.llvm.org.prefix}}/include/c++/v1(matches the header path above) for both target and host/exec configs.🤖 Generated with Claude Code