Comments (8)
I believe this is llvm/llvm-project#77653 (and llvm/llvm-project#84392). As a workaround, try adding the flag -L"$(brew --prefix llvm)"/lib/c++
.
from homebrew-core.
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.
If anyone else is interested, this was my workaround hack for this issue: (warning: it is permentatly modifying the libc++ headers, I am just using it in a github action)
sed -i '' '/^#define _LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS/d' "$(brew --prefix llvm)"/include/c++/v1/__config_site
after that I could target the minimum version MacOS version that is required for std::println
:
echo "CXXFLAGS=-mmacos-version-min=13.3" >> $GITHUB_ENV
from homebrew-core.
As a workaround, try adding the flag -L"$(brew --prefix llvm)"/lib/c++.
It works for me. Thanks!
from homebrew-core.
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 <print>
with the native lib, the this is how it was implemented:
llvm/llvm-project@4a87db6
_LIBCPP_AVAILABILITY_HAS_PRINT
has to be set to zero so it will just skip using the linked functions and loss a small functionality.
And they set it only with the vendor availability annotations for apple:
https://github.com/llvm/llvm-project/blob/80f510bbc9561324fc13bac22aad2e3ef47a59c5/libcxx/cmake/caches/Apple.cmake#L9
In the libc++ includes in homebrew _LIBCPP_AVAILABILITY_HAS_PRINT
is 1, so this feature is only available when linking against the bundled libc++.
from homebrew-core.
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 -nostdinc++
.
Maybe splitting libc++ into a separate formula might be a starting point here.
from homebrew-core.
If you're linking with system libc++ then it should be using the C++ headers shipped with the macOS SDK.
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 LIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS
could be great.
from homebrew-core.
The bug reason is clang use header files which are installed by brew but use the libc++ in sysroot.
So another workaround is remove the header files in folder of homebrew.
mv /opt/homebrew/Cellar/llvm/18.1.5/include/c++/v1 /opt/homebrew/Cellar/llvm/18.1.5/include/c++/v1.bak
from homebrew-core.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
from homebrew-core.
Related Issues (20)
- brew install --cask metasploit fail 404 on macOS HOT 1
- psql segfaults from brew linked krb5 HOT 5
- mtr doesn't gives any report output if --port option is used with tcp/ udp. HOT 2
- virt-manager will only run if run with --debug flag HOT 2
- Podman recipe requires `pasta` now as well, or extra configuration to avoid needing `pasta` HOT 3
- gitg: SHA256 mismatch HOT 3
- Including .ruby-version in homebrew-core can force ruby version for Ruby scripts in /opt/homebrew/bin HOT 3
- Conflicting Instructions for Using Homebrew-installed LLVM HOT 2
- `universal-ctags` continuously upgrade to the same version HOT 1
- package ccze not picked up by install command HOT 1
- swi-prolog installed with --HEAD option shows different versions HOT 1
- Missing msbuild in [email protected] breaks SonarQube scanning in our build pipeline HOT 1
- Running formulae `asitop` breaks `[email protected]` permissions HOT 3
- Homebrew curl HTTP/3 support HOT 4
- brew install scikit-image isn't importable from python3.12 HOT 2
- autopsy is not the latest version HOT 2
- `msgpack` formula generates invalid pkg-config file HOT 2
- Mplayer shows movie on a quarter screen only on macOS HOT 4
- Bug in util-linux 2.40.1 rename causes data loss HOT 5
- OpenJDK `release` file is modified by Homebrew HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-core.