Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GCC Compile- and Link-Stage Intervene Plugin

5 views
Skip to first unread message

Nordlöw

unread,
Oct 21, 2011, 5:47:34 PM10/21/11
to
Is it possible to write a GCC plugin that intervenes the

1. Compilation stage when it encounters
an undefined symbol or
an #include reference to a non-existing file?
2. Linking stage when a undefined reference error occurs?

I want to use this to auto-lookup distribution package(s) that provide the missing header-file or library-symbol. The second case requires an elaborate pre-scanning of all symbols present in all libraries of all the packages the can be installed on a given distribution, in my case Linux.

Andrew Haley

unread,
Oct 22, 2011, 5:22:49 AM10/22/11
to
I've never seen anything like this. The first case is impossible or
very hard: there are multiple versions of symbols, and the C
preprocessor can have a profound impact on the meaning a program, so
you'd have to restart the compilation. Also, I don't think there are
any hooks provided for the language front-ends. The second would, I
think. be easier, but I haven't seen such a thing.

Andrew.

Nordlöw

unread,
Oct 29, 2011, 12:19:56 PM10/29/11
to
Ok. Thanks. Good to know that there a no GCC front-end plugins. I just realized that in the case of Ubuntu and Fedora if the first case is automated by some install-deps-and-recompile typically using development library package providing the headers the library itself will also be automatically installed thus in turn fixing the second case.
0 new messages