On Tue, 19 Jul 2011 16:09:59 +0200 Romain Geissler <romain.geiss...@gmail.com> wrote:
> Hi, > > Melt is creating annoying *.c files next to the .so module file, and i > just can no > longer handle temporary files polluting my final binary directory. > Here is a simple patch > that allow the user to give an explicit coutput file path in all > translateto* modes. > > By the way, trying to reach the C sources files and checking their > checksum with the loaded > .so module just don't make sense to me. This task should be done by a > proper Makefile by > the plugin developer, not by Melt. Gcc won't tell you that your file.o > is outdated because > file.c has changed, there is no reason for melt to act otherwise. There is a major reason that MELT manage by itself its generated *.c & *.so by itself. You should not think of it as a "front-end"; it is not one (and even if some future GCC accepted front-ends from plugin, I'm not sure I would follow that route). The point is that MELT can (and may, and should) generate .c files, and then run its internal make to get a .so module, independenty of any MELT source file. They are several scenarii where MELT may want to generate a set of .c files (and then generate using make a single *.so module from them, and then dlopen that module) without any .melt input file. My GCC summit 2007 "Multi-Stage Construction of a Global Static Analyzer" paper give some motivations for that. My DSL11 paper also. In addition, there is today the runfile mode which does generate a .c and its .so file. 2011-07-19 Romain Geissler <romain.geiss...@gmail.com> * melt/warmelt-outobj (translatetomodule_docmd): Override default C source filename if coutput argument is defined. Add this new argument in the help text. (translatedebug_docmd): Likewise. (translatequickly_docmd): Likewise. * melt-runtime.c (mlet_argument): Allow the new coutput argument. * common.opt: Define a new coutput melt argument. I applied that patch with reluctance; I'm not sure it is the good way to go. Maybe a better way would be to pass a -fmelt-plugin-arg-privatedir=your/dir/ to MELT and have it generate the .c, .pic.o, .so files inside. Romain, you might try to call me tomorrow. It will be easier for both of use to speak on the phone & in French. (Or else, give me again your number & hours to call by private email). Cheers. -- 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 mine, sont seulement les miennes} ***