@@ -1591,19 +1591,13 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1591
1591
config .import_libdispatch = ('-I %s -I %s -L %s'
1592
1592
% (libdispatch_source_dir , libdispatch_swift_module_dir , libdispatch_artifact_dir ))
1593
1593
1594
- libdispatch_static_artifact_dir = config .libdispatch_static_build_path
1595
- libdispatch_swift_static_module_dir = make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'swift' )
1594
+ libdispatch_static_artifact_dir = os .path .join (config .libdispatch_static_build_path , 'lib' )
1596
1595
libdispatch_static_artifacts = [
1597
- make_path (libdispatch_static_artifact_dir , 'src' , 'libdispatch.a' ),
1598
- make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'libswiftDispatch.a' ),
1599
- make_path (libdispatch_swift_static_module_dir , 'Dispatch.swiftmodule' )]
1596
+ make_path (libdispatch_static_artifact_dir , 'libdispatch.a' ),
1597
+ make_path (libdispatch_static_artifact_dir , 'libBlocksRuntime.a' )]
1600
1598
if (all (os .path .exists (p ) for p in libdispatch_static_artifacts )):
1601
1599
config .available_features .add ('libdispatch_static' )
1602
- config .import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s'
1603
- % (libdispatch_source_dir , libdispatch_swift_static_module_dir ,
1604
- make_path (libdispatch_static_artifact_dir , 'src' ),
1605
- make_path (libdispatch_static_artifact_dir , 'src' , 'BlocksRuntime' ),
1606
- make_path (libdispatch_static_artifact_dir , 'src' , 'swift' )))
1600
+ config .import_libdispatch_static = '-L %s' % libdispatch_static_artifact_dir
1607
1601
1608
1602
config .target_build_swift = (
1609
1603
'%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
@@ -2644,6 +2638,10 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz
2644
2638
config .substitutions .append (('%FileCheck' , run_filecheck ))
2645
2639
config .substitutions .append (('%raw-FileCheck' , shell_quote (config .filecheck )))
2646
2640
config .substitutions .append (('%import-libdispatch' , getattr (config , 'import_libdispatch' , '' )))
2641
+ # WARNING: the order of components in a substitution name has to be different from the previous one, as lit does
2642
+ # a pure string substitution without understanding that these components are grouped together. That is, the following
2643
+ # subsitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with
2644
+ # the value of `%import-libdispatch` substitution with `-static` string appended to it.
2647
2645
config .substitutions .append (('%import-static-libdispatch' , getattr (config , 'import_libdispatch_static' , '' )))
2648
2646
2649
2647
# Disable COW sanity checks in the swift runtime by default.
0 commit comments