<p dir="ltr">I tried archiving again with rtems-4.11-ar and it works.But I just wanted to know doesn't RTEMS support LTO?Why the archiving did not work with rtems-4.11-gcc-ar?</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Jul 16, 2016 5:25 AM, "Sambeet Panigrahi" <<a href="mailto:sambeet161616@gmail.com">sambeet161616@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Sir,<div>I made the necessary changes </div><div><br></div><div>First I gave the commmand:</div><div><br></div><div><div>sambeet@Holmes ~/NewRockPort/x86/Build/rock/rtt_test $ /home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-g++ -Wall -c displayer.cpp -Ihome/sambeet/NewRockPort/x86/Build/rock/rtt_test/ -I/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/i386-rtems4.11/pc586/lib/include/</div></div><div><br></div><div>This file gave me the required object file</div><div><br></div><div><div>sambeet@Holmes ~/NewRockPort/x86/Build/rock/rtt_test $ ls</div><div>displayer.cpp displayer.o rtt_hello.hpp rtt_test.orogen rtt_testTypes.hpp</div></div><div><br></div><div>Then I use the archiver</div><div><br></div><div><div>sambeet@Holmes ~/NewRockPort/x86/Build/rock/rtt_test $ /home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-gcc-ar -cvq libdisplayer.a *.o</div></div><div><br></div><div>But I get the output</div><div><br></div><div><div>/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-gcc-ar: Cannot find plugin 'liblto_plugin.so'</div></div><div><br></div><div>I found that this plugin is finds the LTO wrapper for linker time optimization.I found the LTO wrapper though inside gcc.I tried to disable linker optimization but with no success.</div><div><br></div><div>sambeet@Holmes ~/NewRockPort/x86/Build/rock/rtt_test $ /home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-gcc-ar -cvq -fno-use-linker-plugin libdisplayer.a *.o</div><div>/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-gcc-ar: Cannot find plugin 'liblto_plugin.so'</div><div><br></div><div>How do I resolve this error?</div><div> </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 15, 2016 at 5:11 AM, Chris Johns <span dir="ltr"><<a href="mailto:chrisj@rtems.org" target="_blank">chrisj@rtems.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 15/07/2016 06:19, Sambeet Panigrahi wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
When I am trying to compile the above I get a link failure error:<br>
<br>
sambeet@Holmes ~/NewRockPort/x86/Build/rock/rtt_test $<br>
/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/bin/i386-rtems4.11-g++<br>
displayer.cpp -Ihome/sambeet/NewRockPort/x86/Build/rock/rtt_test/<br>
-I/home/sambeet/NewRockPort/x86/Install/rtems/4.11.0-rc3/i386-rtems4.11/pc586/lib/include/<br>
</blockquote>
<br></span>
This command creates an executable. What you are seeing are the linker errors because you have not provided a suitable path to the RTEMS libraries for your BSP. To make a library you need to create an object file and then create a library containing that file.<span><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
How can I build my library and create an executable for i386-rtems?<br>
</blockquote>
<br></span>
I suggest you search the net for ways to do this. A quick google gave me ..<br>
<br>
<a href="http://www.cs.dartmouth.edu/~campbell/cs50/buildlib.html" rel="noreferrer" target="_blank">http://www.cs.dartmouth.edu/~campbell/cs50/buildlib.html</a><br>
<br>
RTEMS is statically linked so we only use static libraries, ie .a files. You need to substitute 'mygcc' and 'gcc' with 'i386-rtems4.11-g++' and 'ar' with 'i386-rtems4.11-ar'.<span><font color="#888888"><br>
<br>
Chris<br>
</font></span></blockquote></div><br></div>
</blockquote></div></div>