summaryrefslogtreecommitdiff
path: root/libunwind
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2022-05-18 12:05:45 -0400
committerLouis Dionne <ldionne.2@gmail.com>2022-05-19 10:49:36 -0400
commitfa7ce8e685faa63f7ad1d0c7a640217286ec291b (patch)
treed83feacbb44e79454275542ee4c211340a4330a3 /libunwind
parente601b2a1542710789395ab1121b1ccc7076e39d1 (diff)
downloadllvm-fa7ce8e685faa63f7ad1d0c7a640217286ec291b.tar.gz
[runtimes] Fix the build of merged ABI/unwinder libraries
Also, add a CI job that tests this configuration. The exact configuration is that we build a shared libc++ and merge objects for the ABI library and the unwinder library into it. Differential Revision: https://reviews.llvm.org/D125903
Diffstat (limited to 'libunwind')
-rw-r--r--libunwind/test/configs/llvm-libunwind-merged.cfg.in65
1 files changed, 65 insertions, 0 deletions
diff --git a/libunwind/test/configs/llvm-libunwind-merged.cfg.in b/libunwind/test/configs/llvm-libunwind-merged.cfg.in
new file mode 100644
index 000000000000..19808a173ad8
--- /dev/null
+++ b/libunwind/test/configs/llvm-libunwind-merged.cfg.in
@@ -0,0 +1,65 @@
+@AUTO_GEN_COMMENT@
+
+@SERIALIZED_LIT_PARAMS@
+
+#
+# Configuration file for running the libunwind tests against a libc++ shared library
+# into which the unwinder was merged.
+#
+
+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@'
+config.target_info = "@LIBUNWIND_TARGET_INFO@"
+
+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(('%{executor}', '@LIBUNWIND_EXECUTOR@'))
+
+config.substitutions.append(('%{cxx}', '@CMAKE_CXX_COMPILER@'))
+local_sysroot = '@CMAKE_OSX_SYSROOT@' or '@CMAKE_SYSROOT@'
+config.substitutions.append(('%{flags}',
+ '-isysroot {}'.format(local_sysroot) if local_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} -lc++ -ldl {1}'.format('@LIBUNWIND_LIBRARY_DIR@', ' '.join(link_flags))
+))
+config.substitutions.append(('%{exec}',
+ '%{executor} --execdir %T -- ' if '@LIBUNWIND_EXECUTOR@' else ''
+))
+
+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
+)