[clang] [clang][fatlto] Only run sanitzer passes in prelink pipelines (PR #160213)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 26 15:15:06 PDT 2025


================
@@ -700,7 +700,12 @@ static void addSanitizers(const Triple &TargetTriple,
                           const CodeGenOptions &CodeGenOpts,
                           const LangOptions &LangOpts, PassBuilder &PB) {
   auto SanitizersCallback = [&](ModulePassManager &MPM, OptimizationLevel Level,
-                                ThinOrFullLTOPhase) {
+                                ThinOrFullLTOPhase phase) {
+    // FatLTO pipelines already added these to the prelink pipeline.
+    if (CodeGenOpts.FatLTO &&
+        (CodeGenOpts.PrepareForThinLTO || CodeGenOpts.PrepareForLTO) &&
+        ThinOrFullLTOPhase::None != phase)
----------------
ilovepi wrote:

Well, the build passed https://ci.chromium.org/ui/p/fuchsia/builders/try.shadow/core.x64-lto/b8702634878448393969/overview. The only failures were 2 known flakes, so I guess its maybe safe enough. I'll update this PR to try that method and see if it also avoids the warning issues correctly. I'll also check the WPD issues aren't showing up in either Thin or Full LTO . I may not get this finished until early next week though.

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


More information about the cfe-commits mailing list