Comments

Hello All,
Now that gengtype has been improved for plugins, it becomes a user
visible program (for those brave users coding plugins) we need to install it.
As Alexander Oliva told me at the GCC summit, we can install it at the
same place as cc1.
There is also a typo (suscpiscous tab character detected by Emacs near line 3735)
############## patch to trunk 167150
################### gcc/ChangeLog entry
2010-11-25 Basile Starynkevitch <basile@starynkevitch.net>
* Makefile.in (ADDITIONAL_BUILD_PROGRAMS): New variable.
(install-common): Also install $(ADDITIONAL_BUILD_PROGRAMS) and
use $(notdir).
###################
Ok for trunk with what changes?
Cheers

On Thu, 25 Nov 2010 20:28:20 +0100
Basile Starynkevitch <basile@starynkevitch.net> wrote:
> Now that gengtype has been improved for plugins, it becomes a user> visible program (for those brave users coding plugins) we need to install it.
In addition, we might need a testcase for gengtype, since it is a user
program, and we can now test it in plugin mode. However, I am not
familiar enough with dejagnu to propose one. Could someone help please?
What should be the form of a testcase for gengtype in plugin mode?
I would imagine that we could run it in plugin mode on a tiny plugin.c
containing some GTY, and request the resulting generated gt-plugin.h to
contain so expected regular expression (or just some expected words)
but I don't know how to code that.
Besides, such a testcase example would be useful when adding new
features into gengtype. For instance (but I don't say I want to do
that), adding support for C++ GTY-ed types should very probably first
be tested for plugins, and only later could we accept GTY-ing C++ code
in the core of GCC.
Cheers.
PS. Is gcc-patches@ the right list to ask for help on dejagnu code I am
not able to write?

On Thu, 25 Nov 2010, Basile Starynkevitch wrote:
> +# Additional build executables to be installed.> +ADDITIONAL_BUILD_PROGRAMS= build/gengtype$(build_exeext)
It is definitely wrong to install anything built for the build system.
Anything installed in libexecsubdir should be built for the host, not the
build system.

On Thu, 25 Nov 2010 22:20:40 +0000 (UTC)
"Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Thu, 25 Nov 2010, Basile Starynkevitch wrote:> > > +# Additional build executables to be installed.> > +ADDITIONAL_BUILD_PROGRAMS= build/gengtype$(build_exeext)> > It is definitely wrong to install anything built for the build system. > Anything installed in libexecsubdir should be built for the host, not the > build system.
Ok, but what do you suggest instead?
At least in the usual straight (= non cross-compiler) case, gengtype is becoming a user visible program of GCC, since users coding plugins need it.
How and how should it be installed, at least in that case?

On Fri, 26 Nov 2010 00:38:12 +0100
Basile Starynkevitch <basile@starynkevitch.net> wrote:
> > At least in the usual straight (= non cross-compiler) case, gengtype is becoming a user visible program of GCC, since users coding plugins need it.> > How and how should it be installed, at least in that case?
Sorry, I mean
How and whee should it be installed, at least in that case?
Cheers

On Fri, 26 Nov 2010, Basile Starynkevitch wrote:
> On Thu, 25 Nov 2010 22:20:40 +0000 (UTC)> "Joseph S. Myers" <joseph@codesourcery.com> wrote:> > > On Thu, 25 Nov 2010, Basile Starynkevitch wrote:> > > > > +# Additional build executables to be installed.> > > +ADDITIONAL_BUILD_PROGRAMS= build/gengtype$(build_exeext)> > > > It is definitely wrong to install anything built for the build system. > > Anything installed in libexecsubdir should be built for the host, not the > > build system.> > Ok, but what do you suggest instead?
If you wish to install gengtype, you must build it twice, for both the
build and host systems, use the build-system copy as part of the build
process but install the host-system copy. This is just like what is done
with fixincludes: the build-system copy is used in the build process but
the host-system copy is installed for potential later use in regenerating
fixed headers after changes in system headers.

On Fri, 26 Nov 2010 00:18:09 +0000 (UTC)
"Joseph S. Myers" <joseph@codesourcery.com> wrote:
> If you wish to install gengtype, you must build it twice, for both the > build and host systems, use the build-system copy as part of the build > process but install the host-system copy. This is just like what is done > with fixincludes: the build-system copy is used in the build process but > the host-system copy is installed for potential later use in regenerating > fixed headers after changes in system headers.
Are you suggesting to install gengtype under $(libexecsubdir)/install-tools
as in fixincludes/Makefile.in?
Or where?
Cheers

On Fri, 26 Nov 2010, Basile Starynkevitch wrote:
> On Fri, 26 Nov 2010 00:18:09 +0000 (UTC)> "Joseph S. Myers" <joseph@codesourcery.com> wrote:> > If you wish to install gengtype, you must build it twice, for both the > > build and host systems, use the build-system copy as part of the build > > process but install the host-system copy. This is just like what is done > > with fixincludes: the build-system copy is used in the build process but > > the host-system copy is installed for potential later use in regenerating > > fixed headers after changes in system headers.> > Are you suggesting to install gengtype under $(libexecsubdir)/install-tools > as in fixincludes/Makefile.in?
plugin-tools would be a better name than install-tools.

2010/11/25 Basile Starynkevitch <basile@starynkevitch.net>:
> What should be the form of a testcase for gengtype in plugin mode?> I would imagine that we could run it in plugin mode on a tiny plugin.c> containing some GTY, and request the resulting generated gt-plugin.h to> contain so expected regular expression (or just some expected words)> but I don't know how to code that.
Or have some little source file that includes gt-plugin.h and fails to
compile if any of the expected symbols are undefined.
I am not familiar with dejagnu, so I cannot offer further advice.

On Fri, 26 Nov 2010 02:33:56 +0000 (UTC)
"Joseph S. Myers" <joseph@codesourcery.com> wrote:
> On Fri, 26 Nov 2010, Basile Starynkevitch wrote:> > > On Fri, 26 Nov 2010 00:18:09 +0000 (UTC)> > "Joseph S. Myers" <joseph@codesourcery.com> wrote:> > > If you wish to install gengtype, you must build it twice, for both the > > > build and host systems, use the build-system copy as part of the build > > > process but install the host-system copy. This is just like what is done > > > with fixincludes: the build-system copy is used in the build process but > > > the host-system copy is installed for potential later use in regenerating > > > fixed headers after changes in system headers.> > > > Are you suggesting to install gengtype under $(libexecsubdir)/install-tools > > as in fixincludes/Makefile.in?> > plugin-tools would be a better name than install-tools.
I am not able to propose a patch which install gengtype (& gtype.state)
appropriately. I just opened PR 46828 to get some help.
Sorry ladies & gentlemen, I am not able to work out that alone (and I
still guess that for people understanding GCC build machinery, it is a
very small patch).
Cheers.