llvm@19 links against wrong libc++ library version #5849
Unanswered
ibis-hdl
asked this question in
Getting started
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Output of
brew config
Output of
brew doctor
Description of issue
What you were trying to do (and why)
I'm using clang-19 on Github's macos-15 runner, installed by homebrew by:
The image has pre-installed clang-18, also via homebrew, see Readme. My CMake Project uses clang++ 19 and is linked against libc++, but if I check the linked lib I see:
What happened (include command output)
I would expect
libc++.1.dylib (... current version 190106)
. Did something go wrong at CMake's configure time?What you expected to happen
Linked against the right libc++
Step-by-step reproduction instructions (by running
brew
commands)Compile main.cpp with e.g.
std::cout << std::format("LibC++ {:d}\n", _LIBCPP_VERSION);
and run the binary, which shows
So obviously the header version is correct, but isn't linked correctly.
I added
~/.config/clang
file with:# See note on brew install llvm@19 -I/opt/homebrew/opt/llvm/include -L/opt/homebrew/opt/llvm/lib/c++ -L/opt/homebrew/opt/llvm/lib/unwind -lunwind
On CMake's side, additionally I configured as shown from
brew install llvm@19
, using CMake's inherited presetThe complete project (to clang-19 reduced/related; also devcontainer / Linux) can be found here.
Beta Was this translation helpful? Give feedback.
All reactions