Romain Geissler <romain.geiss...@gmail.com> writes: > This new build behavior broke former plugins built with gcc. Indeed, > all cc1 function symbols are now mangled and thus with the current > trunk, plugins should also look for mangled symbols (and so built > with g++). > > What's the new GCC policy about that ? Do plugins have to be built > using g++ only, or does the plugin developer have the choice to > use both gcc and g++ according to it's need (at the cost of adding > extern "C" {…} in almost every headers to forbid mangling) ?
I think that ideally we would have a well-defined plugin interface, plugins would stick to calling that, and that interface would be a C interface. (I see that gcc-plugin.h does already provide a C interface even when gcc is compiled with C++.) However, since we currently permit plugins to call anything in gcc, I think the answer is going to have to be that plugins which do that should be compiled with C++. I don't think that adding extern "C" to all gcc header files is the right approach. Adding extern "C" to a few selected header files seems fine. Ian