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