This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Help needed with loading a gcc plugin


Hi guys,

I am trying to run a gcc plugin that I created. I have followed the
steps mentioned in the followiing tutorial to create the plugin

http://lwn.net/Articles/457543/

I am able to successfully build the plugin shared object. However, I
can not run the plugin. It gives errors related to undefined symbols.
Below is the terminal snippet.

sandeep@ubuntu:~/myplugin$ /usr/bin/gcc
-fplugin=/home/sandeep/myplugin/speller.so -c test.c
cc1: error: cannot load plugin /home/sandeep/myplugin/speller.so
/home/sandeep/myplugin/speller.so: undefined symbol: warning_at

I can see that the mentioned symbol is indeed undefined using following

sandeep@ubuntu:~/myplugin$ nm -D -C speller.so | grep warning_at
U warning_at

And I see that

sandeep@ubuntu:/usr/lib/gcc/x86_64-linux-gnu/4.7.2$ pwd
/usr/lib/gcc/x86_64-linux-gnu/4.7.2
sandeep@ubuntu:/usr/lib/gcc/x86_64-linux-gnu/4.7.2$ nm -D -C $(gcc
-print-file-name=cc1) | grep "warning_"
0000000000c1e5a0 T warning_at(unsigned int, int, char const*, ...)

What am I missing? How should I link the libraries correctly?

Please help.

Thanks,
Sandeep.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]