This is the mail archive of the gcc-patches@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: forcing most functions of libiberty in plugin-enabled cc1


Richard Guenther wrote:
On Wed, Nov 25, 2009 at 4:47 PM, Basile STARYNKEVITCH
<basile@starynkevitch.net> wrote:
Hello All,

A plugin using a function in libiberty like make_temp_file fail to be
dlopen-ed, because cc1 don't have it.

We did discuss in
  http://gcc.gnu.org/ml/gcc/2009-07/msg00166.html &
  http://gcc.gnu.org/ml/gcc/2009-07/msg00157.html
the usefulness of linking all (or at least most of) libliberty.a inside cc1
for plugin usage.

This is completely broken. Instead link libiberty.a with --whole-archive when plugins are enabled.


That won't work on non-binutils systems (AFAIK --whole-archive is a binutils options to the linker), and the point of libiberty is precisely to provide a portability layer.
http://gcc.gnu.org/ml/gcc/2009-07/msg00174.html
http://gcc.gnu.org/ml/gcc/2009-07/msg00175.html


I do agree that the patch is quick & dirty. But:

* it is portable AFAIK (since they is no language tricks)

* it should work on any (even obscure) plateform

* the only thing impacted is the resulting cc1 binary size. No additionnal code is executed!

I would like some comments by people familiar with non-linux systems (and systems whose linkers is not the binutils one) providing a dlopen. Of course, if we only targeted linux (which I would be happy with) the proposed patch is crap.

Regards.


-- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***


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