Re: GCC plugin for avr-gcc

Sandeep K Chaudhary <[email protected]>
Newsgroups gmane.comp.hardware.avr.gcc
Message-ID <CAEEAEzXP8XYrBUV7D0MQ1u_Meb5tL72gSLB20Dw50RFFDuyBzQ@mail.gmail.com>
Hi Jeremy,

Sorry I didn't get time to spend on the plugin. I reviewed the code, and
found that it was a silly mistake. Basically, I had written the plugin for
gcc first, and there was a version match check. Since the version is
different for avr-gcc than gcc mainline, it was failing there.

Essentially, a call to "plugin_default_version_check (version,
&gcc_version)" was failing.

Thanks and regards,
Sandeep.


On Thu, Jul 31, 2014 at 2:24 PM, Sandeep K Chaudhary <
[email protected]> wrote:

> Hi Jeremy,
>
> Yeah, the hardest part is over.
>
> I will reply with the failure reason once I resolve it. :)
>
> Thanks again !
>
> Sandeep.
>
>
> On Thu, Jul 31, 2014 at 2:16 PM, Jeremy Bennett <
> [email protected]> wrote:
>
>> On 31/07/14 19:06, Sandeep K Chaudhary wrote:
>> > Thanks for the reply Jeremy !
>> >
>> > Yes, you are right. plugin_init is indeed being called. And I am
>> > returning '0' at the end. That means there is some issue in between. I
>> > will try to figure it out.
>>
>> Hi Sandeep,
>>
>> You've got past the hardest hurdle with a plugin :). I'm baffled why
>> this fails if you are returning zero from plugin_init. Probably
>> something very simple.
>>
>> When you do track it down, I will be interested to know for future
>> reference.
>>
>> Best wishes,
>>
>>
>> Jeremy
>>
>> >
>> > Thanks again,
>> > Sandeep.
>> >
>> >
>> > On Thu, Jul 31, 2014 at 5:29 AM, Jeremy Bennett
>> > <[email protected] <mailto:[email protected]>>
>> wrote:
>> >
>> >     On 31/07/14 06:19, Sandeep K Chaudhary wrote:
>> >     > And also, when I try "fplugin" with avr-gcc or avr-g++, I get the
>> >     > following -
>> >     >
>> >     > sandeep@ubuntu:~/ispec/tool/gcc_plugin/gimple$ avr-gcc
>> >     > -fplugin=/home/sandeep/ispec/tool/gcc_plugin/gimple/plugin.so
>> >     > -mmcu=atmega8 -c ledchase.c
>> >     > cc1: error: fail to initialize plugin
>> >     > /home/sandeep/ispec/tool/gcc_plugin/gimple/plugin.so
>> >     > sandeep@ubuntu:~/ispec/tool/gcc_plugin/gimple$ avr-g++
>> >     > -fplugin=/home/sandeep/ispec/tool/gcc_plugin/gimple/plugin.so
>> >     > -mmcu=atmega8 -c ledchase.c
>> >     > cc1plus: error: fail to initialize plugin
>> >     > /home/sandeep/ispec/tool/gcc_plugin/gimple/plugin.so
>> >     >
>> >     > Does this mean that that the "fplugin" option is present with both
>> >     > avr-gcc and avr-g++ but there is some other problem?
>> >
>> >     Hi Sandeep,
>> >
>> >     I'm pretty sure this is your plugin_init function not behaving
>> >     correctly. Is it returning zero to indicate success?
>> >
>> >     As a simple test, just get it to print something out, so you can
>> verify
>> >     it is being called.
>> >
>> >     HTH,
>> >
>> >
>> >     Jeremy
>> >
>> >     >
>> >     > Please let me know.
>> >     >
>> >     > Thanks a lot,
>> >     > Sandeep.
>> >     >
>> >     >
>> >     >
>> >     >
>> >     > On Wed, Jul 30, 2014 at 3:55 PM, Sandeep K Chaudhary
>> >     > <[email protected] <mailto:[email protected]>
>> >     <mailto:[email protected] <mailto:[email protected]
>> >>>
>> >     wrote:
>> >     >
>> >     >     Here it is :
>> >     >
>> >     >     sandeep@ubuntu:~/ispec$ avr-gcc -v
>> >     >     Using built-in specs.
>> >     >     COLLECT_GCC=avr-gcc
>> >     >     COLLECT_LTO_WRAPPER=/usr/lib/gcc/avr/4.8.2/lto-wrapper
>> >     >     Target: avr
>> >     >     Configured with: ../src/configure -v --enable-languages=c,c++
>> >     >     --prefix=/usr/lib --infodir=/usr/share/info
>> >     --mandir=/usr/share/man
>> >     >     --bindir=/usr/bin --libexecdir=/usr/lib --libdir=/usr/lib
>> >     >     --enable-shared --with-system-zlib --enable-long-long
>> --enable-nls
>> >     >     --without-included-gettext --disable-libssp
>> >     --build=x86_64-linux-gnu
>> >     >     --host=x86_64-linux-gnu --target=avr
>> >     >     Thread model: single
>> >     >     gcc version 4.8.2 (GCC)
>> >     >
>> >     >
>> >     >     Thanks,
>> >     >     Sandeep.
>> >     >
>> >     >
>> >     >     On Wed, Jul 30, 2014 at 9:20 AM, Senthil Kumar Selvaraj
>> >     >     <[email protected]
>> >     <mailto:[email protected]>
>> >     >     <mailto:[email protected]
>> >     <mailto:[email protected]>>> wrote:
>> >     >
>> >     >         On Tue, Jul 29, 2014 at 03:23:24PM -0400, Sandeep K
>> >     Chaudhary wrote:
>> >     >         > Hi Senthil,
>> >     >         >
>> >     >         > Thanks again for your quick response !
>> >     >         >
>> >     >         > On Tue, Jul 29, 2014 at 3:45 AM, Senthil Kumar Selvaraj
>> <
>> >     >         > [email protected]
>> >     <mailto:[email protected]>
>> >     >         <mailto:[email protected]
>> >     <mailto:[email protected]>>> wrote:
>> >     >         >
>> >     >         > > On Mon, Jul 28, 2014 at 08:18:04PM -0400, Sandeep K
>> >     >         Chaudhary wrote:
>> >     >         > > > Hi Senthil,
>> >     >         > > >
>> >     >         > > > Thanks a lot for your reply !
>> >     >         > > >
>> >     >         > > > As reported in my previous email, I see that gcc is
>> >     >         configured with
>> >     >         > > > "--enable-shared". Does it mean that plugin support
>> >     is not
>> >     >         turned off?
>> >     >         > >
>> >     >         > > The gcc you checked appears to be the native
>> compiler, not
>> >     >         the one
>> >     >         > > target for AVR. Is that correct?
>> >     >         > >
>> >     >         >
>> >     >         > Yes, that is correct. I checked again, this time for
>> >     avr-gcc,
>> >     >         and there
>> >     >         > also the --enable-shared config is present. Any idea why
>> >     could
>> >     >         it not be
>> >     >         > working then?
>> >     >         >
>> >     >         Hmm - this is what I get on the latest released toolchain
>> >     build for
>> >     >         Linux x86_64.
>> >     >
>> >     >         $
>>  ~/downloads/avr8-gnu-toolchain-linux_x86_64/bin/avr-gcc -v
>> >     >         Configured with:
>> >     >
>> >
>> /data2/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/src/gcc/configure
>> >     >
>> >
>> LDFLAGS=-L/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64/lib
>> >     >         CPPFLAGS= --target=avr --host=x86_64-pc-linux-gnu
>> >     >         --build=x86_64-pc-linux-gnu
>> >     >
>> >
>> --prefix=/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64
>> >     >
>> >
>> --libdir=/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64/lib
>> >     >         --enable-languages=c,c++ --with-dwarf2 --enable-doc
>> >     --disable-shared
>> >     >         --disable-libada --disable-libssp --disable-nls
>> >     --with-avrlibc=yes
>> >     >
>> >
>> --with-mpfr=/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64
>> >     >
>> >
>> --with-gmp=/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64
>> >     >
>> >
>> --with-mpc=/home/toolsbuild/jenkins-knuth/workspace/avr8-gnu-toolchain/avr8-gnu-toolchain-linux_x86_64
>> >     >         --enable-fixed-point
>> >     >         --with-pkgversion=AVR_8_bit_GNU_Toolchain_3.4.4_1229
>> >     >         --with-bugurl=http://www.atmel.com
>> >     >
>> >     >         and disabled-shared is present. Can you dump the full
>> command
>> >     >         output?
>> >     >
>> >     >         Regards
>> >     >         Senthil
>> >     >         >
>> >     >         > > >
>> >     >         > > > Yes, it would be great if you can please share a
>> >     build off
>> >     >         latest gcc
>> >     >         > > > with plugin support enabled.
>> >     >         > >
>> >     >         > > Sure, will do and send you the link.
>> >     >         > >
>> >     >         >
>> >     >         > Thanks again !
>> >     >         >
>> >     >         >
>> >     >         > > >
>> >     >         > > > Thanks again,
>> >     >         > > > Sandeep Chaudhary.
>> >     >         > > >
>> >     >         > > > On Thu, Jul 24, 2014 at 4:53 AM, Senthil Kumar
>> Selvaraj
>> >     >         > > > <[email protected]
>> >     <mailto:[email protected]>
>> >     >         <mailto:[email protected]
>> >     <mailto:[email protected]>>> wrote:
>> >     >         > > > > On Wed, Jul 23, 2014 at 10:38:48PM -0400, Sandeep
>> K
>> >     >         Chaudhary wrote:
>> >     >         > > > >> Hi Guys,
>> >     >         > > > >>
>> >     >         > > > >> I wish to implement a GCC plugin that can work
>> with
>> >     >         avr-gcc. I came to
>> >     >         > > > >> realize that the latest avr-gcc or avr-g++ is
>> >     based off
>> >     >         GCC 4.8.2.
>> >     >         > > > >> However, the whole GCC plugin APIs were
>> introduced in
>> >     >         4.9.0.
>> >     >         > > > >> Therefore, the 'fplugin' option is not present
>> >     with the
>> >     >         latest
>> >     >         > > > >> avr-gcc.
>> >     >         > > > >>
>> >     >         > > > >> Can someone please tell me when we can expect to
>> have
>> >     >         the plugin
>> >     >         > > > >> support in avr-gcc? Also, is there some way to
>> get
>> >     >         around this problem
>> >     >         > > > >> i.e. somehow being able to use the plugin option
>> with
>> >     >         current avr-gcc?
>> >     >         > > > >>
>> >     >         > > > >> It would be a great help if I can get the plugin
>> >     option
>> >     >         to work with
>> >     >         > > avr-gcc.
>> >     >         > > > >
>> >     >         > > > > As Jeremy said, the toolchain Atmel distributes
>> has
>> >     >         plugin support
>> >     >         > > > > turned off (as a unintentional side effect of
>> >     >         configuring with
>> >     >         > > > > --disable-shared, IIRC).
>> >     >         > > > >
>> >     >         > > > > If for some reason you don't want to build off the
>> >     >         latest gcc code, let
>> >     >         > > > > me know - I can run and share a build with plugin
>> >     >         support turned on.
>> >     >         > > > >>
>> >     >         > > > >> Thanks and regards,
>> >     >         > > > >> Sandeep Chaudhary
>> >     >         > > > >> University of Waterloo, Canada.
>> >     >         > > > >>
>> >     >         > > > >> _______________________________________________
>> >     >         > > > >> AVR-GCC-list mailing list
>> >     >         > > > >> [email protected]
>> >     <mailto:[email protected]> <mailto:[email protected]
>> >     <mailto:[email protected]>>
>> >     >         > > > >>
>> >     https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>> >     >         > > >
>> >     >         > > >
>> >     >         > > >
>> >     >         > > > --
>> >     >         > > > Thanks and regards,
>> >     >         > > > Sandeep K Chaudhary.
>> >     >         > >
>> >     >         >
>> >     >         >
>> >     >         >
>> >     >         > --
>> >     >         > Thanks and regards,
>> >     >         > Sandeep K Chaudhary.
>> >     >
>> >     >
>> >     >
>> >     >
>> >     >     --
>> >     >     Thanks and regards,
>> >     >     Sandeep K Chaudhary.
>> >     >
>> >     >
>> >     >
>> >     >
>> >     > --
>> >     > Thanks and regards,
>> >     > Sandeep K Chaudhary.
>> >     >
>> >     >
>> >     > _______________________________________________
>> >     > AVR-GCC-list mailing list
>> >     > [email protected] <mailto:[email protected]>
>> >     > https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>> >     >
>> >
>> >
>> >     --
>> >     Tel:      +44 (1590) 610184 <tel:%2B44%20%281590%29%20610184>
>> >     Cell:     +44 (7970) 676050 <tel:%2B44%20%287970%29%20676050>
>> >     SkypeID: jeremybennett
>> >     Twitter: @jeremypbennett
>> >     Email:   [email protected]
>> >     <mailto:[email protected]>
>> >     Web:     www.embecosm.com <http://www.embecosm.com>
>> >
>> >     _______________________________________________
>> >     AVR-GCC-list mailing list
>> >     [email protected] <mailto:[email protected]>
>> >     https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>> >
>> >
>> >
>> >
>> > --
>> > Thanks and regards,
>> > Sandeep K Chaudhary.
>>
>>
>> --
>> Tel:      +44 (1590) 610184
>> Cell:     +44 (7970) 676050
>> SkypeID: jeremybennett
>> Twitter: @jeremypbennett
>> Email:   [email protected]
>> Web:     www.embecosm.com
>>
>
>
>
> --
> Thanks and regards,
> Sandeep K Chaudhary.
>



-- 
Thanks and regards,
Sandeep K Chaudhary.

_______________________________________________
AVR-GCC-list mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.