Clang 18 is currently broken, it cannot link with its own libc++ but it tries to use gcc stdc++ which is wrong.
Just got any super tiny project like:
git clone https://github.com/bvbfan/lock_free.git
cd lock_free
mkdir build && cd build && cmake .. -DCMAKE_CXX_COMPILER=clang -DCMAKE_C_COMPILER=clang
make -j6
Linking fails since it tries to mismatch std libc++ with gcc.