MaskRay requested changes to this revision. MaskRay added a comment. This revision now requires changes to proceed.
It is difficult for clang driver to make the decision because libc++ has multiple C++ ABI implementations as @mstorsjo said. Persoanlly I use: `clang++ -stdlib=libc++ -static-libstdc++ -nostdlib++ a.cc -Wl,--push-state,-Bstatic -lc++ -lc++abi -Wl,--pop-state -pthread` This is still a bit inferior because there is a duplicate -lc++ passed by the driver. Dynamically link against libc++.so (which depends on libc++abi.so) (additionally specify -pthread if threads are used): `clang++ -stdlib=libc++ -nostdlib++ a.cc -lc++ -lc++abi` (clang -stdlib=libc++ a.cc -lc++ -lc++abi does not pass -lm to the linker.) Omitting `-lc++abi` most works, but can fail if your program reference some definitions in `<exception> <stdexcept>` directly and you are using gold or LLD. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96070/new/ https://reviews.llvm.org/D96070 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits