|
|
Rafael Espindola wrote:
However, I thought that the plugin dogma above is absolutely essential to
the GCC community. If it is, something should explain or suggest it in the
documentation, IMHO.
Yes, but being unstable is not the same as being unavailable :-)
Ideally an installed gcc should contain all that is necessary to build
a plugin. Currently the only know exception is gentype and that should
not be very hard to fix.
It could perhaps be not that easy, since gengtype requires a
gcc-source-dir and a gcc-file-list arguments, even in plugin mode. Some
thoughts and experiments on that.
First I made a tiny test which does not work
gccplugins=$(gcc-trunk print-file-name=plugin)
# the ** is zsh syntax for a find
ls $gccplugins/**/*.h > /tmp/list-of-plugin-headers
touch empty.h
gengtype -p $gccplugins/include /tmp/list-of-plugin-headers empty.h
it fails with
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:34:
unidentified type `bitmap_head'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:37:
unidentified type `bitmap'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:90:
unidentified type `bitmap_iterator'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:129:
unidentified type `gimple_seq'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:130:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:137:
unidentified type `tree'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:138:
unidentified type `location_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:150:
unidentified type `edge'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:261:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:262:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:266:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:267:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:275:
unidentified type `gimple_seq'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:278:
unidentified type `gimple_seq'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:281:
unidentified type `basic_block'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:377:
unidentified type `basic_block'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/basic-block.h:378:
unidentified type `basic_block'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/config/i386/i386.h:2404:
unidentified type `rtx'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/double-int.h:58:
type `double_int' previously defined
/usr/src/Lang/gcc-trunk-bstarynk/gcc/gengtype.c:3671: previously defined
here
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:69:
unidentified type `location_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:155:
unidentified type `VEC_tree_gc'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:156:
unidentified type `varray_type'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:157:
unidentified type `varray_type'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:482:
unidentified type `htab_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:510:
unidentified type `htab_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:510:
option `param_is' may only be applied to structures or structure pointers
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:519:
unidentified type `location_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/function.h:522:
unidentified type `location_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/gimple.h:308:
unidentified type `location_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/hard-reg-set.h:53:
unidentified type `HARD_REG_ELT_TYPE'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/input.h:53:
unidentified type `source_location'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/sbitmap.h:48:
unidentified type `SBITMAP_ELT_TYPE'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/sbitmap.h:49:
unidentified type `SBITMAP_ELT_TYPE'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/tree-ssa-operands.h:30:
unidentified type `ssa_use_operand_t'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/vec.h:466:
parse error: expected '(', 'GTY', or an identifier, have 'VEC'
/usr/local/lib/gcc-trunk/gcc/x86_64-unknown-linux-gnu/4.5.0/plugin/include/vec.h:501:
unexpected character `~'
Unless I am mistaken, the gcc-file-list argument (usually
gtyp-input.list in the build directory) to gengtype contains several
header files in the build directory, eg auto-host.h & options.h; both
are installed in plugin/include.
However, it seems that every file listed in gtyp-input.list is copied in
plugin/include
This suggests to perhaps install that list of files (under
$gccplugins/include) as $gccplugins/gtyp-input-plugins.list
I tried to run
gengtype -p $gccplugins/include $gccplugins/gtyp-input-plugins.list empty.c
and it gives only warnings, no more errors.
warning: structure `loop' used but not defined
warning: structure `language_function' used but not defined
warning: structure `loops' used but not defined
warning: structure `eh_status' used but not defined
warning: structure `initial_value_struct' used but not defined
warning: structure `rtx_constant_pool' used but not defined
warning: structure `temp_slot' used but not defined
warning: structure `gimple_df' used but not defined
warning: structure `call_site_record_d' used but not defined
warning: structure `elt_list' used but not defined
warning: structure `lang_tree_node' used but not defined
warning: structure `lang_decl' used but not defined
warning: structure `lang_type' used but not defined
warning: structure `die_struct' used but not defined
warning: structure `ptr_info_def' used but not defined
warning: structure `fixed_value' used but not defined
warning: structure `real_value' used but not defined
warning: structure `tree_ann_d' used but not defined
warning: structure `stack_local_entry' used but not defined
warning: structure `rtvec_def' used but not defined
warning: structure `rtx_def' used but not defined
warning: structure `loop' used but not defined
warning: structure `language_function' used but not defined
warning: structure `loops' used but not defined
warning: structure `eh_status' used but not defined
warning: structure `initial_value_struct' used but not defined
warning: structure `rtx_constant_pool' used but not defined
warning: structure `temp_slot' used but not defined
warning: structure `gimple_df' used but not defined
warning: structure `call_site_record_d' used but not defined
warning: structure `elt_list' used but not defined
warning: structure `lang_tree_node' used but not defined
warning: structure `lang_decl' used but not defined
warning: structure `lang_type' used but not defined
warning: structure `die_struct' used but not defined
warning: structure `ptr_info_def' used but not defined
warning: structure `fixed_value' used but not defined
warning: structure `real_value' used but not defined
warning: structure `tree_ann_d' used but not defined
warning: structure `stack_local_entry' used but not defined
warning: structure `rtvec_def' used but not defined
warning: structure `rtx_def' used but not defined
This is perhaps better. No gt-empty.h is produced because the plugin is
empty!
I tried next with a simple testgty.c file containing
struct GTY(()) testgty_st
{
int x;
tree t;
gimple g;
};
static GTY(()) struct testgty_st *stptr;
Yes, I know that there is no code, and #include-s are missing. But
gentype don't care.
And then I did run
gengtype -p $gccplugins/include $gccplugins/gtyp-input-plugins.list
testgty.c
and I got no errors, and an apparently correct gt-testgty.h
All this makes me think that
A. we should generate appropriately a $gccplugins/gtyp-input-plugins.list
B. we should install gengtype as gcc-gengtype at some appropriate place
C. we should document that, and update the documentation on how to build
plugins.
Does all that make some sense?
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} ***
|
|