Skip to content

fix(llvm.org): ship libc++/libc++abi/libunwind on linux#13771

Open
tannevaled wants to merge 1 commit into
pkgxdev:mainfrom
tannevaled:fix/llvm-ship-libcxx
Open

fix(llvm.org): ship libc++/libc++abi/libunwind on linux#13771
tannevaled wants to merge 1 commit into
pkgxdev:mainfrom
tannevaled:fix/llvm-ship-libcxx

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Problem

The linux llvm.org bottle builds only compiler-rt as a runtime, so it ships clang with no libc++ at all — no libc++.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;libunwind to LLVM_ENABLE_RUNTIMES on 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:

  • headers install to include/c++/v1 (e.g. iostream)
  • libc++.so.1, libc++abi.so.1, libunwind.so.1 install under lib/<triple>/ (the recipe's existing "move linux libs into /lib" step then relocates them to lib/)
  • the freshly built 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

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>
@jhheider

Copy link
Copy Markdown
Contributor

is this not handled by, or better under libcxx.llvm.org?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants