Fix using ccache with clang-linux toolset (#605)

* Fix using ccache with clang-linux toolset

When using ccache with `using clang : : ccache clang++-3.6 ;` then `common.get-absolute-tool-path` fails.

Use the last element as done for gcc

* Add test for clang-win auto-deducing ar
This commit is contained in:
Alexander Grund
2026-07-15 05:07:43 +02:00
committed by Rene Rivera
parent 10d899da54
commit 26ad6ed14f
3 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -110,7 +110,7 @@ rule init ( version ? : command * : options * ) {
} }
if ! $(archiver) if ! $(archiver)
{ {
local bin = [ common.get-absolute-tool-path $(command) ] ; local bin = [ common.get-absolute-tool-path $(command[-1]) ] ;
archiver = [ common.get-invocation-command-nodefault clang-linux : llvm-ar : : $(bin) : search-path ] ; archiver = [ common.get-invocation-command-nodefault clang-linux : llvm-ar : : $(bin) : search-path ] ;
} }
toolset.flags clang-linux.archive .AR $(condition) : $(archiver[1]) ; toolset.flags clang-linux.archive .AR $(condition) : $(archiver[1]) ;
+2
View File
@@ -27,6 +27,8 @@ using darwin : 4.2.1 : $(PYTHON) $(here)/src/darwin-4.2.1.py
using clang-darwin : 3.9.0 : $(PYTHON) $(here)/src/clang-3.9.0-darwin.py : $(ar) ; using clang-darwin : 3.9.0 : $(PYTHON) $(here)/src/clang-3.9.0-darwin.py : $(ar) ;
using clang-linux : 3.9.0 : $(PYTHON) $(here)/src/clang-linux-3.9.0.py : $(ar) ; using clang-linux : 3.9.0 : $(PYTHON) $(here)/src/clang-linux-3.9.0.py : $(ar) ;
# Let clang-linux auto-deduce the archiver
using clang-linux : 3.9.1 : $(PYTHON) $(here)/src/clang-linux-3.9.0.py ;
using clang-vxworks : 4.0.1 : $(PYTHON) $(here)/src/clang-vxworks-4.0.1.py : $(ar) ; using clang-vxworks : 4.0.1 : $(PYTHON) $(here)/src/clang-vxworks-4.0.1.py : $(ar) ;
using intel-darwin : 10.2 : $(PYTHON) $(here)/src/intel-darwin-10.2.py : $(ar) ; using intel-darwin : 10.2 : $(PYTHON) $(here)/src/intel-darwin-10.2.py : $(ar) ;
+3
View File
@@ -27,3 +27,6 @@ test_toolset("clang-linux", "3.9.0", [
["target-os=windows", "link=static"], ["target-os=windows", "link=static"],
["target-os=windows", "architecture=x86", "address-model=32"] ["target-os=windows", "architecture=x86", "address-model=32"]
]) ])
# Auto-deduced ar
test_toolset("clang-linux", "3.9.1", [["target-os=linux"]])