Opened 11 years ago
Closed 8 years ago
#5820 closed Bugs (fixed)
SEARCHED_LIB targets always treated as shared by clang module
Reported by: | Owned by: | Vladimir Prus | |
---|---|---|---|
Milestone: | To Be Determined | Component: | build |
Version: | Boost 1.47.0 | Severity: | Problem |
Keywords: | Cc: | flast@… |
Description
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
Attachments (1)
Change History (4)
by , 10 years ago
Attachment: | Fix-clang-linker-flags.patch added |
---|
comment:1 by , 10 years ago
Cc: | added |
---|
comment:2 by , 8 years ago
This issue is already resolved by https://github.com/boostorg/build/pull/10 and shipped in 1.56 release. So please close this.
comment:3 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I attached the patch.
And I tested under x86_64-linux-gnu / Clang trunk(3.2) only. Can anyone test under darwin environment?