[Boost-bugs] [Boost C++ Libraries] #5820: SEARCHED_LIB targets always treated as shared by clang module

Subject: [Boost-bugs] [Boost C++ Libraries] #5820: SEARCHED_LIB targets always treated as shared by clang module
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-08-29 11:19:45


#5820: SEARCHED_LIB targets always treated as shared by clang module
-------------------------------------------+--------------------------------
 Reporter: Ai Azuma <ai.azuma@…> | Owner: vladimir_prus
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: build
  Version: Boost 1.47.0 | Severity: Problem
 Keywords: |
-------------------------------------------+--------------------------------
 When using the clang module of Boost.Build,
 SEARCHED_LIB targets specified by "<link>static" property does not work
 properly, and the targets are always treated as shared ones.

 For example, when I write the following jamroot file,
 {{{
 # jamroot
 lib gmp ;
 exe test.exe : test.cpp gmp/<link>static ;
 }}}

 test.exe links against the shared version of gmp (libgmp.so).

 {{{
 $ 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
 }}}

 The problem here is "-l" option does not follow any "-Wl,-Bstatic" flag.

 Note that the gcc module works properly on the same jamroot, of course.

 {{{
 $ 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
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5820>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:07 UTC