Boost C++ Libraries: Ticket #2123: link against libexpat.a of graph lib fails on 64 bit Linux https://svn.boost.org/trac10/ticket/2123 <p> Error from build:<br /> --- <br /> bash&gt; EXPAT_INCLUDE=/home/micha/external-builds/xgen-externals/install/Linux-x86_64/expat-2.0.1/include EXPAT_LIBPATH=/home/micha/external-builds/xgen-externals/install/Linux-x86_64/expat-2.0.1/lib make<br /> ./tools/jam/src/bin.linuxx86_64/bjam -sICU_PATH=/home/micha/external-builds/xgen-externals/install/Linux-x86_64/icu-3.8.1 --user-config=user-config.jam --without-python --without-mpi --without-test --without-wave<br /> Building Boost.Regex with Unicode/ICU support enabled<br /> Using ICU in /home/micha/external-builds/xgen-externals/install/Linux-x86_64/icu-3.8.1/include<br /> ...patience...<br /> ...patience...<br /> ...found 3188 targets...<br /> ...updating 1 target...<br /> gcc.link.dll bin.v2/libs/graph/build/gcc-4.3/release/threading-multi/libboost_graph-gcc43-mt-1_35.so.1.35.0 /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: /home/micha/external-builds/xgen-externals/install/Linux-x86_64/expat-2.0.1/lib/libexpat.a(xmlparse.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC<br /> /home/micha/external-builds/xgen-externals/install/Linux-x86_64/expat-2.0.1/lib/libexpat.a: could not read symbols: Bad value<br /> collect2: ld returned 1 exit status<br /> <br /> </p> <blockquote> <p> "g++" -L"/home/micha/external-builds/xgen-externals/install/Linux-x86_64/expat-2.0.1/lib" -o "bin.v2/libs/graph/build/gcc-4.3/release/threading-multi/libboost_graph-gcc43-mt-1_35.so.1.35.0" -Wl,-h -Wl,libboost_graph-gcc43-mt-1_35.so.1.35.0 -shared -Wl,--start-group "bin.v2/libs/graph/build/gcc-4.3/release/threading-multi/read_graphviz_spirit.o" "bin.v2/libs/graph/build/gcc-4.3/release/threading-multi/graphml.o" -Wl,-Bstatic -lexpat -Wl,-Bdynamic -lrt -Wl,--end-group -Wl,--strip-all -pthread </p> </blockquote> <p> <br /> ...failed gcc.link.dll<br /> bin.v2/libs/graph/build/gcc-4.3/release/threading-multi/libboost_graph-gcc43-mt-1_35.so.1.35.0...<br /> ...failed updating 1 target...<br /> Not all Boost libraries built properly.<br /> ---<br /> Build was with gcc 4.3 on OpenSuSE 11 (x86_64).<br /> The link error occurres with both the (native) expat lib from openSUSE and the expat lib I build myself (the example above tries to link against the latter) </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2123 Trac 1.4.3 Douglas Gregor Fri, 18 Jul 2008 14:42:03 GMT <link>https://svn.boost.org/trac10/ticket/2123#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2123#comment:1</guid> <description> <p> We can't build a shared library against a static library that hasn't been compiled with -fPIC. It sounds like expat is being built incorrectly. Is there a shared-library version of expat (ibexpat.so)? </p> </description> <category>Ticket</category> </item> <item> <author>michael.hufer@…</author> <pubDate>Mon, 21 Jul 2008 06:19:28 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2123#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2123#comment:2</guid> <description> <p> Yes there is. But even if I rename the static libexpat.a the build system cannot link and complains that it does not find libexpat.a, instead of linking with the libexpat.so (which is in the same lib folder). </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Wed, 23 Jul 2008 15:22:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2123#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2123#comment:3</guid> <description> <p> I believe I've found the issue, but I can't test it myself at the moment. If you make this change to libs/graph/build/Jamfile.v2, it should link against the shared expat: </p> <p> Index: Jamfile.v2 =================================================================== --- Jamfile.v2 (revision 47135) +++ Jamfile.v2 (working copy) @@ -26,7 +26,7 @@ if [ modules.peek : EXPAT_INCLUDE ] &amp;&amp; [ </p> <blockquote> <p> optional_sources += graphml.cpp ; optional_reqs += &lt;include&gt;$(EXPAT_INCLUDE) </p> <blockquote> <p> &lt;library-path&gt;$(EXPAT_LIBPATH) </p> </blockquote> </blockquote> <ul><li> &lt;find-static-library&gt;expat </li></ul><p> + &lt;find-shared-library&gt;expat </p> <blockquote> <p> ; </p> </blockquote> <blockquote> <p> } else </p> </blockquote> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Wed, 23 Jul 2008 15:23:55 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2123#comment:4 https://svn.boost.org/trac10/ticket/2123#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/47719" title="Link against shared expat. Fixes #2123">[47719]</a>) Link against shared expat. Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2123" title="#2123: Bugs: link against libexpat.a of graph lib fails on 64 bit Linux (closed: fixed)">#2123</a> </p> Ticket Dave Abrahams Thu, 28 Aug 2008 02:51:13 GMT cc, status changed; resolution deleted https://svn.boost.org/trac10/ticket/2123#comment:5 https://svn.boost.org/trac10/ticket/2123#comment:5 <ul> <li><strong>cc</strong> <span class="trac-author">Vladimir Prus</span> added </li> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">fixed</span> </li> </ul> <p> Should this patch have used &lt;find-library&gt; instead? Please feel free to close if not. </p> Ticket Douglas Gregor Fri, 05 Sep 2008 14:15:00 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2123#comment:6 https://svn.boost.org/trac10/ticket/2123#comment:6 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> &lt;find-library&gt; doesn't seem to exist: </p> <blockquote> <p> unknown feature "&lt;find-library&gt;" </p> </blockquote> Ticket Mon, 03 Nov 2008 14:20:34 GMT milestone deleted https://svn.boost.org/trac10/ticket/2123#comment:7 https://svn.boost.org/trac10/ticket/2123#comment:7 <ul> <li><strong>milestone</strong> <span class="trac-field-deleted">Boost 1.35.1</span> </li> </ul> <p> Milestone Boost 1.35.1 deleted </p> Ticket