Hello!

>  Either change your test file to .cpp, or add "-x c++" to the command-line.

that worked. thank you.

I don't want to limit my plugin to C++. But to start with it is ok.

> The major issue is to understand all the details of GCC internal 
> representations (i.e. Trees, Gimples). Did you understand them?

I don't understand anything about the internal representations yet. I
don't even know which representation I am currently parsing.

I want to get started. If you have any advice it is welcome.

I have read the "Gcc internals" manual. It is well written but it
doesn't have much example code. Do you know about any simple example
code?

Regards,
Daniel


2011/1/23 Dave Korn <dave.korn.cyg...@gmail.com>:
> On 23/01/2011 10:58, Daniel Marjamäki wrote:
>
>> I fail to use 'global_namespace':
>> daniel@daniel:~/gcc/build/gcc$ ./xgcc -fplugin=./myplugin2.so -c test1.c
>> cc1: error: cannot load plugin ./myplugin2.so
>
>  You're running the C compiler (cc1) here, not the C++ one (cc1plus), because
> you've passed a file with the plain .c extension to the driver.
>
>> ./myplugin2.so: undefined symbol: global_namespace
>
>  So it doesn't have this global variable that only exists in cc1plus.
>
>  Either change your test file to .cpp, or add "-x c++" to the command-line.
>
>  In general, as long as your plugin refers to global_namespace directly, it's
> not going to be compatible with any of the other language sub-compilers apart
> from cc1plus.  If you wanted it to work with any kind of language, I think
> you'd need to look up global_namespace using dlsym (and handle the case when
> it was not found), rather than linking against it directly.
>
>    cheers,
>      DaveK
>
>

Reply via email to