Boost C++ Libraries: Ticket #5820: SEARCHED_LIB targets always treated as shared by clang module https://svn.boost.org/trac10/ticket/5820 <p> When using the clang module of Boost.Build, SEARCHED_LIB targets specified by "&lt;link&gt;static" property does not work properly, and the targets are always treated as shared ones. </p> <p> For example, when I write the following jamroot file, </p> <pre class="wiki"># jamroot lib gmp ; exe test.exe : test.cpp gmp/&lt;link&gt;static ; </pre><p> test.exe links against the shared version of gmp (libgmp.so). </p> <pre class="wiki">$ bjam -a -d+2 toolset=clang compile.c++.without-pth bin/clang-linux-3.0/debug/test.o "clang++" -c -x c++ -O0 -g -fno-inline -Wall -g -fPIC -o "bin/clang-linux-3.0/debug/test.o" "test.cpp" clang-linux.link bin/clang-linux-3.0/debug/test "clang++" -o "bin/clang-linux-3.0/debug/test" "bin/clang-linux-3.0/debug/test.o" -lgmp -g </pre><p> The problem here is "-l" option does not follow any "-Wl,-Bstatic" flag. </p> <p> Note that the gcc module works properly on the same jamroot, of course. </p> <pre class="wiki">$ bjam -a -d+2 toolset=gcc gcc.compile.c++ bin/gcc-4.4.5/debug/test.o "g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -fPIC -c -o "bin/gcc-4.4.5/debug/test.o" "test.cpp" gcc.link bin/gcc-4.4.5/debug/test "g++" -o "bin/gcc-4.4.5/debug/test" -Wl,--start-group "bin/gcc-4.4.5/debug/test.o" -Wl,-Bstatic -lgmp -Wl,-Bdynamic -Wl,--end-group -g </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5820 Trac 1.4.3 Kohei Takahashi <flast@…> Fri, 10 Aug 2012 06:15:16 GMT attachment set https://svn.boost.org/trac10/ticket/5820 https://svn.boost.org/trac10/ticket/5820 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">Fix-clang-linker-flags.patch</span> </li> </ul> Ticket Kohei Takahashi <flast@…> Fri, 10 Aug 2012 06:17:21 GMT cc set https://svn.boost.org/trac10/ticket/5820#comment:1 https://svn.boost.org/trac10/ticket/5820#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">flast@…</span> added </li> </ul> <p> I attached the patch. </p> <p> And I tested under x86_64-linux-gnu / Clang trunk(3.2) only. Can anyone test under darwin environment? </p> Ticket Kohei Takahashi <flast@…> Sat, 16 Aug 2014 14:55:20 GMT <link>https://svn.boost.org/trac10/ticket/5820#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5820#comment:2</guid> <description> <p> This issue is already resolved by <a class="ext-link" href="https://github.com/boostorg/build/pull/10"><span class="icon">​</span>https://github.com/boostorg/build/pull/10</a> and shipped in 1.56 release. So please close this. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Vladimir Prus</dc:creator> <pubDate>Wed, 20 Aug 2014 07:41:36 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/5820#comment:3 https://svn.boost.org/trac10/ticket/5820#comment:3 <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> Ticket