Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
9 changed files
with
135 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Build a libc++ shared library, but merge libc++abi and libunwind into it. | ||
set(LIBCXX_ENABLE_SHARED ON CACHE BOOL "") | ||
set(LIBCXX_ENABLE_ABI_LINKER_SCRIPT OFF CACHE BOOL "") | ||
set(LIBCXX_ENABLE_STATIC_ABI_LIBRARY ON CACHE BOOL "") | ||
set(LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY ON CACHE BOOL "") | ||
|
||
set(LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "") | ||
set(LIBCXXABI_USE_LLVM_UNWINDER ON CACHE BOOL "") | ||
set(LIBCXXABI_ENABLE_STATIC_UNWINDER ON CACHE BOOL "") | ||
set(LIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY ON CACHE BOOL "") | ||
|
||
set(LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Testing configuration for libc++abi when merged into a libc++ shared library. | ||
|
||
lit_config.load_config(config, '@CMAKE_CURRENT_BINARY_DIR@/cmake-bridge.cfg') | ||
|
||
config.substitutions.append(('%{flags}', | ||
'-isysroot {}'.format('@CMAKE_OSX_SYSROOT@') if '@CMAKE_OSX_SYSROOT@' else '' | ||
)) | ||
config.substitutions.append(('%{compile_flags}', | ||
'-nostdinc++ -I %{include} -I %{cxx-include} -I %{cxx-target-include} -DLIBCXXABI_NO_TIMER -D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS ' + | ||
'-I %{libcxx}/test/support -I %{libcxx}/src' | ||
)) | ||
config.substitutions.append(('%{link_flags}', | ||
'-nostdlib++ -L %{lib} -Wl,-rpath,%{lib} -lc++ -pthread' | ||
)) | ||
config.substitutions.append(('%{exec}', | ||
'%{executor} --execdir %T -- ' | ||
)) | ||
|
||
import os, site | ||
site.addsitedir(os.path.join('@LIBCXXABI_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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
) |