gcc (afaict all available versions) emerge breaks with gcc-plugins in short-notation in CFLAG. The plugin is not available, i.e. during libgcc stage1 build, I assume due to changed root/plugin-include directories during staging. It seems to work when including the plugin with the full path though. Reproducible: Always Steps to Reproduce: 1. Install an arbitrary gcc-plugin 2. Include it in CFLAGS using short plugin name 3. Rebuild gcc 4. gcc build breaks due to inaccessible plugin Actual Results: cc1: fatal error: inaccessible plugin file plugin/<plugin-name>.so expanded from short plugin name <plugin-name>: No such file or directory I'm not sure what the expected behavior is, probably either one of 1) strip gcc-plugins plugins entirely during gcc rebuild (current flag-o-matic strip-flags has -fplugin in its ALLOW_LIST though) 2) Use pre-existing gcc-plugins during gcc rebuild (this would require honoring the existing plugin-dir in all but may also break on gcc plugin ABI changes) 3) rebuild plugins as part of the gcc staging (https://gcc.gnu.org/onlinedocs/gccint/plugins/building-gcc-plugins.html seems to indicate that gcc would have access to necessary headers to rebuild a plugin [if needed?]) But in any case, some sort of gcc-plugin handling seems to be required.
I've only ever used a manual GCC plugin once. Otherwise, just the stuff in the kernel. Could you give a full example which I can use (inc. actual *FLAGS)? Ideally including some dummy GCC plugin too (or show me where to find one).