Hi Oliver.
Thanks for the quick replies!
On 27 September 2012 02:14, Oliver Schwahn <
schw...@rbg.informatik.tu-darmstadt.de> wrote:
> Hi,
>
>
> So, what I'm currently using CIL for in my tool is to preprocess the
>> source file under analysis to make it easier to analyze -- or at least,
>> that's the hope.
>>
>
> Ok, so you just want the merged C source as output? No compilation or
> linking?
>
>
Ideally, yes.
>
> I'm interfacing with Cilly through Python. This is the command that I am
>> constructing:
>>
>> "cilly --merge --extrafiles=tmp foo.c -o foo.out"
>>
>> where "tmp" is the file that contains the names of the files to be merged
>> with "foo.c". Currently, it links the file that is produced as a result of
>> the merge. Adding the "-c" flag (and removing "-o foo.out") prevents Cilly
>> from linking, but for some reason, Cilly stops and only produces the *.i
>> file, so I'm not sure what exactly I'm doing wrong.
>>
>
> Well, the problem is that the "-c" flag is interpreted by the cilly script
> which mimics gcc behavior and "compiles" the input file. Compiling means
> here that the input file is preprocessed and the resulting code is written
> to an *.o file. The actual merger (i.e. the CIL executable) is never
> invoked! In order to merge files using cilly, you must tell it to "link"
> them.
>
Ah okay, thanks for the clarification! That is an interesting way to do
things. Hm...
> I think the only way to prevent cilly from invoking gcc for actual
> compilation and linking is to use the environment variables:
> CILLY_DONT_COMPILE_AFTER_MERGE which prevents invoking gcc for compilation
> and linking or CILLY_DONT_LINK_AFTER_MERGE which prevents invoking gcc for
> linking.
>
> I'd construct a shell command that looks like this:
> "CILLY_DONT_COMPILE_AFTER_**MERGE=1 cilly --merge --extrafiles=tmp
> --merged_out=foo_merged.c foo.c"
>
> It merges all files and puts the result in the file "foo_merged.c" without
> invoking gcc for compilation or linking.
> This works perfectly if used in a shell like bash. Not sure if this kind
> of command invocation also works with python.
>
>
>
That sounds like it could work. I can try it out and let you know.
> There is also another way to get your files merged! You can use the CIL
> executable directly rather than going through the cilly Pearl script. This
> solution, however, may be less comfortable since you must do all
> preprocessing and file handling yourself.
>
> You can use a command like this:
> "cilly.asm.exe --mergedout foo_merged.c --extrafiles tmp.txt foo.i"
>
> It merges all files into foo_merged.c using the CIL executable. Note the
> different command line option syntax and that all input files must be
> already preprocessed.
>
>
Yeah. It might be better to try to use the Cilly Perl script directly.
Thanks!
>
> Hope this helps.
> Cheers!
> Oliver
>
>
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
CIL-users mailing list
CIL-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cil-users