1 # Testing configuration for Apple's system libc++abi.
3 # This configuration differs from a normal LLVM shared library configuration in
4 # that we must use DYLD_LIBRARY_PATH to run the tests against the just-built library,
5 # since Apple's libc++abi has an absolute install_name.
7 # Finally, we also link against an artificial shims library that provides
8 # the functionality necessary for the upstream libc++abi to be usable in place
9 # of a system-provided libc++abi. Without that, attempting to replace the system
10 # libc++abi with DYLD_LIBRARY_PATH would result in missing symbols and other similar
11 # issues since the upstream libc++abi does not contain all the symbols provided by
14 lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg')
17 site.addsitedir(os.path.join('@LIBCXXABI_LIBCXX_PATH@', 'utils'))
18 import libcxx.test.params, libcxx.test.config, libcxx.test.dsl
19 ADDITIONAL_PARAMETERS = [
20 libcxx.test.dsl.Parameter(name='apple_system_shims', type=str,
21 actions=lambda path: [libcxx.test.dsl.AddSubstitution('%{apple-system-shims}', path)],
23 Path to a pre-built object file or static archive that contains shims necessary to
24 allow replacing the system libc++abi by the just-built one.
28 config.substitutions.append(('%{flags}',
29 '-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
31 config.substitutions.append(('%{compile_flags}',
32 '-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} %{maybe-include-libunwind} -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' +
33 '-I %{libcxx}/test/support -I %{libcxx}/src'
35 config.substitutions.append(('%{link_flags}',
36 '-nostdlib++ -L %{lib} -lc++ %{apple-system-shims}'
38 config.substitutions.append(('%{exec}',
39 '%{executor} --execdir %T --env DYLD_LIBRARY_PATH=%{lib} -- '
42 config.stdlib = 'apple-libc++'
44 libcxx.test.config.configure(
45 libcxx.test.params.DEFAULT_PARAMETERS + ADDITIONAL_PARAMETERS,
46 libcxx.test.features.DEFAULT_FEATURES,