patch ping^3: gengtype: improved version for plugin support.

Duncan Sands baldrick@free.fr
Wed Sep 2 12:38:00 GMT 2009


Hi Basile,

> At last, in this patch I voluntarily added a possible misfeature (but 
> documented both in comments and in *.texi documentation the known 
> weakness): As you should know, gengtype requires an explicit list of 
> files. In the http://gcc.gnu.org/ml/gcc/2009-07/msg00090.html thread, I 
> suggested having gtyp-input.list contain only absolute path names, but 
> Ian Taylor and others told that there are rare occasions (e.g. 
> automount-ed file systems) where this does not work. So I added an 
> additional gtyp-real-input.list which contains real paths (so is subject 
> to the weakness Ian explained) only for possible plugin users needing 
> gengtype, but I also documented that this might not work both in 
> plugins.texi and in Makefile.in comments. Could that be ok? I believe 
> that an insatisfactory solution (my gtyp-real-input.list generated file, 
> which is rarely useful, since most people don't compile plugins needing 
> GGC, but which probably should work in the usual case of non-automounted 
> file systems.) is better than no solution at all (otherwise, people have 
> to patch their gtyp-input.list by hand in all cases).

I've discovered a problem with the trick of changing directory to the
gcc build directory before running gengtype with gtyp-input.list.  Since
the input and output files will be somewhere else, you get paths turning
up in the generated names, for example:

EXPORTED_CONST struct ggc_root_tab 
gt_pch_rc__home_duncan_LLVM_gcc_plugin_gt_llvm_cache_h[] = {

This then makes it a pain to refer to them.

One solution would be your suggested change above (since you wouldn't
need to change directory, there need be no path in the input file name).
Another would be to only use the basename of the plugin file when
generating these names.

Ciao,

Duncan.



More information about the Gcc-patches mailing list