[clang] [Darwin][Driver] Avoid duplicate -lc++ with -fsanitize=fuzzer (PR #161304)

Dan Blackwell via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 30 03:17:40 PDT 2025


================
@@ -1609,7 +1609,12 @@ void DarwinClang::AddLinkRuntimeLibArgs(const ArgList &Args,
     if (Sanitize.needsFuzzer() && !Args.hasArg(options::OPT_dynamiclib)) {
       AddLinkSanitizerLibArgs(Args, CmdArgs, "fuzzer", /*shared=*/false);
 
-        // Libfuzzer is written in C++ and requires libcxx.
+      // Libfuzzer is written in C++ and requires libcxx.
+      // Since darwin::Linker::ConstructJob already adds -l++ for clang++
----------------
DanBlackwell wrote:

Should this be `lc++`?

https://github.com/llvm/llvm-project/pull/161304


More information about the cfe-commits mailing list