Boost C++ Libraries: Ticket #5508: shared libs with PIC not correctly build on MIPS https://svn.boost.org/trac10/ticket/5508 <p> shared libraries build with bjam/boost.build on MIPS using position-independed code do not work correctly/generating segmentation fault. Compiling the library 'by hand' doesn't issue an error. </p> <p> build libboost_fn with bjam: bjam toolset=gcc link=shared variant=debug cxxflags="-fPIC" --with-fn stage </p> <p> build test app: g++ -g ./test.cpp -I./ -L./stage/lib -lboost_fn -Wl,-rpath=./stage/lib -lrt </p> <p> ./a.out with segementation fault at fn1.S: 'lw $t9, %call16(exit)($gp)' </p> <p> build libbost_fn by hand: g++ -fPIC -g -I./ -c -Wall fn1.S g++ -shared -Wl,-soname,libboost_fn, -o libboost_fn fn1.o -lc </p> <p> build test app: g++ -g ./test.cpp -I./ -L./ -lboost_fn -Wl,-rpath=./ -lrt </p> <p> ./a.out works and returns with exit code 2. </p> <p> It seams to be a bug in bjam/boost.build. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5508 Trac 1.4.3 Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 05:47:33 GMT attachment set https://svn.boost.org/trac10/ticket/5508 https://svn.boost.org/trac10/ticket/5508 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fn1.hpp</span> </li> </ul> <p> header of test library </p> Ticket Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 05:48:03 GMT attachment set https://svn.boost.org/trac10/ticket/5508 https://svn.boost.org/trac10/ticket/5508 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fn1.S</span> </li> </ul> <p> implementation for test library </p> Ticket Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 05:48:23 GMT attachment set https://svn.boost.org/trac10/ticket/5508 https://svn.boost.org/trac10/ticket/5508 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">test.cpp</span> </li> </ul> <p> test binary </p> Ticket Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 05:58:00 GMT <link>https://svn.boost.org/trac10/ticket/5508#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5508#comment:1</guid> <description> <p> correct command line for building libboost_fn: </p> <p> g++ -shared -Wl,-soname,libboost_fn.so -o libboost_fn.so ./fn1.o -lc </p> </description> <category>Ticket</category> </item> <item> <author>Oliver Kowalke <oliver.kowalke@…></author> <pubDate>Thu, 28 Apr 2011 06:02:51 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/5508 https://svn.boost.org/trac10/ticket/5508 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">fn1.2.S</span> </li> </ul> <p> corrected version of fn1.S </p> Ticket Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 06:09:32 GMT cc set https://svn.boost.org/trac10/ticket/5508#comment:2 https://svn.boost.org/trac10/ticket/5508#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">oliver.kowalke@…</span> added </li> </ul> Ticket Oliver Kowalke <oliver.kowalke@…> Thu, 28 Apr 2011 06:14:17 GMT <link>https://svn.boost.org/trac10/ticket/5508#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5508#comment:3</guid> <description> <p> I guess that the object file for fn1.S is not compiled with -fPIC if build with bjam/boost.build </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Sat, 30 Apr 2011 13:19:30 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5508#comment:4 https://svn.boost.org/trac10/ticket/5508#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/71622" title="Set -fPIC for assembler complications, if necessary. Fixes #5508. ">[71622]</a>) Set -fPIC for assembler complications, if necessary. </p> <p> Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/5508" title="#5508: Bugs: shared libs with PIC not correctly build on MIPS (closed: fixed)">#5508</a>. </p> Ticket