diff --git a/libunwind/CMakeLists.txt b/libunwind/CMakeLists.txt --- a/libunwind/CMakeLists.txt +++ b/libunwind/CMakeLists.txt @@ -79,6 +79,7 @@ "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 "Synthesise libgcc_s using compiler-rt and libunwind. Requires LIBUNWIND_USE_COMPILER_RT.") set(LIBUNWIND_SYSROOT "" CACHE PATH "Sysroot for cross compiling.") set(LIBUNWIND_TEST_LINKER_FLAGS "" CACHE STRING "Additional linker flags for test programs.") @@ -170,6 +171,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/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,149 @@ +Unwind_Only { + global: + __absvdi2; + __absvsi2; + __absvti2; + __addtf3; + __addvdi3; + __addvsi3; + __addvti3; + __ashlti3; + __ashrti3; + __bswapdi2; + __bswapsi2; + __clear_cache; + __clzdi2; + __clzti2; + __cmpti2; + __ctzdi2; + __ctzti2; + __deregister_frame; + __divdc3; + __divmodti4; + __divsc3; + __divtc3; + __divtf3; + __divti3; + __emutls_get_address; + emutls_init; + __enable_execute_stack; + __eqtf2; + __extenddftf2; + __extendhftf2; + __extendsftf2; + __ffsdi2; + __ffsti2; + _fini; + __fixdfti; + __fixsfti; + __fixtfdi; + __fixtfsi; + __fixtfti; + __fixunsdfdi; + __fixunsdfti; + __fixunssfdi; + __fixunssfti; + __fixunstfdi; + __fixunstfsi; + __fixunstfti; + __floatditf; + __floatsitf; + __floattidf; + __floattisf; + __floattitf; + __floatunditf; + __floatunsitf; + __floatuntidf; + __floatuntisf; + __floatuntitf; + __gcc_personality_v0; + __getf2; + __gttf2; + _init; + __letf2; + __lshrti3; + __lttf2; + __modti3; + __muldc3; + __mulsc3; + __multc3; + __multf3; + __multi3; + __mulvdi3; + __mulvsi3; + __mulvti3; + __negti2; + __negvdi2; + __negvsi2; + __negvti2; + __netf2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; + __powidf2; + __powisf2; + __powitf2; + read_encoded_value_with_base; + __register_frame; + __subtf3; + __subvdi3; + __subvsi3; + __subvti3; + __trunctfdf2; + __trunctfhf2; + __trunctfsf2; + __ucmpti2; + __udivmodti4; + __udivti3; + __umodti3; + __unordtf2; + _Unwind_Backtrace; + _Unwind_DeleteException; + _Unwind_FindEnclosingFunction; + _Unwind_Find_FDE; + _Unwind_ForcedUnwind; + _Unwind_GetCFA; + _Unwind_GetDataRelBase; + _Unwind_GetGR; + _Unwind_GetIP; + _Unwind_GetIPInfo; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; + _Unwind_Resume_or_Rethrow; + _Unwind_SetGR; + _Unwind_SetIP; +}; +GCC_3.0 { + global: + __deregister_frame_info_bases; + __negtf2; + __register_frame_info_bases; + __register_frame_info_table_bases; +} Unwind_Only; + +GCC_3.3 {} Unwind_Only; +GCC_3.3.1 {} Unwind_Only; +GCC_3.4 {} Unwind_Only; +GCC_3.4.2 {} Unwind_Only; +GCC_3.4.4 {} Unwind_Only; +GCC_4.0.0 {} Unwind_Only; +GCC_4.2.0 {} Unwind_Only; + +GCC_4.3.0 { + global: + __emutls_register_common; +} Unwind_Only; + +GCC_4.5.0 {} Unwind_Only; + +GCC_4.7.0 { + global: + __clrsbdi2; + __clrsbti2; +} Unwind_Only; + +GCC_7.0.0 {} Unwind_Only; 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,322 @@ +Unwind_Only { + global: + __cmpdf2; + __cmpsf2; + __divdi3; + __divmodsi4; + emutls_init; + __fe_getround; + __fe_raise_inexact; + _fini; + _init; + __moddi3; + __udivdi3; + __umoddi3; + _Unwind_GetGR; + _Unwind_GetGR.constprop.0; + _Unwind_SetGR; + __sync_fetch_and_add_4; + __sync_fetch_and_add_8; + __sync_fetch_and_and_4; + __sync_fetch_and_and_8; + __sync_fetch_and_max_4; + __sync_fetch_and_max_8; + __sync_fetch_and_min_4; + __sync_fetch_and_min_8; + __sync_fetch_and_nand_4; + __sync_fetch_and_nand_8; + __sync_fetch_and_or_4; + __sync_fetch_and_or_8; + __sync_fetch_and_sub_4; + __sync_fetch_and_sub_8; + __sync_fetch_and_umax_4; + __sync_fetch_and_umax_8; + __sync_fetch_and_umin_4; + __sync_fetch_and_umin_8; + __sync_fetch_and_xor_4; + __sync_fetch_and_xor_8; + __udivmodsi4; + __extendhfsf2; + __gnu_h2f_ieee; + __aeabi_h2f; + __compilerrt_abort_impl; + __mulodi4; + __mulosi4; + __truncdfhf2; + __aeabi_cdcmpeq_check_nan; + __aeabi_cfcmpeq_check_nan; + __aeabi_memcmp; + __aeabi_memcmp4; + __aeabi_memcmp8; + __aeabi_memcpy; + __aeabi_memcpy4; + __aeabi_memcpy8; + __aeabi_memmove; + __aeabi_memmove4; + __aeabi_memmove8; + __aeabi_memset; + __aeabi_memset4; + __aeabi_memset8; + __aeabi_memclr; + __aeabi_memclr4; + __aeabi_memclr8; + __switch16; + __switch32; + __switch8; + __switchu8; + __restore_vfp_d8_d15_regs; + __save_vfp_d8_d15_regs; + __adddf3vfp; + __divdf3vfp; + __eqdf2vfp; + __extendsfdf2vfp; + __fixdfsivfp; + __fixunsdfsivfp; + __floatsidfvfp; + __floatunssidfvfp; + __gedf2vfp; + __gtdf2vfp; + __aeabi_d2h; + __truncsfhf2; + __gnu_f2h_ieee; + __aeabi_f2h; + emutls_key_destructor; + _ZL7fprintfP8_IO_FILEU17pass_object_size1PKcz; + __eprintf; + readEncodedPointer; + __ledf2vfp; + __ltdf2vfp; + __muldf3vfp; + __nedf2vfp; + __negdf2vfp; + __subdf3vfp; + __truncdfsf2vfp; + __unorddf2vfp; + __addsf3vfp; + __divsf3vfp; + __eqsf2vfp; + __fixsfsivfp; + __fixunssfsivfp; + __floatsisfvfp; + __floatunssisfvfp; + __gesf2vfp; + __gtsf2vfp; + __lesf2vfp; + __ltsf2vfp; + __mulsf3vfp; + __negsf2vfp; + __nesf2vfp; + __subsf3vfp; + __unordsf2vfp; +}; +GCC_3.0 { + global: + __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; + _Unwind_DeleteException; + _Unwind_ForcedUnwind; + _Unwind_GetDataRelBase; + _Unwind_GetLanguageSpecificData; + _Unwind_GetRegionStart; + _Unwind_GetTextRelBase; + _Unwind_RaiseException; + _Unwind_Resume; +} Unwind_Only; +GCC_3.3 { + global: + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +} Unwind_Only; +GCC_3.3.1 { + global: + __gcc_personality_v0; +} Unwind_Only; +GCC_3.3.4 { + global: + __unorddf2; + __unordsf2; +} Unwind_Only; +GCC_3.4 { + global: + __clzdi2; + __clzsi2; + __ctzdi2; + __ctzsi2; + __paritydi2; + __paritysi2; + __popcountdi2; + __popcountsi2; +} Unwind_Only; +GCC_3.4.2 { + global: + __enable_execute_stack; +} Unwind_Only; +GCC_3.5 { + global: + __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; + __aeabi_uread4; + __aeabi_uread8; + __aeabi_uwrite4; + __aeabi_uwrite8; + __gnu_unwind_frame; + _Unwind_Complete; + _Unwind_VRS_Get; + _Unwind_VRS_Pop; + _Unwind_VRS_Set; +} Unwind_Only; +GCC_4.0.0 { + global: + __divdc3; + __divsc3; + __muldc3; + __mulsc3; + __powidf2; + __powisf2; +} Unwind_Only; +GCC_4.2.0 { + global: + __floatundidf; + __floatundisf; + __floatunsidf; + __floatunsisf; +} Unwind_Only; +GCC_4.3.0 { + global: + __bswapdi2; + __bswapsi2; + __emutls_get_address; + __emutls_register_common; + __ffssi2; + _Unwind_Backtrace; +} Unwind_Only; +GCC_4.7.0 { + global: + __clrsbdi2; + __clrsbsi2; +} Unwind_Only; +GCC_7.0.0 { + global: + __divmoddi4; +} Unwind_Only; 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,333 @@ +libc { + global: + __dlopen; + __dlclose; + __dlsym; + __dlvsym; + __dlerror; + __dladdr; + __dladdr1; + __dlinfo; + __dlmopen_with_offset; + __dlmopen; +}; +Unwind_Only { + global: + __adddf3; + __addsf3; + __addXf3__; + __ashldi3; + __ashrdi3; + __clzsi2; + __cmpdf2; + __cmpdi2; + __cmpsf2; + __compilerrt_abort_impl; + __compiler_rt_fmax; + __compiler_rt_fmaxf; + __compiler_rt_fmaxl; + __compiler_rt_fmaxX; + __compiler_rt_logb; + __compiler_rt_logbf; + __compiler_rt_logbl; + __compiler_rt_logbX; + __compiler_rt_scalbn; + __compiler_rt_scalbnf; + __compiler_rt_scalbnl; + __compiler_rt_scalbnX; + continueUnwind; + __ctzsi2; + detectX86FamilyModel; + __divdf3; + __divdi3; + __divmoddi4; + __divmodsi4; + __divsf3; + __divsi3; + __divXf3__; + __divXi3; + dstFromRep; + emutls_allocate_object; + emutls_asize; + emutls_check_array_set_size; + emutls_get_address_array; + emutls_get_index; + emutls_getspecific; + emutls_init; + emutls_init_once; + emutls_key_destructor; + emutls_lock; + emutls_memalign_alloc; + emutls_memalign_free; + emutls_new_data_array_size; + emutls_setspecific; + emutls_shutdown; + emutls_unlock; + __eprintf; + __eqdf2; + __eqsf2; + __extendhfsf2; + __extendsfdf2; + __extendXfYf2__; + __fe_getround; + __fe_raise_inexact; + __ffssi2; + __fixdfdi; + __fixdfsi; + __fixint; + __fixsfdi; + __fixsfsi; + __fixuint; + __fixunsdfsi; + __fixunssfsi; + __fixunsxfsi; + __fixxfdi; + __floatdidf; + __floatdisf; + __floatdixf; + __floatsidf; + __floatsisf; + __floatundidf; + __floatundisf; + __floatundixf; + __floatunsidf; + __floatunsisf; + fromRep; + __gedf2; + __gesf2; + getAMDProcessorTypeAndSubtype; + getAvailableFeatures; + getIntelProcessorTypeAndSubtype; + getX86CpuIDAndInfo; + getX86CpuIDAndInfoEx; + getX86XCR0; + __geXf2__; + __gnu_f2h_ieee; + __gnu_h2f_ieee; + __gtdf2; + __gtsf2; + isCpuIdSupported; + __ledf2; + __lesf2; + __leXf2__; + __libunwind_Registers_x86_64_jumpto; + logAPIs; + logDWARF; + logUnwinding; + __lshrdi3; + __ltdf2; + __ltsf2; + __moddi3; + __modsi3; + __modXi3; + __mulddi3; + __muldf3; + __muldi3; + __muldsi3; + __mulodi4; + __mulosi4; + __muloti4; + __muloXi4; + __mulsf3; + __mulvXi3; + __mulXf3__; + __nedf2; + __negdf2; + __negdi2; + __negsf2; + __nesf2; + normalize; + __paritysi2; + __popcountsi2; + readEncodedPointer; + readULEB128; + rep_clz; + srcToRep; + __subdf3; + __subsf3; + toRep; + __truncdfhf2; + __truncdfsf2; + __truncsfhf2; + __truncXfYf2__; + __ucmpdi2; + udiv128by64to64; + __udivdi3; + __udivmoddi4; + __udivmodsi4; + __udivsi3; + __udivXi3; + __umoddi3; + __umodsi3; + __umodXi3; + __unorddf2; + __unordsf2; + __unordXf2__; + __unw_add_dynamic_fde; + __unw_getcontext; + unw_getcontext; + __unw_get_fpreg; + unw_get_fpreg; + __unw_get_proc_info; + unw_get_proc_info; + __unw_get_proc_name; + unw_get_proc_name; + __unw_get_reg; + unw_get_reg; + unwind_phase1; + unwind_phase2; + unwind_phase2_forced; + __unw_init_local; + unw_init_local; + __unw_is_fpreg; + unw_is_fpreg; + __unw_is_signal_frame; + unw_is_signal_frame; + __unw_iterate_dwarf_unwind_cache; + unw_iterate_dwarf_unwind_cache; + __unw_regname; + unw_regname; + __unw_remove_dynamic_fde; + __unw_resume; + unw_resume; + __unw_set_fpreg; + unw_set_fpreg; + __unw_set_reg; + unw_set_reg; + __unw_step; + unw_step; + wideLeftShift; + wideMultiply; + wideRightShiftWithSticky; +} libc; +GCC_3.0 { + global: + __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; + _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; +} Unwind_Only; +GCC_3.3 { + global: + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +} Unwind_Only; +GCC_3.3.1 { + global: + __gcc_personality_v0; +} Unwind_Only; +GCC_3.4.2 { + global: + __enable_execute_stack; +}; +GCC_3.4 { + global: + __clzdi2; + __clzti2; + __ctzdi2; + __ctzti2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; +} Unwind_Only; +GCC_3.4.4 { + global: + __absvti2; + __addvti3; + __mulvti3; + __negvti2; + __subvti3; +} Unwind_Only; +GCC_4.0.0 { + global: + __divdc3; + __divsc3; + __divxc3; + __muldc3; + __mulsc3; + __mulxc3; + __powidf2; + __powisf2; + __powixf2; + __divtc3; + __multc3; +} Unwind_Only; +GCC_4.2.0 { + global: + __floatuntidf; + __floatuntisf; + __floatuntixf; + _Unwind_GetIPInfo; +} Unwind_Only; +GCC_4.3.0 { + global: + __bswapdi2; + __bswapsi2; + __emutls_get_address; +} GCC_4.0.0; +GCC_4.8.0 { + global: + __cpu_indicator_init; +} Unwind_Only; +GCC_7.0.0 { + global: + __divmodti4; +} Unwind_Only; 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,333 @@ +libc { + global: + __dlopen; + __dlclose; + __dlsym; + __dlvsym; + __dlerror; + __dladdr; + __dladdr1; + __dlinfo; + __dlmopen_with_offset; + __dlmopen; +}; +Unwind_Only { + global: + __adddf3; + __addsf3; + __addXf3__; + __ashldi3; + __ashrdi3; + __clzsi2; + __cmpdf2; + __cmpdi2; + __cmpsf2; + __compilerrt_abort_impl; + __compiler_rt_fmax; + __compiler_rt_fmaxf; + __compiler_rt_fmaxl; + __compiler_rt_fmaxX; + __compiler_rt_logb; + __compiler_rt_logbf; + __compiler_rt_logbl; + __compiler_rt_logbX; + __compiler_rt_scalbn; + __compiler_rt_scalbnf; + __compiler_rt_scalbnl; + __compiler_rt_scalbnX; + continueUnwind; + __ctzsi2; + detectX86FamilyModel; + __divdf3; + __divdi3; + __divmoddi4; + __divmodsi4; + __divsf3; + __divsi3; + __divXf3__; + __divXi3; + dstFromRep; + emutls_allocate_object; + emutls_asize; + emutls_check_array_set_size; + emutls_get_address_array; + emutls_get_index; + emutls_getspecific; + emutls_init; + emutls_init_once; + emutls_key_destructor; + emutls_lock; + emutls_memalign_alloc; + emutls_memalign_free; + emutls_new_data_array_size; + emutls_setspecific; + emutls_shutdown; + emutls_unlock; + __eprintf; + __eqdf2; + __eqsf2; + __extendhfsf2; + __extendsfdf2; + __extendXfYf2__; + __fe_getround; + __fe_raise_inexact; + __ffssi2; + __fixdfdi; + __fixdfsi; + __fixint; + __fixsfdi; + __fixsfsi; + __fixuint; + __fixunsdfsi; + __fixunssfsi; + __fixunsxfsi; + __fixxfdi; + __floatdidf; + __floatdisf; + __floatdixf; + __floatsidf; + __floatsisf; + __floatundidf; + __floatundisf; + __floatundixf; + __floatunsidf; + __floatunsisf; + fromRep; + __gedf2; + __gesf2; + getAMDProcessorTypeAndSubtype; + getAvailableFeatures; + getIntelProcessorTypeAndSubtype; + getX86CpuIDAndInfo; + getX86CpuIDAndInfoEx; + getX86XCR0; + __geXf2__; + __gnu_f2h_ieee; + __gnu_h2f_ieee; + __gtdf2; + __gtsf2; + isCpuIdSupported; + __ledf2; + __lesf2; + __leXf2__; + __libunwind_Registers_x86_64_jumpto; + logAPIs; + logDWARF; + logUnwinding; + __lshrdi3; + __ltdf2; + __ltsf2; + __moddi3; + __modsi3; + __modXi3; + __mulddi3; + __muldf3; + __muldi3; + __muldsi3; + __mulodi4; + __mulosi4; + __muloti4; + __muloXi4; + __mulsf3; + __mulvXi3; + __mulXf3__; + __nedf2; + __negdf2; + __negdi2; + __negsf2; + __nesf2; + normalize; + __paritysi2; + __popcountsi2; + readEncodedPointer; + readULEB128; + rep_clz; + srcToRep; + __subdf3; + __subsf3; + toRep; + __truncdfhf2; + __truncdfsf2; + __truncsfhf2; + __truncXfYf2__; + __ucmpdi2; + udiv128by64to64; + __udivdi3; + __udivmoddi4; + __udivmodsi4; + __udivsi3; + __udivXi3; + __umoddi3; + __umodsi3; + __umodXi3; + __unorddf2; + __unordsf2; + __unordXf2__; + __unw_add_dynamic_fde; + __unw_getcontext; + unw_getcontext; + __unw_get_fpreg; + unw_get_fpreg; + __unw_get_proc_info; + unw_get_proc_info; + __unw_get_proc_name; + unw_get_proc_name; + __unw_get_reg; + unw_get_reg; + unwind_phase1; + unwind_phase2; + unwind_phase2_forced; + __unw_init_local; + unw_init_local; + __unw_is_fpreg; + unw_is_fpreg; + __unw_is_signal_frame; + unw_is_signal_frame; + __unw_iterate_dwarf_unwind_cache; + unw_iterate_dwarf_unwind_cache; + __unw_regname; + unw_regname; + __unw_remove_dynamic_fde; + __unw_resume; + unw_resume; + __unw_set_fpreg; + unw_set_fpreg; + __unw_set_reg; + unw_set_reg; + __unw_step; + unw_step; + wideLeftShift; + wideMultiply; + wideRightShiftWithSticky; +} libc; +GCC_3.0 { + global: + __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; + _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; +} Unwind_Only; +GCC_3.3 { + global: + _Unwind_Backtrace; + _Unwind_FindEnclosingFunction; + _Unwind_GetCFA; + _Unwind_Resume_or_Rethrow; +} Unwind_Only; +GCC_3.3.1 { + global: + __gcc_personality_v0; +} Unwind_Only; +GCC_3.4.2 { + global: + __enable_execute_stack; +}; +GCC_3.4 { + global: + __clzdi2; + __clzti2; + __ctzdi2; + __ctzti2; + __paritydi2; + __parityti2; + __popcountdi2; + __popcountti2; +} Unwind_Only; +GCC_3.4.4 { + global: + __absvti2; + __addvti3; + __mulvti3; + __negvti2; + __subvti3; +} Unwind_Only; +GCC_4.0.0 { + global: + __divdc3; + __divsc3; + __divxc3; + __muldc3; + __mulsc3; + __mulxc3; + __powidf2; + __powisf2; + __powixf2; + __divtc3; + __multc3; +} Unwind_Only; +GCC_4.2.0 { + global: + __floatuntidf; + __floatuntisf; + __floatuntixf; + _Unwind_GetIPInfo; +} Unwind_Only; +GCC_4.3.0 { + global: + __bswapdi2; + __bswapsi2; + __emutls_get_address; +} GCC_4.0.0; +GCC_4.8.0 { + global: + __cpu_indicator_init; +} Unwind_Only; +GCC_7.0.0 { + global: + __divmodti4; +} Unwind_Only; diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -67,7 +67,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) @@ -140,6 +157,18 @@ OUTPUT_NAME "unwind" VERSION "1.0" SOVERSION "1") + + 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") @@ -171,16 +200,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