Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 926160

Summary: sys-devel/gcc: gcc does not honor installed gcc-plugins in short notation
Product: Gentoo Linux Reporter: Christian Tramnitz <christian+gentoo-bugzilla>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED NEEDINFO    
Severity: normal CC: sam
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Christian Tramnitz 2024-03-04 13:44:45 UTC
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.
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-03-05 01:13:41 UTC
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).