[clang] [LinkerWrapper][Driver] Do not parse GNU options for MSVC-style linkers (PR #243300)

Srividya Sundaram via cfe-commits cfe-commits at lists.llvm.org
Sun Dec 6 07:25:26 PST 2026


================
@@ -10069,6 +10042,13 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
     }
   }
 
+  // Pass the host linker flavor to the wrapper. Only MSVC is supported for
+  // now; add other flavors here when they need special handling.
+  if (LinkerFlavor Flavor = Linker->getLinkerFlavor();
----------------
srividya-sundaram wrote:

Nit: Could this be `if (Flavor != LinkerFlavor::GNU)`?
The wrapper already uses `gnu` when there's no `--linker-flavor=`, so the driver only needs to pass `--linker-flavor=` when the flavor isn't `gnu`.
A new flavor then gets passed without changing this line, and the "Only MSVC is supported for now" comment can go.

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


More information about the cfe-commits mailing list