diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -79,6 +79,8 @@ "LIBUNWIND_ENABLE_SHARED;LIBUNWIND_INSTALL_LIBRARY" OFF) set(LIBUNWIND_TARGET_TRIPLE "${LLVM_DEFAULT_TARGET_TRIPLE}" CACHE STRING "Target triple for cross compiling.") set(LIBUNWIND_GCC_TOOLCHAIN "" CACHE PATH "GCC toolchain for cross compiling.") +set(LIBUNWIND_SYNTH_LIBGCC "" CACHE + STRING "Synthesises symbolic links for the libgcc family of libraries that point to libunwind and compiler-rt. This flag is only useful for distribution managers wanting to replace libgcc with libunwind, and should not be used by mainstream LLVM consumers. Requires LIBUNWIND_USE_COMPILER_RT=ON.") set(LIBUNWIND_SYSROOT "" CACHE PATH "Sysroot for cross compiling.") set(LIBUNWIND_TEST_LINKER_FLAGS "" CACHE STRING "Additional linker flags for test programs.") @@ -170,6 +172,10 @@ # Configure compiler. include(config-ix) +if (LIBUNWIND_SYNTH_LIBGCC AND NOT LIBUNWIND_USE_COMPILER_RT) + message(SEND_ERROR "LIBUNWIND_SYNTH_LIBGCC and LIBUNWIND_USE_COMPILER_RT must have the same value (got LIBUNWIND_SYNTH_LIBGCC=${LIBUNWIND_SYNTH_LIBGCC} and LIBUNWIND_USE_COMPILER_RT=${LIBUNWIND_USE_COMPILER_RT}).") +endif() + if (LIBUNWIND_USE_COMPILER_RT AND NOT LIBUNWIND_HAS_NODEFAULTLIBS_FLAG) list(APPEND LIBUNWIND_LINK_FLAGS "-rtlib=compiler-rt") endif() diff --git a/libunwind/cmake/config-ix.cmake b/libunwind/cmake/config-ix.cmake --- a/libunwind/cmake/config-ix.cmake +++ b/libunwind/cmake/config-ix.cmake @@ -6,6 +6,7 @@ include(CheckCSourceCompiles) check_library_exists(c fopen "" LIBUNWIND_HAS_C_LIB) +check_library_exists(m log "" LIBUNWIND_HAS_M_LIB) if (NOT LIBUNWIND_USE_COMPILER_RT) if (ANDROID) diff --git a/libunwind/docs/BuildingLibunwind.rst b/libunwind/docs/BuildingLibunwind.rst --- a/libunwind/docs/BuildingLibunwind.rst +++ b/libunwind/docs/BuildingLibunwind.rst @@ -166,3 +166,96 @@ Path where built libunwind libraries should be installed. If a relative path, relative to ``CMAKE_INSTALL_PREFIX``. + +.. option:: LIBUNWIND_SYNTH_LIBGCC:BOOL + + Synthesises symbolic links for the libgcc family of libraries that point to + libunwind and compiler-rt. This flag is only useful for distribution managers + wanting to replace libgcc with libunwind, and should not be used by mainstream + LLVM consumers. Requires ``LIBUNWIND_USE_COMPILER_RT=ON``. + + **Default**: ``OFF`` + +.. _Building libunwind with ``LIBUNWIND_SYNTH_LIBGCC`` + +Building libunwind with `LIBUNWIND_SYNTH_LIBGCC` +================================================ + +**Note that these instructions assume a Linux and bash-friendly environment. +YMMV if you’re on a non Linux-based platform.** + +Building libunwind with ``LIBUNWIND_SYNTH_LIBGCC`` requires a compiler that +supports compiler-rt when its builtin symbols are exported. This usually means +having two build trees instead of the usual one. + +.. code-block:: bash + + # Assumes $(PWD) is /path/to/llvm-project + $ mkdir -p build + $ cd build + +.. _Building Clang + +Building Clang +-------------- + +The first build tree is a mostly conventional build tree and gets you a Clang +build with these compiler-rt symbols exposed. + +.. code-block:: bash + # Assumes $(PWD) is /path/to/llvm-project + $ mkdir -p build/clang + $ cd build/clang + $ cmake -GNinja ../../llvm \ + -DLLVM_ENABLE_PROJECTS='clang;compiler-rt' \ + -DCOMPILER_RT_BUILTINS_HIDE_SYMBOLS=OFF + $ ninja + +.. _Building libunwind + +Building libunwind +------------------ + +Now that we have a copy of compiler-rt with its builtin symbols exported, we can +go about building libunwind in a second tree. We synthesise libgcc for x86_64 in +the example below, but it’s possible to do it for any architecture that has a +`version script`_ in the top-level directory of libunwind (presently i686, +x86_64, armv7, and aarch64). + +.. _version script: https://sourceware.org/binutils/docs/ld/VERSION.html + +.. code-block:: bash + + # Assumes $(PWD) is /path/to/llvm-project + $ mkdir -p build/libunwind + $ cd build/libunwind + $ cmake -GNinja ../../libunwind \ + -DCMAKE_C_COMPILER=/path/to/llvm-project/build/clang/bin/clang \ + -DCMAKE_CXX_COMPILER=/path/to/llvm-project/build/clang/bin/clang++ \ + -DLIBUNWIND_SYNTH_LIBGCC=x86_64 \ + -DLIBUNWIND_USE_COMPILER_RT=On \ + -DLIBUNWIND_HAS_COMMENT_LIB_PRAGMA=Off \ + -DLIBUNWIND_HAS_DL_LIB=Off \ + -DLIBUNWIND_HAS_PTHREAD_LIB=Off + $ ninja + + +``LIBUNWIND_HAS_COMMENT_LIB_PRAGMA``, ``LIBUNWIND_HAS_DL_LIB``, and +``LIBUNWIND_HAS_PTHREAD_LIB`` are not strictly necessary, but are useful to +prevent requiring your libunwind dependents to also link with libdl and +libpthread. + +## Verifying your results + +This gets you a copy of libunwind with the libgcc symbols. You can verify this +using ``readelf``. + +.. code-block:: bash + + # Assumes $(PWD) is /path/to/llvm-project/build/libunwind + $ readelf -su lib/libunwind.so | grep FUNC | grep GCC_3.0 + + +Roughly sixty symbols should appear, all suffixed with ``@@GCC_3.0``. You can +replace ``GCC_3.0`` with any of the supported version names in the version +script you’re exporting to verify that the symbols are exported. diff --git a/libunwind/gcc_s-aarch64.ver b/libunwind/gcc_s-aarch64.ver new file mode 100644 --- /dev/null +++ b/libunwind/gcc_s-aarch64.ver @@ -0,0 +1,152 @@ +GCC_3.0 { + _Unwind_DeleteException; + _Unwind_Find_FDE; + _Unwind_ForcedUnwind; + _Unwind_GetDataRelBase; + _Unwind_GetGR; + _Unwind_GetIP; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + _Unwind_SetGR; + _Unwind_SetIP; + __absvdi2; + __absvsi2; + __addtf3; + __addvdi3; + __addvsi3; + __ashlti3; + __ashrti3; + __clear_cache; + __cmpti2; + __divtf3; + __divti3; + __eqtf2; + __extenddftf2; + __extendsftf2; + __ffsdi2; + __ffsti2; + __fixdfti; + __fixsfti; + __fixtfdi; + __fixtfsi; + __fixtfti; + __fixunsdfdi; + __fixunsdfti; + __fixunssfdi; + __fixunssfti; + __fixunstfdi; + __fixunstfsi; + __fixunstfti; + __floatditf; + __floatsitf; + __floattidf; + __floattisf; + __floattitf; + __getf2; + __gttf2; + __letf2; + __lshrti3; + __lttf2; + __modti3; + __multf3; + __multi3; + __mulvdi3; + __mulvsi3; + __negti2; + __negvdi2; + __negvsi2; + __netf2; + __subtf3; + __subvdi3; + __subvsi3; + __trunctfdf2; + __trunctfsf2; + __ucmpti2; + __udivmodti4; + __udivti3; + __umodti3; +}; + +GCC_3.3 { + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +}; + +GCC_3.3.1 { + __gcc_personality_v0; +}; + +GCC_3.4 { + __clzdi2; + __clzti2; + __ctzdi2; + __ctzti2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; +}; + +GCC_3.4.2 { + __enable_execute_stack; +}; + +GCC_3.4.4 { + __absvti2; + __addvti3; + __mulvti3; + __negvti2; + __subvti3; +}; + +GCC_4.0.0 { + __divdc3; + __divsc3; + __divtc3; + __muldc3; + __mulsc3; + __multc3; + __powidf2; + __powisf2; + __powitf2; +}; + +GCC_4.2.0 { + _Unwind_GetIPInfo; + __floatunditf; + __floatunsitf; + __floatuntidf; + __floatuntisf; + __floatuntitf; +}; + +GCC_4.3.0 { + __bswapdi2; + __bswapsi2; + __emutls_get_address; +}; + +GCC_4.5.0 { + __unordtf2; +}; + +GCC_7.0.0 { + __divmodti4; +}; + +GLIBC_2.0 { + __deregister_frame; + __register_frame; +}; + +Unversioned { + __extendhftf2; + __trunctfhf2; + emutls_init; +}; + diff --git a/libunwind/gcc_s-armv7a.ver b/libunwind/gcc_s-armv7a.ver new file mode 100644 --- /dev/null +++ b/libunwind/gcc_s-armv7a.ver @@ -0,0 +1,215 @@ +GCC_3.0 { + _Unwind_DeleteException; + _Unwind_GetDataRelBase; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + __absvdi2; + __absvsi2; + __adddf3; + __addsf3; + __addvdi3; + __addvsi3; + __ashldi3; + __ashrdi3; + __clear_cache; + __cmpdi2; + __divdf3; + __divsf3; + __divsi3; + __eqdf2; + __eqsf2; + __extendsfdf2; + __ffsdi2; + __fixdfdi; + __fixdfsi; + __fixsfdi; + __fixsfsi; + __fixunsdfdi; + __fixunsdfsi; + __fixunssfdi; + __fixunssfsi; + __floatdidf; + __floatdisf; + __floatsidf; + __floatsisf; + __gedf2; + __gesf2; + __gtdf2; + __gtsf2; + __ledf2; + __lesf2; + __lshrdi3; + __ltdf2; + __ltsf2; + __modsi3; + __muldf3; + __muldi3; + __mulsf3; + __mulvdi3; + __mulvsi3; + __nedf2; + __negdf2; + __negdi2; + __negsf2; + __negvdi2; + __negvsi2; + __nesf2; + __subdf3; + __subsf3; + __subvdi3; + __subvsi3; + __truncdfsf2; + __ucmpdi2; + __udivmoddi4; + __udivsi3; + __umodsi3; +}; + +GCC_3.3 { + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +}; + +GCC_3.3.1 { + __gcc_personality_v0; +}; + +GCC_3.3.4 { + __unorddf2; + __unordsf2; +}; + +GCC_3.4 { + __clzdi2; + __clzsi2; + __ctzdi2; + __ctzsi2; + __paritydi2; + __paritysi2; + __popcountdi2; + __popcountsi2; +}; + +GCC_3.4.2 { + __enable_execute_stack; +}; + +GCC_3.5 { + _Unwind_Complete; + _Unwind_VRS_Get; + _Unwind_VRS_Pop; + _Unwind_VRS_Set; + __aeabi_cdcmpeq; + __aeabi_cdcmple; + __aeabi_cdrcmple; + __aeabi_cfcmpeq; + __aeabi_cfcmple; + __aeabi_cfrcmple; + __aeabi_d2f; + __aeabi_d2iz; + __aeabi_d2lz; + __aeabi_d2uiz; + __aeabi_d2ulz; + __aeabi_dadd; + __aeabi_dcmpeq; + __aeabi_dcmpge; + __aeabi_dcmpgt; + __aeabi_dcmple; + __aeabi_dcmplt; + __aeabi_dcmpun; + __aeabi_ddiv; + __aeabi_dmul; + __aeabi_dneg; + __aeabi_drsub; + __aeabi_dsub; + __aeabi_f2d; + __aeabi_f2iz; + __aeabi_f2lz; + __aeabi_f2uiz; + __aeabi_f2ulz; + __aeabi_fadd; + __aeabi_fcmpeq; + __aeabi_fcmpge; + __aeabi_fcmpgt; + __aeabi_fcmple; + __aeabi_fcmplt; + __aeabi_fcmpun; + __aeabi_fdiv; + __aeabi_fmul; + __aeabi_fneg; + __aeabi_frsub; + __aeabi_fsub; + __aeabi_i2d; + __aeabi_i2f; + __aeabi_idiv; + __aeabi_idiv0; + __aeabi_idivmod; + __aeabi_l2d; + __aeabi_l2f; + __aeabi_lasr; + __aeabi_lcmp; + __aeabi_ldiv0; + __aeabi_ldivmod; + __aeabi_llsl; + __aeabi_llsr; + __aeabi_lmul; + __aeabi_ui2d; + __aeabi_ui2f; + __aeabi_uidiv; + __aeabi_uidivmod; + __aeabi_ul2d; + __aeabi_ul2f; + __aeabi_ulcmp; + __aeabi_uldivmod; + __aeabi_unwind_cpp_pr0; + __aeabi_unwind_cpp_pr1; + __aeabi_unwind_cpp_pr2; + __gnu_unwind_frame; +}; + +GCC_4.0.0 { + __divdc3; + __divsc3; + __muldc3; + __mulsc3; + __powidf2; + __powisf2; +}; + +GCC_4.2.0 { + __floatundidf; + __floatundisf; + __floatunsidf; + __floatunsisf; +}; + +GCC_4.3.0 { + _Unwind_Backtrace; + __bswapdi2; + __bswapsi2; + __emutls_get_address; + __ffssi2; +}; + +GCC_7.0.0 { + __divmoddi4; +}; + +GLIBC_2.0 { + __divdi3; + __moddi3; + __udivdi3; + __umoddi3; +}; + +Unversioned { + _Unwind_GetGR; + _Unwind_SetGR; + __cmpdf2; + __cmpsf2; + emutls_init; +}; + diff --git a/libunwind/gcc_s-i386.ver b/libunwind/gcc_s-i386.ver new file mode 100644 --- /dev/null +++ b/libunwind/gcc_s-i386.ver @@ -0,0 +1,128 @@ +GCC_3.0 { + _Unwind_DeleteException; + _Unwind_Find_FDE; + _Unwind_ForcedUnwind; + _Unwind_GetDataRelBase; + _Unwind_GetGR; + _Unwind_GetIP; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + _Unwind_SetGR; + _Unwind_SetIP; + __absvdi2; + __absvsi2; + __addvdi3; + __addvsi3; + __ashldi3; + __ashrdi3; + __clear_cache; + __cmpdi2; + __deregister_frame_info_bases; + __ffsdi2; + __fixdfdi; + __fixsfdi; + __fixunsdfdi; + __fixunsdfsi; + __fixunssfdi; + __fixunssfsi; + __fixunsxfdi; + __fixunsxfsi; + __fixxfdi; + __floatdidf; + __floatdisf; + __floatdixf; + __lshrdi3; + __muldi3; + __mulvdi3; + __mulvsi3; + __negdi2; + __negvdi2; + __negvsi2; + __register_frame_info_bases; + __register_frame_info_table_bases; + __subvdi3; + __subvsi3; + __ucmpdi2; + __udivmoddi4; +}; + +GCC_3.3 { + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +}; + +GCC_3.3.1 { + __gcc_personality_v0; +}; + +GCC_3.4 { + __clzdi2; + __clzsi2; + __ctzdi2; + __ctzsi2; + __paritydi2; + __paritysi2; + __popcountdi2; + __popcountsi2; +}; + +GCC_3.4.2 { + __enable_execute_stack; +}; + +GCC_4.0.0 { + __divdc3; + __divsc3; + __divxc3; + __muldc3; + __mulsc3; + __mulxc3; + __powidf2; + __powisf2; + __powixf2; +}; + +GCC_4.2.0 { + _Unwind_GetIPInfo; + __floatundidf; + __floatundisf; + __floatundixf; +}; + +GCC_4.3.0 { + __bswapdi2; + __bswapsi2; + __emutls_get_address; + __ffssi2; +}; + +GCC_4.8.0 { + __cpu_indicator_init; +}; + +GCC_7.0.0 { + __divmoddi4; +}; + +GLIBC_2.0 { + __deregister_frame; + __deregister_frame_info; + __divdi3; + __moddi3; + __register_frame; + __register_frame_info; + __register_frame_info_table; + __register_frame_table; + __udivdi3; + __umoddi3; +}; + +Unversioned { + emutls_init; +}; + diff --git a/libunwind/gcc_s-x86_64.ver b/libunwind/gcc_s-x86_64.ver new file mode 100644 --- /dev/null +++ b/libunwind/gcc_s-x86_64.ver @@ -0,0 +1,135 @@ +GCC_3.0 { + _Unwind_DeleteException; + _Unwind_Find_FDE; + _Unwind_ForcedUnwind; + _Unwind_GetDataRelBase; + _Unwind_GetGR; + _Unwind_GetIP; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + _Unwind_SetGR; + _Unwind_SetIP; + __absvdi2; + __absvsi2; + __addvdi3; + __addvsi3; + __ashlti3; + __ashrti3; + __clear_cache; + __cmpti2; + __deregister_frame; + __deregister_frame_info; + __deregister_frame_info_bases; + __divti3; + __ffsdi2; + __ffsti2; + __fixdfti; + __fixsfti; + __fixunsdfdi; + __fixunsdfti; + __fixunssfdi; + __fixunssfti; + __fixunsxfdi; + __fixunsxfti; + __fixxfti; + __floattidf; + __floattisf; + __floattixf; + __lshrti3; + __modti3; + __multi3; + __mulvdi3; + __mulvsi3; + __negti2; + __negvdi2; + __negvsi2; + __register_frame; + __register_frame_info; + __register_frame_info_bases; + __register_frame_info_table; + __register_frame_info_table_bases; + __register_frame_table; + __subvdi3; + __subvsi3; + __ucmpti2; + __udivmodti4; + __udivti3; + __umodti3; +}; + +GCC_3.3 { + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +}; + +GCC_3.3.1 { + __gcc_personality_v0; +}; + +GCC_3.4 { + __clzdi2; + __clzti2; + __ctzdi2; + __ctzti2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; +}; + +GCC_3.4.2 { + __enable_execute_stack; +}; + +GCC_3.4.4 { + __absvti2; + __addvti3; + __mulvti3; + __negvti2; + __subvti3; +}; + +GCC_4.0.0 { + __divdc3; + __divsc3; + __divxc3; + __muldc3; + __mulsc3; + __mulxc3; + __powidf2; + __powisf2; + __powixf2; +}; + +GCC_4.2.0 { + _Unwind_GetIPInfo; + __floatuntidf; + __floatuntisf; + __floatuntixf; +}; + +GCC_4.3.0 { + __bswapdi2; + __bswapsi2; + __divtc3; + __emutls_get_address; + __multc3; +}; + +GCC_4.8.0 { + __cpu_indicator_init; +}; + +GCC_7.0.0 { + __divmodti4; +}; + +Unversioned { + emutls_init; +}; + diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -69,7 +69,24 @@ # Generate library list. add_library_flags_if(LIBUNWIND_HAS_C_LIB c) -if (LIBUNWIND_USE_COMPILER_RT) + +if (LIBUNWIND_SYNTH_LIBGCC) + message(STATUS "LIBUNWIND_SYNTH_LIBGCC set to ${LIBUNWIND_SYNTH_LIBGCC}") + set(LIBGCC_S_VERSION_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../gcc_s-${LIBUNWIND_SYNTH_LIBGCC}.ver") + if (NOT EXISTS "${LIBGCC_S_VERSION_SCRIPT_PATH}") + message(SEND_ERROR + "Cannot synthesise libgcc_s for ${LIBUNWIND_SYNTH_LIBGCC} because ${LIBGCC_S_VERSION_SCRIPT_PATH} doesn't exist.") + endif() + + add_library_flags( + "-nostdlib" + "-Wl,--whole-archive" + "${LIBUNWIND_BUILTINS_LIBRARY}" + "-Wl,--version-script,${CMAKE_CURRENT_SOURCE_DIR}/../gcc_s-${LIBUNWIND_SYNTH_LIBGCC}.ver" + "-Wl,--no-whole-archive") + add_library_flags_if(LIBUNWIND_HAS_PTHREAD_LIB pthread) + add_library_flags_if(LIBUNWIND_HAS_M_LIB m) +elseif (LIBUNWIND_USE_COMPILER_RT) add_library_flags("${LIBUNWIND_BUILTINS_LIBRARY}") else() add_library_flags_if(LIBUNWIND_HAS_GCC_S_LIB gcc_s) @@ -145,6 +162,18 @@ SOVERSION "1" POSITION_INDEPENDENT_CODE ON ) + + if (LIBUNWIND_SYNTH_LIBGCC) + add_custom_target(synth_libgcc_s ALL + DEPENDS unwind_shared + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libunwind.so" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_s.so") + add_custom_target(synth_libgcc_s1 ALL + DEPENDS unwind_shared + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libunwind.so.1" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_s.so.1") + endif() + list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared") if (LIBUNWIND_INSTALL_SHARED_LIBRARY) list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_shared") @@ -179,16 +208,45 @@ target_compile_definitions(unwind_static PRIVATE _LIBUNWIND_HIDE_SYMBOLS) endif() + if (LIBUNWIND_SYNTH_LIBGCC) + add_custom_target(synth_libgcc_eha ALL + DEPENDS unwind_static + COMMAND ${CMAKE_COMMAND} -E create_symlink + "libunwind.a" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_eh.a") + endif() + list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_static") if (LIBUNWIND_INSTALL_STATIC_LIBRARY) list(APPEND LIBUNWIND_INSTALL_TARGETS "unwind_static") endif() endif() +# Create libgcc (not libgcc_{eh,s}) as a static library regardless of how libunwind is built. +if (LIBUNWIND_SYNTH_LIBGCC) + add_custom_target(synth_libgcc ALL + COMMAND ${CMAKE_COMMAND} -E create_symlink + "${LIBUNWIND_BUILTINS_LIBRARY}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc.a") +endif() + # Add a meta-target for both libraries. add_custom_target(unwind DEPENDS ${LIBUNWIND_BUILD_TARGETS}) if (LIBUNWIND_INSTALL_LIBRARY) + if (LIBUNWIND_SYNTH_LIBGCC) + install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc.a" + TYPE LIB) + + if (LIBUNWIND_ENABLE_STATIC) + install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_eh.a" + TYPE LIB) + endif() + + if (LIBUNWIND_ENABLE_SHARED) + install(FILES "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_s.so" + "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libgcc_s.so.1" + TYPE LIB) + endif() + endif() install(TARGETS ${LIBUNWIND_INSTALL_TARGETS} LIBRARY DESTINATION ${LIBUNWIND_INSTALL_LIBRARY_DIR} COMPONENT unwind ARCHIVE DESTINATION ${LIBUNWIND_INSTALL_LIBRARY_DIR} COMPONENT unwind