Open Bug 1487070 Opened 6 years ago Updated 2 years ago

Try using -fplugin=path to load clang plugin

Categories

(Firefox Build System :: General, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: ted, Unassigned)

Details

glandium noted that sccache currently doesn't do anything special with clang plugins, which means that if we change the plugin it effectively won't get run on sources where we get cache hits. I filed an sccache issue on this:
https://github.com/mozilla/sccache/issues/288

Unfortunately right now we load the clang plugin in our build using a pile of `-Xclang` options, which will be a PITA to parse in sccache:
https://dxr.mozilla.org/mozilla-central/rev/9c13dbdf4cc9baf98881b4e2374363587fb017b7/build/autoconf/clang-plugin.m4#160

The clang docs do mention that you can use `-fplugin=path`, which might be a newer invention:
https://clang.llvm.org/docs/ClangPlugins.html#using-the-clang-command-line

We should try using that instead, since it should be much easier to support in sccache.
We also pass `-Xclang -add-plugin -Xclang moz-check`, but the docs say we can write the plugin so that it gets added automatically:
https://clang.llvm.org/docs/ClangPlugins.html#using-the-clang-command-line
(In reply to Ted Mielczarek [:ted] [:ted.mielczarek] from comment #2)
> We also pass `-Xclang -add-plugin -Xclang moz-check`, but the docs say we
> can write the plugin so that it gets added automatically:
> https://clang.llvm.org/docs/ClangPlugins.html#using-the-clang-command-line

Except we have one plugin that does several things, that we select with -add-plugin. We have moz-check and mozsearch-index. And the latter takes plugin arguments, which I don't think can be handled when registering the plugin "automatically".
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.