Skip to content
Snippets Groups Projects

Checker updates for LTO, etc.

  1. Apr 24, 2024
    • scott snyder's avatar
      Fixes to allow specifying the checker plugin on the link command with LTO. · 2dc3d98d
      scott snyder authored
      In the cmake builds, the -fplugin switch will be given for both
      the compile and link steps.  Normally, when that switch is given
      during linking, it will not have any effect.  But if link-time
      optimization (LTO) is being done, then the compiler will run at link
      time and the plugin gets loaded.  The problem then is that it's not
      the full compiler that runs, but only the middle/backend.  If the
      plugin references symbols from the frontend, then it will fail
      to load during the link step, causing the link to fail.
      (gcc will load the plugin with RTLD_NOW.)
      
      To resolve this, we launder references to FE symbols through
      the shims defined here, which access the symbols via dlsym().
      If the first symbol is missing then we return gracefully and
      disable the checkers.
      2dc3d98d
    • scott snyder's avatar
      Fix for running checkers with LTO enabled. · db4b2598
      scott snyder authored
      The free_lang_data pass runs just after gimplification
      (and before the conversion to SSA).  Normally, it doesn't do much,
      but if LTO is enabled, then it will free the C++-specific parts
      from the types and declarations.  However, the thread checker
      relies on this information.  Further, dataflow analysis requires that
      the SSA conversion has taken place, so we can't just shift it
      to before free_lang_data.  But it doesn't really matter that much
      exactly where free_lang_data runs, so we instead move it to slightly
      later, after the checker runs.
      db4b2598
    • scott snyder's avatar
      CheckerGccPlugins: Add tests for compiling with LTO on. · c7359ade
      scott snyder authored
      Add tests for compiling with LTO on, and a test for linking with LTO.
      Also update C++ standard selection to C++20.
      c7359ade
  2. Apr 04, 2024
Loading