This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
How to write GCC plugin for avr-gcc
- From: Sandeep K Chaudhary <babbusandy2006 at gmail dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Sat, 12 Jul 2014 22:03:05 -0400
- Subject: How to write GCC plugin for avr-gcc
- Authentication-results: sourceware.org; auth=none
Hi guys,
I have a plugin which works for my simple test programs. And, I load
the plugin as
g++ -fplugin=path_to_plugin_so/plugin.so -c test_prog.c
However, the end goal of my plugin is to work with avr-gcc for
embedded programs.
Basically, the typical compilation step of a simple embedded program
(lets say em_prog.c) is
avr-gcc -mmcu=atmega8 em_prog.c
where atmega8 is the host micro-controller name.
My question is - how do I now make my plugin work with '-mmcu=atmega8'
option and with avr-gcc?
I tried
g++ -fplugin=path_to_plugin_so/plugin.so -mmcu=atmega8 -c test_prog.c
and
avr-gcc -fplugin=path_to_plugin_so/plugin.so -mmcu=atmega8 -c test_prog.c
But none of these work.
Can someone please help me with it? I am badly stuck at this point.
Thanks and regards,
Sandeep.