Skip to content

Commit daf15e8

Browse files
committed
Avoid '..' in paths; use absolute paths instead
1 parent 4db8a31 commit daf15e8

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

utils/swift_build_support/swift_build_support/products/tsan_libdispatch.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
from .. import shell
1717

1818

19+
def join_path(p1, p2):
20+
return os.path.abspath(os.path.join(p1, p2))
21+
1922
class TSanLibDispatch(product.Product):
2023
@classmethod
2124
def product_source_name(cls):
@@ -27,19 +30,17 @@ def is_build_script_impl_product(cls):
2730

2831
def build(self, host_target):
2932
"""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')
3536

3637
cmd = [
3738
'cmake',
3839
'-GNinja',
3940
'-B%s' % self.build_dir,
4041
'-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++',
4344
'-DCMAKE_BUILD_TYPE=Release',
4445
'-DLLVM_ENABLE_ASSERTIONS=ON',
4546
'-DCOMPILER_RT_INCLUDE_TESTS=ON',

0 commit comments

Comments
 (0)