Comments (7)
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.
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.
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.
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.
Related Issues (20)
- macOS Sonoma Silicon openssl@3: `libdir` variable in libcrypto.pc incorrect (misses `/lib` suffix) HOT 3
- Warning: Some installed kegs have no formulae! This means they were either deleted or installed manually. You should find replacements for the following formulae: python-flit-core HOT 1
- gdk-pixbuf: xpm support missing since 2.42.11 (now off by default upstream) HOT 3
- gmime - pkgconfig file stale HOT 3
- llvm versioned formula does not build and install lldb HOT 4
- blackhole-2ch: ""com.apple.audio.coreaudiod": 1: Operation not permitted" error HOT 2
- curl formula does not install zsh completions
- Non-checksummed download of ffmpeg formula file from an arbitrary URL is unsupported! `brew extract` or `brew cr HOT 1
- Duplicate -lgcc flags in linker command with GCC 13.2.0 on macOS HOT 3
- PCSC-Lite configuration issue HOT 1
- Octave 9.1.0 opengl bug interacting with qt6-6.7.0 HOT 4
- musikcube 3.0.2_1 crashing on startup HOT 7
- clang-18 failed with exit code 139 HOT 2
- /usr/local/bin/apachectl: line 95: lynx: command not found
- ruby >= 3.2 bottles have an incorrect path in RbConfig::CONFIG["AR"] HOT 10
- Cannot install plugins within poetry HOT 3
- mecab-ipadic: character encoding corruption HOT 9
- mingw-w64 SHA256 mismatch HOT 2
- Deno 1.43.2 homebrew build segmentation fault HOT 16
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.