16
16
from .. import shell
17
17
18
18
19
+ def join_path (p1 , p2 ):
20
+ return os .path .abspath (os .path .join (p1 , p2 ))
21
+
19
22
class TSanLibDispatch (product .Product ):
20
23
@classmethod
21
24
def product_source_name (cls ):
@@ -27,19 +30,17 @@ def is_build_script_impl_product(cls):
27
30
28
31
def build (self , host_target ):
29
32
"""Build TSan runtime (compiler-rt)."""
30
- rt_source_dir = os .path .join (self .source_dir , '../compiler-rt' )
31
- libdispatch_path = os .path .join (self .args .install_destdir , 'usr' )
32
- llvm_build_dir = os .path .join (self .build_dir , '../llvm-' + host_target )
33
- cc_path = os .path .join (llvm_build_dir , 'bin/clang' )
34
- cxx_path = os .path .join (llvm_build_dir , 'bin/clang++' )
33
+ rt_source_dir = join_path (self .source_dir , '../compiler-rt' )
34
+ llvm_build_dir = join_path (self .build_dir , '../llvm-' + host_target )
35
+ libdispatch_path = join_path (self .args .install_destdir , 'usr' )
35
36
36
37
cmd = [
37
38
'cmake' ,
38
39
'-GNinja' ,
39
40
'-B%s' % self .build_dir ,
40
41
'-DCMAKE_PREFIX_PATH=%s' % llvm_build_dir ,
41
- '-DCMAKE_C_COMPILER=%s' % cc_path ,
42
- '-DCMAKE_CXX_COMPILER=%s' % cxx_path ,
42
+ '-DCMAKE_C_COMPILER=clang' ,
43
+ '-DCMAKE_CXX_COMPILER=clang++' ,
43
44
'-DCMAKE_BUILD_TYPE=Release' ,
44
45
'-DLLVM_ENABLE_ASSERTIONS=ON' ,
45
46
'-DCOMPILER_RT_INCLUDE_TESTS=ON' ,
0 commit comments