This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Working with frontend-specific aspects of GCC from a GCC plugin


>>>>> "David" == David Malcolm <dmalcolm@redhat.com> writes:

David> I maintain gcc-python-plugin [1].  I'm hoping to expose the function
David> decl_as_string() from the C++ frontend from within my plugin.

I think this problem was discussed before, either here or on
gcc-patches, I forget.

David> (b) somehow set things up within the ELF metadata or linkage flags so
David> that the symbols aren't immediately needed at dynamic-link time, and
David> make sure that they only ever get called from frontends that provide
David> them (and cross our fingers and hope that the missing functions are
David> never actually called).  Not yet sure if this is feasible.  Again, this
David> raises the question of how to determine what frontend we're a plugin
David> for.

One idea that came up was to redeclare the FE-specific functions as
'weak', then check to see if they are available at runtime before
calling them.  It seems like a pain to me, since you have to rewrite the
declarations, but I guess it could work.  You could maybe write a plugin
to write out the declarations :)

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]