[libunwind] Fix linker flag handling in the tests.

--export-dynamic is not always available on all targets.
-funwind-tables was a duplicate in the lit.site.cfg.in.

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D90202
This commit is contained in:
Daniel Kiss 2020-10-29 14:00:40 +01:00
parent 8cc49bec2e
commit 05598e3d30
2 changed files with 3 additions and 4 deletions

View File

@ -43,6 +43,9 @@ class Configuration(LibcxxConfiguration):
# Stack unwinding tests need unwinding tables and these are not
# generated by default on all Targets.
self.cxx.compile_flags += ['-funwind-tables']
# Make symbols available in the tests.
if 'linux' in self.config.target_triple:
self.cxx.link_flags += ['-Wl,--export-dynamic']
if not self.get_lit_bool('enable_threads', True):
self.cxx.compile_flags += ['-D_LIBUNWIND_HAS_NO_THREADS']
self.config.available_features.add('libunwind-no-threads')

View File

@ -44,10 +44,6 @@ config.test_source_root = os.path.join(config.libunwind_src_root, 'test')
# Allow expanding substitutions that are based on other substitutions
config.recursiveExpansionLimit = 10
# Make symbols available in the tests.
config.test_compiler_flags += " -funwind-tables "
config.test_linker_flags += " -Wl,--export-dynamic "
# Infer the test_exec_root from the build directory.
config.test_exec_root = os.path.join(config.libunwind_obj_root, 'test')