New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compilation Failure with Clang from Brewed LLVM #169820
Comments
I believe this is llvm/llvm-project#77653 (and llvm/llvm-project#84392). As a workaround, try adding the flag |
It works for me. Thanks! |
Hey, I have encountered the same issue and looked into the issue. Yes linking against the bundled libc++ solves it, but it seems that libc++ for macos does support |
I guess ultimately the problem is the wrong C++ headers being used. If you're linking with system libc++ then it should be using the C++ headers shipped with the macOS SDK. Currently there isn't an easy way to tell clang to switch between libc++ installs, unless you mess around with Maybe splitting libc++ into a separate formula might be a starting point here. |
clang and libc++ has the feature to target specific versions of macos (with the availability annotation), so in this situation I still wish that I could use the newest libc++ with that capability and not be stuck with the slowly updating macos sdks. Maybe a different formula for libc++ with |
My use case is using clang to distribute a standalone binary for mac, so I want that it will be linked against the system libc.
after that I could target the minimum version MacOS version that is required for |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
Compile following simple C++ code with clang++.
with
/opt/homebrew/opt/llvm/bin/clang++ -std=c++23 test.cc
.What happened (include all command output)?
Undefined symbols for architecture arm64:
"std::__1::__is_posix_terminal(__sFILE*)", referenced from:
std::__1::__print::__is_terminalabi:ne180100 in test-285f15.o
ld: symbol(s) not found for architecture arm64
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
What did you expect to happen?
Compilation successful.
I confirmed that this code builds successfully with llvm@17.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: