Files
clang-p2996/libunwind/test/configs/llvm-libunwind-shared.cfg.in
Louis Dionne ebfeeec4c4 [libunwind] Fix testing with sanitizers enabled
When testing with sanitizers enabled, we need to link against a plethora
of system libraries. Using `-nodefaultlibs` like we used to breaks this,
and we would have to add all these system libraries manually, which is
not portable and error prone. Instead, stop using `-nodefaultlibs` so
that we get the libraries added by default by the compiler.

The only caveat with this approach is that we are now relying on the
fact that `-L <path-to-local-libunwind>` will cause the just built
libunwind to be selected before the system implementation (either of
libunwind or libgcc_s.so), which is somewhat fragile.

This patch also turns the 32 bit multilib build into a soft failure
since we are in the process of removing it anyway, see D114473 for
details. This patch is incompatible with the 32 bit multilib build
because Ubuntu does not provide a proper libstdc++ for 32 bits, and
that is required when running with sanitizers enabled.

Differential Revision: https://reviews.llvm.org/D114385
2021-11-25 15:28:17 -05:00

63 lines
2.1 KiB
INI

@AUTO_GEN_COMMENT@
@SERIALIZED_LIT_PARAMS@
#
# Configuration file for running the libunwind tests against the shared library.
#
# This file is a lot simpler than the ones for libc++ and libc++abi because
# while libunwind is written in C++, it doesn't use the C++ Standard Library
# so we don't need to set that up to run the tests correctly.
#
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.format
# Basic configuration of the test suite
config.name = os.path.basename('@LIBUNWIND_TEST_CONFIG@')
config.test_source_root = os.path.join('@LIBUNWIND_SOURCE_DIR@', 'test')
config.test_format = libcxx.test.format.CxxStandardLibraryTest()
config.recursiveExpansionLimit = 10
config.test_exec_root = '@CMAKE_BINARY_DIR@'
compile_flags = []
link_flags = []
if @LIBUNWIND_USES_ARM_EHABI@:
config.available_features.add('libunwind-arm-ehabi')
if not @LIBUNWIND_ENABLE_THREADS@:
compile_flags.append('-D_LIBUNWIND_HAS_NO_THREADS')
config.available_features.add('libunwind-no-threads')
if @LIBUNWIND_ENABLE_CET@:
compile_flags.append('-fcf-protection=full')
if '@CMAKE_SYSTEM_NAME@' == 'Linux':
link_flags.append('-Wl,--export-dynamic')
# Stack unwinding tests need unwinding tables and these are not generated by default on all targets.
compile_flags.append('-funwind-tables')
config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
config.substitutions.append(('%{flags}',
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else ''
))
config.substitutions.append(('%{compile_flags}',
'-nostdinc++ -I {}/include {}'.format('@LIBUNWIND_SOURCE_DIR@', ' '.join(compile_flags))
))
config.substitutions.append(('%{link_flags}',
'-L {0} -Wl,-rpath,{0} -lunwind -ldl {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
))
config.substitutions.append(('%{exec}', ''))
import os, site
site.addsitedir(os.path.join('@LIBUNWIND_LIBCXX_PATH@', 'utils'))
import libcxx.test.params, libcxx.test.newconfig, libcxx.test.newconfig
libcxx.test.newconfig.configure(
libcxx.test.params.DEFAULT_PARAMETERS,
libcxx.test.features.DEFAULT_FEATURES,
config,
lit_config
)