Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Jonathan Wakely
On 6 June 2011 18:35, Basile Starynkevitch wrote: > > This is why I thought that "modularization" is a distant goal: in my > very naive opinion, it would mean removing important global data like > lang_hook, and I still believe that such a patch would be very big: one > can't remove that variable l

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Basile Starynkevitch
On Mon, 06 Jun 2011 10:41:49 -0400 Robert Dewar wrote: > On 6/6/2011 10:33 AM, Joseph S. Myers wrote: > > >> Now, if we wanted to pack all the state of GCC inside some (very few, > >> perhaps only one) variable, we would have to change most of the functions > >> inside it. Perhaps the patch woul

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Robert Dewar
On 6/6/2011 10:33 AM, Joseph S. Myers wrote: Now, if we wanted to pack all the state of GCC inside some (very few, perhaps only one) variable, we would have to change most of the functions inside it. Perhaps the patch would be cosmetic, but it certainly would be very big. I can't see any reaso

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Joseph S. Myers
On Mon, 6 Jun 2011, Basile Starynkevitch wrote: > Then, I don't understand what modularization should be. My point is, imagine > we want to get rid of most global variable and state (and indeed, we I don't think this is what most people mean by modularization, although maybe some people want to

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Basile Starynkevitch
On Mon, Jun 06, 2011 at 12:55:20PM +, Joseph S. Myers wrote: > On Wed, 1 Jun 2011, Basile Starynkevitch wrote: > > > In my view, you are talking of the mythical > > ModularGCC project, > Then, very probably, I Basile don't understand what is called "modularization", and "defining a stable AP

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-06 Thread Joseph S. Myers
On Wed, 1 Jun 2011, Basile Starynkevitch wrote: > In my view, you are talking of the mythical > ModularGCC project, While there is a serious problem with a lack of reviewers reviewing modularization patches (such as Joern's patch to avoid target.h including tm.h, now in its fourth ping

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-01 Thread Basile Starynkevitch
On Wed, 1 Jun 2011 11:18:16 +0200 Richard Guenther wrote: > On Wed, Jun 1, 2011 at 6:03 AM, Basile Starynkevitch > wrote: > > On Tue, 31 May 2011 23:52:11 +0200 > > I don't remember saying no to both. I don't see how the invoking_program > would fix anything (you have that by looking at lang_

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-01 Thread Joern Rennecke
Quoting Richard Guenther : Iff we want to make plugins not randomly fail with -flto (which I think we _do_ want) then it is the plugin loader machines job to check for compatibility and either ignore (in case of lto1 maybe) or reject (in other cases) the plugin. So, I don't think a single MELT

Re: using plugin and lto: problem linking c-pragma symbol

2011-06-01 Thread Richard Guenther
On Wed, Jun 1, 2011 at 6:03 AM, Basile Starynkevitch wrote: > On Tue, 31 May 2011 23:52:11 +0200 > Richard Guenther wrote: > [...] >> I don't see a strong need for cross-language plugins with >> frontend function access - "meta plugins" such as MELT >> may be an exception, but they have to deal w

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-31 Thread Basile Starynkevitch
On Tue, 31 May 2011 23:52:11 +0200 Richard Guenther wrote: [...] > I don't see a strong need for cross-language plugins with > frontend function access - "meta plugins" such as MELT > may be an exception, but they have to deal with that > in a similar way we deal with frontends - have MELT++, MELT

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-31 Thread Richard Guenther
On Tue, May 31, 2011 at 7:17 PM, Basile Starynkevitch wrote: > On Tue, 31 May 2011 10:52:39 +0200 > Richard Guenther wrote: > >>  We could then, >> reasoning with the plugin use, add additional langhooks encapsulating >> functions such as c_register_pragma (possibly under a >> lang_hooks.plugin s

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-31 Thread Basile Starynkevitch
On Tue, 31 May 2011 10:52:39 +0200 Richard Guenther wrote: > We could then, > reasoning with the plugin use, add additional langhooks encapsulating > functions such as c_register_pragma (possibly under a > lang_hooks.plugin substructure). Yes, that perhaps is a good way. But I never understood

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-31 Thread Richard Guenther
On Mon, May 30, 2011 at 11:18 PM, Basile Starynkevitch wrote: > On Mon, 30 May 2011 16:19:31 -0400 > Diego Novillo wrote: > >> On Mon, May 30, 2011 at 13:44, Basile Starynkevitch >> wrote: >> >> > Diego and other people interested in plugins, what do you think of such >> > a proposal? >> >> I do

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-31 Thread Richard Guenther
On Mon, May 30, 2011 at 10:50 PM, Basile Starynkevitch wrote: > On Mon, 30 May 2011 22:15:29 +0200 > Richard Guenther wrote: > >> On Mon, May 30, 2011 at 7:44 PM, Basile Starynkevitch >> wrote: >> > On Mon, 30 May 2011 17:58:48 +0200 >> > Richard Guenther wrote: >> > >> >> You can't use languag

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Basile Starynkevitch
On Mon, 30 May 2011 16:19:31 -0400 Diego Novillo wrote: > On Mon, May 30, 2011 at 13:44, Basile Starynkevitch > wrote: > > > Diego and other people interested in plugins, what do you think of such > > a proposal? > > I don't think that would work. Plugins need to know at what level > they are

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Basile Starynkevitch
On Mon, 30 May 2011 22:15:29 +0200 Richard Guenther wrote: > On Mon, May 30, 2011 at 7:44 PM, Basile Starynkevitch > wrote: > > On Mon, 30 May 2011 17:58:48 +0200 > > Richard Guenther wrote: > > > >> You can't use language specific functions form a plugin that should be > >> usable at link time

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Diego Novillo
On Mon, May 30, 2011 at 13:44, Basile Starynkevitch wrote: > Diego and other people interested in plugins, what do you think of such > a proposal? I don't think that would work. Plugins need to know at what level they are working. FE plugins would have access to functions and data that gimple

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Richard Guenther
On Mon, May 30, 2011 at 7:44 PM, Basile Starynkevitch wrote: > On Mon, 30 May 2011 17:58:48 +0200 > Richard Guenther wrote: > >> On Mon, May 30, 2011 at 5:53 PM, Pierre Vittet wrote: >> > Hello, >> > >> > I try to use the plugin pragma-plugin.c which is given in the testsuite >> > (gcc/testsuite

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Basile Starynkevitch
On Mon, 30 May 2011 17:58:48 +0200 Richard Guenther wrote: > On Mon, May 30, 2011 at 5:53 PM, Pierre Vittet wrote: > > Hello, > > > > I try to use the plugin pragma-plugin.c which is given in the testsuite > > (gcc/testsuite/g++.dg/plugin/pragma_plugin.c), I have compiled it as a > > shared libr

Re: using plugin and lto: problem linking c-pragma symbol

2011-05-30 Thread Richard Guenther
On Mon, May 30, 2011 at 5:53 PM, Pierre Vittet wrote: > Hello, > > I try to use the plugin pragma-plugin.c which is given in the testsuite > (gcc/testsuite/g++.dg/plugin/pragma_plugin.c), I have compiled it as a > shared library. > > If I try it on a simple c file it works, however, if I use -flto