Ivan Serdyuk via llvm-dev
2020-Aug-15 10:47 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
Hello. I was trying to compile https://github.com/llvm/llvm-project/tree/master/libunwind using: - MSVC - Clang I wasn't able to configure this project for using MSVC (directly or via clang-cl):>cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm"-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" ../libunwind -- The C compiler identification is MSVC 19.27.29109.0 -- The CXX compiler identification is MSVC 19.27.29109.0 -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using Release VC++ CRT: MD -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Looking for fopen in c -- Looking for fopen in c - not found -- Looking for __gcc_personality_v0 in gcc_s -- Looking for __gcc_personality_v0 in gcc_s - not found -- Looking for __absvdi2 in gcc -- Looking for __absvdi2 in gcc - not found -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Failed -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Failed -- Looking for __arm__ -- Looking for __arm__ - not found -- Looking for __USING_SJLJ_EXCEPTIONS__ -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found -- Looking for __ARM_DWARF_EH__ -- Looking for __ARM_DWARF_EH__ - not found -- Looking for dladdr in dl -- Looking for dladdr in dl - not found -- Looking for pthread_once in pthread -- Looking for pthread_once in pthread - not found -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Failed CMake Error at src/CMakeLists.txt:86 (message): Compiler doesn't support generation of unwind tables if exception support is disabled. Building libunwind DSO with runtime dependency on C++ ABI library is not supported. -- Configuring incomplete, errors occurred! See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeOutput.log". See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeError.log". So I am attaching these logs. I tried to compile using Clang. I have configured libunwind:>cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm"-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../libunwind -- The C compiler identification is Clang 10.0.0 with GNU-like command-line -- The CXX compiler identification is Clang 10.0.0 with GNU-like command-line -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test C_SUPPORTS_WERROR_DATE_TIME -- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Looking for fopen in c -- Looking for fopen in c - not found -- Looking for __gcc_personality_v0 in gcc_s -- Looking for __gcc_personality_v0 in gcc_s - not found -- Looking for __absvdi2 in gcc -- Looking for __absvdi2 in gcc - not found -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Success -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA - Failed -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Success -- Looking for __arm__ -- Looking for __arm__ - not found -- Looking for __USING_SJLJ_EXCEPTIONS__ -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found -- Looking for __ARM_DWARF_EH__ -- Looking for __ARM_DWARF_EH__ - not found -- Looking for dladdr in dl -- Looking for dladdr in dl - not found -- Looking for pthread_once in pthread -- Looking for pthread_once in pthread - not found -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Success -- Configuring done -- Generating done -- Build files have been written to: C:/Users/clang/libunwind2 Then I tried to build it:>ninja -w dupbuild=warnninja: warning: multiple rules generate lib/unwind.lib. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn] [4/9] Building C object src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj In file included from C:/Users/clang/libunwind/src/Unwind-sjlj.c:19: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ 1 warning generated. [5/9] Building C object src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj In file included from C:/Users/clang/libunwind/src/UnwindLevel1.c:28: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:350:1: warning: redeclaration of '_Unwind_RaiseException' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_RaiseException(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:174:5: note: previous declaration is here _Unwind_RaiseException(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:385:1: warning: redeclaration of '_Unwind_Resume' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Resume(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:175:13: note: previous declaration is here extern void _Unwind_Resume(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:408:1: warning: redeclaration of '_Unwind_ForcedUnwind' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, ^ C:/Users/clang/libunwind/include\unwind.h:277:5: note: previous declaration is here _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:428:1: warning: redeclaration of '_Unwind_GetLanguageSpecificData' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:270:5: note: previous declaration is here _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:449:1: warning: redeclaration of '_Unwind_GetRegionStart' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetRegionStart(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:268:18: note: previous declaration is here extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:465:1: warning: redeclaration of '_Unwind_DeleteException' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_DeleteException(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:177:13: note: previous declaration is here extern void _Unwind_DeleteException(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:475:1: warning: redeclaration of '_Unwind_GetGR' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetGR(struct _Unwind_Context *context, int index) { ^ C:/Users/clang/libunwind/include\unwind.h:221:18: note: previous declaration is here extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:485:24: warning: redeclaration of '_Unwind_SetGR' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index, ^ C:/Users/clang/libunwind/include\unwind.h:222:13: note: previous declaration is here extern void _Unwind_SetGR(struct _Unwind_Context *context, int index, ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:495:29: warning: redeclaration of '_Unwind_GetIP' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:224:18: note: previous declaration is here extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:507:24: warning: redeclaration of '_Unwind_SetIP' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/include\unwind.h:225:13: note: previous declaration is here extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value); ^ 11 warnings generated. [6/9] Building C object src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj In file included from C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:19: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:33:1: warning: redeclaration of '_Unwind_Resume_or_Rethrow' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:299:5: note: previous declaration is here _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:70:1: warning: redeclaration of '_Unwind_GetDataRelBase' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetDataRelBase(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:356:18: note: previous declaration is here extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:80:1: warning: redeclaration of '_Unwind_GetTextRelBase' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetTextRelBase(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:358:18: note: previous declaration is here extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:89:25: warning: redeclaration of '_Unwind_FindEnclosingFunction' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { ^ C:/Users/clang/libunwind/include\unwind.h:352:14: note: previous declaration is here extern void *_Unwind_FindEnclosingFunction(void *pc); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:108:1: warning: redeclaration of '_Unwind_Backtrace' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { ^ C:/Users/clang/libunwind/include\unwind.h:307:28: note: previous declaration is here extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:187:31: warning: redeclaration of '_Unwind_Find_FDE' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc, ^ C:/Users/clang/libunwind/include\unwind.h:344:20: note: previous declaration is here extern const void *_Unwind_Find_FDE(const void *pc, struct dwarf_eh_bases *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:208:29: warning: redeclaration of '_Unwind_GetCFA' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:312:18: note: previous declaration is here extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:221:29: warning: redeclaration of '_Unwind_GetIPInfo' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/include\unwind.h:321:18: note: previous declaration is here extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:241:24: warning: redeclaration of '__register_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:331:13: note: previous declaration is here extern void __register_frame(const void *fde); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:251:24: warning: redeclaration of '__deregister_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:332:13: note: previous declaration is here extern void __deregister_frame(const void *fde); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:266:24: warning: redeclaration of '__register_frame_info_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void *ob, ^ C:/Users/clang/libunwind/include\unwind.h:364:13: note: previous declaration is here extern void __register_frame_info_bases(const void *fde, void *ob, void *tb, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:277:24: warning: redeclaration of '__register_frame_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { ^ C:/Users/clang/libunwind/include\unwind.h:366:13: note: previous declaration is here extern void __register_frame_info(const void *fde, void *ob) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:284:24: warning: redeclaration of '__register_frame_info_table_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_table_bases(const void *fde, ^ C:/Users/clang/libunwind/include\unwind.h:368:13: note: previous declaration is here extern void __register_frame_info_table_bases(const void *fde, void *ob, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:296:24: warning: redeclaration of '__register_frame_info_table' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) { ^ C:/Users/clang/libunwind/include\unwind.h:371:13: note: previous declaration is here extern void __register_frame_info_table(const void *fde, void *ob) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:303:24: warning: redeclaration of '__register_frame_table' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:373:13: note: previous declaration is here extern void __register_frame_table(const void *fde) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:309:25: warning: redeclaration of '__deregister_frame_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:375:14: note: previous declaration is here extern void *__deregister_frame_info(const void *fde) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:316:25: warning: redeclaration of '__deregister_frame_info_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:377:14: note: previous declaration is here extern void *__deregister_frame_info_bases(const void *fde) ^ 18 warnings generated. [8/9] Building CXX object src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj In file included from C:/Users/clang/libunwind/src/libunwind.cpp:22: In file included from C:/Users/clang/libunwind/src/UnwindCursor.hpp:67: In file included from C:/Users/clang/libunwind/src/CompactUnwinder.hpp:19: C:/Users/clang/libunwind/include\mach-o/compact_unwind_encoding.h:45:5: warning: enumerator value is not representable in the underlying type 'int' [-Wmicrosoft-enum-value] UNWIND_IS_NOT_FUNCTION_START = 0x80000000, ^ C:/Users/clang/libunwind/src/libunwind.cpp:29:36: warning: redeclaration of 'unw_local_addr_space' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space ^ C:/Users/clang/libunwind/include\libunwind.h:125:25: note: previous declaration is here extern unw_addr_space_t unw_local_addr_space; ^ C:/Users/clang/libunwind/src/libunwind.cpp:76:41: warning: redeclaration of 'unw_init_local' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_init_local, unw_init_local) ^ C:/Users/clang/libunwind/include\libunwind.h:104:12: note: previous declaration is here extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:91:38: warning: redeclaration of 'unw_get_reg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_reg, unw_get_reg) ^ C:/Users/clang/libunwind/include\libunwind.h:106:12: note: previous declaration is here extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:123:38: warning: redeclaration of 'unw_set_reg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_set_reg, unw_set_reg) ^ C:/Users/clang/libunwind/include\libunwind.h:108:12: note: previous declaration is here extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:138:40: warning: redeclaration of 'unw_get_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_fpreg, unw_get_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:107:12: note: previous declaration is here extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:157:40: warning: redeclaration of 'unw_set_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_set_fpreg, unw_set_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:109:12: note: previous declaration is here extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:165:35: warning: redeclaration of 'unw_step' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_step, unw_step) ^ C:/Users/clang/libunwind/include\libunwind.h:105:12: note: previous declaration is here extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:178:44: warning: redeclaration of 'unw_get_proc_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info) ^ C:/Users/clang/libunwind/include\libunwind.h:119:12: note: previous declaration is here extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:187:37: warning: redeclaration of 'unw_resume' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_resume, unw_resume) ^ C:/Users/clang/libunwind/include\libunwind.h:110:12: note: previous declaration is here extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:200:44: warning: redeclaration of 'unw_get_proc_name' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_name, unw_get_proc_name) ^ C:/Users/clang/libunwind/include\libunwind.h:122:12: note: previous declaration is here extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:210:39: warning: redeclaration of 'unw_is_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_is_fpreg, unw_is_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:120:12: note: previous declaration is here extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:220:38: warning: redeclaration of 'unw_regname' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_regname, unw_regname) ^ C:/Users/clang/libunwind/include\libunwind.h:118:20: note: previous declaration is here extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:229:46: warning: redeclaration of 'unw_is_signal_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_is_signal_frame, unw_is_signal_frame) ^ C:/Users/clang/libunwind/include\libunwind.h:121:12: note: previous declaration is here extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:293:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_APIS") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ C:/Users/clang/libunwind/src/libunwind.cpp:305:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_UNWINDING") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ C:/Users/clang/libunwind/src/libunwind.cpp:317:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_DWARF") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ 17 warnings generated. [9/9] Linking C shared library lib\unwind.dll FAILED: lib/unwind.dll lib/unwind.lib cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -nostartfiles -nostdlib -Werror=date-time -Werror=unguarded-availability-new -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -nodefaultlibs -shared -o lib\unwind.dll -Xlinker /implib:lib\unwind.lib -Xlinker /pdb:lib\unwind.pdb -Xlinker /version:1.0 src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj src/CMakeFiles/unwind_shared.dir/Unwind-EHABI.cpp.obj src/CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.obj src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj src/CMakeFiles/unwind_shared.dir/UnwindRegistersRestore.S.obj src/CMakeFiles/unwind_shared.dir/UnwindRegistersSave.S.obj -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ." Creating library lib\unwind.lib and object lib\unwind.exp libunwind.cpp.obj : error LNK2019: *unresolved external symbol "public: void __thiscall libunwind::Registers_x86::jumpto(void)" (?jumpto at Registers_x86@libunwind@@QAEXXZ) referenced in function "public: virtual void __thiscall libunwind::UnwindCursor<class libunwind::LocalAddressSpace,class libunwind::Registers_x86*>::jumpto(void)" (?jumpto@?$UnwindCursor at VLocalAddressSpace@libunwind@@VRegisters_x86 at 2 @@libunwind@@UAEXXZ) lib\unwind.dll : fatal error LNK1120: 1 unresolved externals clang: error: linker command failed with exit code 1120 (use -v to see invocation) ninja: build stopped: subcommand failed. So there were some linking issues. Some assistance would be much appreciated. Microsoft's linker has it's version 14.27.29109.0 (VS 2019). Clang's version is clang version 10.0.0 (Target: i686-pc-windows-msvc) Ninja's version is 1.10.0.git.kitware.jobserver-1 Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/f0e32348/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeOutput.log Type: application/octet-stream Size: 4613 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/f0e32348/attachment-0002.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: CMakeError.log Type: application/octet-stream Size: 41400 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/f0e32348/attachment-0003.obj>
Shoaib Meenai via llvm-dev
2020-Aug-15 18:47 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
libunwind is only needed on Windows if you’re using the Itanium C++ ABI (e.g. with MinGW). What’s your end goal with building libunwind? From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Ivan Serdyuk via llvm-dev <llvm-dev at lists.llvm.org> Reply-To: Ivan Serdyuk <local.tourist.kiev at gmail.com> Date: Saturday, August 15, 2020 at 10:05 AM To: "llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org> Subject: [llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang Hello. I was trying to compile https://github.com/llvm/llvm-project/tree/master/libunwind using: · MSVC · Clang I wasn't able to configure this project for using MSVC (directly or via clang-cl):>cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" ../libunwind-- The C compiler identification is MSVC 19.27.29109.0 -- The CXX compiler identification is MSVC 19.27.29109.0 -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using Release VC++ CRT: MD -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Looking for fopen in c -- Looking for fopen in c - not found -- Looking for __gcc_personality_v0 in gcc_s -- Looking for __gcc_personality_v0 in gcc_s - not found -- Looking for __absvdi2 in gcc -- Looking for __absvdi2 in gcc - not found -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Failed -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Failed -- Looking for __arm__ -- Looking for __arm__ - not found -- Looking for __USING_SJLJ_EXCEPTIONS__ -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found -- Looking for __ARM_DWARF_EH__ -- Looking for __ARM_DWARF_EH__ - not found -- Looking for dladdr in dl -- Looking for dladdr in dl - not found -- Looking for pthread_once in pthread -- Looking for pthread_once in pthread - not found -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Failed CMake Error at src/CMakeLists.txt:86 (message): Compiler doesn't support generation of unwind tables if exception support is disabled. Building libunwind DSO with runtime dependency on C++ ABI library is not supported. -- Configuring incomplete, errors occurred! See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeOutput.log". See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeError.log". So I am attaching these logs. I tried to compile using Clang. I have configured libunwind:>cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../libunwind-- The C compiler identification is Clang 10.0.0 with GNU-like command-line -- The CXX compiler identification is Clang 10.0.0 with GNU-like command-line -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Performing Test C_SUPPORTS_WERROR_DATE_TIME -- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success -- Looking for os_signpost_interval_begin -- Looking for os_signpost_interval_begin - not found -- Looking for fopen in c -- Looking for fopen in c - not found -- Looking for __gcc_personality_v0 in gcc_s -- Looking for __gcc_personality_v0 in gcc_s - not found -- Looking for __absvdi2 in gcc -- Looking for __absvdi2 in gcc - not found -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Success -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA - Failed -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Success -- Looking for __arm__ -- Looking for __arm__ - not found -- Looking for __USING_SJLJ_EXCEPTIONS__ -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found -- Looking for __ARM_DWARF_EH__ -- Looking for __ARM_DWARF_EH__ - not found -- Looking for dladdr in dl -- Looking for dladdr in dl - not found -- Looking for pthread_once in pthread -- Looking for pthread_once in pthread - not found -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Failed -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Success -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Success -- Configuring done -- Generating done -- Build files have been written to: C:/Users/clang/libunwind2 Then I tried to build it:>ninja -w dupbuild=warnninja: warning: multiple rules generate lib/unwind.lib. builds involving this target will not be correct; continuing anyway [-w dupbuild=warn] [4/9] Building C object src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj In file included from C:/Users/clang/libunwind/src/Unwind-sjlj.c:19: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ 1 warning generated. [5/9] Building C object src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj In file included from C:/Users/clang/libunwind/src/UnwindLevel1.c:28: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:350:1: warning: redeclaration of '_Unwind_RaiseException' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_RaiseException(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:174:5: note: previous declaration is here _Unwind_RaiseException(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:385:1: warning: redeclaration of '_Unwind_Resume' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Resume(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:175:13: note: previous declaration is here extern void _Unwind_Resume(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:408:1: warning: redeclaration of '_Unwind_ForcedUnwind' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, ^ C:/Users/clang/libunwind/include\unwind.h:277:5: note: previous declaration is here _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:428:1: warning: redeclaration of '_Unwind_GetLanguageSpecificData' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:270:5: note: previous declaration is here _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:449:1: warning: redeclaration of '_Unwind_GetRegionStart' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetRegionStart(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:268:18: note: previous declaration is here extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:465:1: warning: redeclaration of '_Unwind_DeleteException' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_DeleteException(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:177:13: note: previous declaration is here extern void _Unwind_DeleteException(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:475:1: warning: redeclaration of '_Unwind_GetGR' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetGR(struct _Unwind_Context *context, int index) { ^ C:/Users/clang/libunwind/include\unwind.h:221:18: note: previous declaration is here extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:485:24: warning: redeclaration of '_Unwind_SetGR' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int index, ^ C:/Users/clang/libunwind/include\unwind.h:222:13: note: previous declaration is here extern void _Unwind_SetGR(struct _Unwind_Context *context, int index, ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:495:29: warning: redeclaration of '_Unwind_GetIP' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:224:18: note: previous declaration is here extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context); ^ C:/Users/clang/libunwind/src/UnwindLevel1.c:507:24: warning: redeclaration of '_Unwind_SetIP' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/include\unwind.h:225:13: note: previous declaration is here extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value); ^ 11 warnings generated. [6/9] Building C object src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj In file included from C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:19: C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by macro definition [-Wkeyword-macro] #define static_assert(__b, __m) \ ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:33:1: warning: redeclaration of '_Unwind_Resume_or_Rethrow' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { ^ C:/Users/clang/libunwind/include\unwind.h:299:5: note: previous declaration is here _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:70:1: warning: redeclaration of '_Unwind_GetDataRelBase' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetDataRelBase(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:356:18: note: previous declaration is here extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:80:1: warning: redeclaration of '_Unwind_GetTextRelBase' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_GetTextRelBase(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:358:18: note: previous declaration is here extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:89:25: warning: redeclaration of '_Unwind_FindEnclosingFunction' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { ^ C:/Users/clang/libunwind/include\unwind.h:352:14: note: previous declaration is here extern void *_Unwind_FindEnclosingFunction(void *pc); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:108:1: warning: redeclaration of '_Unwind_Backtrace' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { ^ C:/Users/clang/libunwind/include\unwind.h:307:28: note: previous declaration is here extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:187:31: warning: redeclaration of '_Unwind_Find_FDE' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc, ^ C:/Users/clang/libunwind/include\unwind.h:344:20: note: previous declaration is here extern const void *_Unwind_Find_FDE(const void *pc, struct dwarf_eh_bases *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:208:29: warning: redeclaration of '_Unwind_GetCFA' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context *context) { ^ C:/Users/clang/libunwind/include\unwind.h:312:18: note: previous declaration is here extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context *); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:221:29: warning: redeclaration of '_Unwind_GetIPInfo' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/include\unwind.h:321:18: note: previous declaration is here extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:241:24: warning: redeclaration of '__register_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:331:13: note: previous declaration is here extern void __register_frame(const void *fde); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:251:24: warning: redeclaration of '__deregister_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:332:13: note: previous declaration is here extern void __deregister_frame(const void *fde); ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:266:24: warning: redeclaration of '__register_frame_info_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void *ob, ^ C:/Users/clang/libunwind/include\unwind.h:364:13: note: previous declaration is here extern void __register_frame_info_bases(const void *fde, void *ob, void *tb, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:277:24: warning: redeclaration of '__register_frame_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { ^ C:/Users/clang/libunwind/include\unwind.h:366:13: note: previous declaration is here extern void __register_frame_info(const void *fde, void *ob) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:284:24: warning: redeclaration of '__register_frame_info_table_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_table_bases(const void *fde, ^ C:/Users/clang/libunwind/include\unwind.h:368:13: note: previous declaration is here extern void __register_frame_info_table_bases(const void *fde, void *ob, ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:296:24: warning: redeclaration of '__register_frame_info_table' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void *ob) { ^ C:/Users/clang/libunwind/include\unwind.h:371:13: note: previous declaration is here extern void __register_frame_info_table(const void *fde, void *ob) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:303:24: warning: redeclaration of '__register_frame_table' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:373:13: note: previous declaration is here extern void __register_frame_table(const void *fde) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:309:25: warning: redeclaration of '__deregister_frame_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:375:14: note: previous declaration is here extern void *__deregister_frame_info(const void *fde) ^ C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:316:25: warning: redeclaration of '__deregister_frame_info_bases' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { ^ C:/Users/clang/libunwind/include\unwind.h:377:14: note: previous declaration is here extern void *__deregister_frame_info_bases(const void *fde) ^ 18 warnings generated. [8/9] Building CXX object src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj In file included from C:/Users/clang/libunwind/src/libunwind.cpp:22: In file included from C:/Users/clang/libunwind/src/UnwindCursor.hpp:67: In file included from C:/Users/clang/libunwind/src/CompactUnwinder.hpp:19: C:/Users/clang/libunwind/include\mach-o/compact_unwind_encoding.h:45:5: warning: enumerator value is not representable in the underlying type 'int' [-Wmicrosoft-enum-value] UNWIND_IS_NOT_FUNCTION_START = 0x80000000, ^ C:/Users/clang/libunwind/src/libunwind.cpp:29:36: warning: redeclaration of 'unw_local_addr_space' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space ^ C:/Users/clang/libunwind/include\libunwind.h:125:25: note: previous declaration is here extern unw_addr_space_t unw_local_addr_space; ^ C:/Users/clang/libunwind/src/libunwind.cpp:76:41: warning: redeclaration of 'unw_init_local' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_init_local, unw_init_local) ^ C:/Users/clang/libunwind/include\libunwind.h:104:12: note: previous declaration is here extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:91:38: warning: redeclaration of 'unw_get_reg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_reg, unw_get_reg) ^ C:/Users/clang/libunwind/include\libunwind.h:106:12: note: previous declaration is here extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:123:38: warning: redeclaration of 'unw_set_reg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_set_reg, unw_set_reg) ^ C:/Users/clang/libunwind/include\libunwind.h:108:12: note: previous declaration is here extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:138:40: warning: redeclaration of 'unw_get_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_fpreg, unw_get_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:107:12: note: previous declaration is here extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:157:40: warning: redeclaration of 'unw_set_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_set_fpreg, unw_set_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:109:12: note: previous declaration is here extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:165:35: warning: redeclaration of 'unw_step' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_step, unw_step) ^ C:/Users/clang/libunwind/include\libunwind.h:105:12: note: previous declaration is here extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:178:44: warning: redeclaration of 'unw_get_proc_info' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info) ^ C:/Users/clang/libunwind/include\libunwind.h:119:12: note: previous declaration is here extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:187:37: warning: redeclaration of 'unw_resume' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_resume, unw_resume) ^ C:/Users/clang/libunwind/include\libunwind.h:110:12: note: previous declaration is here extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:200:44: warning: redeclaration of 'unw_get_proc_name' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_name, unw_get_proc_name) ^ C:/Users/clang/libunwind/include\libunwind.h:122:12: note: previous declaration is here extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:210:39: warning: redeclaration of 'unw_is_fpreg' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_is_fpreg, unw_is_fpreg) ^ C:/Users/clang/libunwind/include\libunwind.h:120:12: note: previous declaration is here extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:220:38: warning: redeclaration of 'unw_regname' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_regname, unw_regname) ^ C:/Users/clang/libunwind/include\libunwind.h:118:20: note: previous declaration is here extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:229:46: warning: redeclaration of 'unw_is_signal_frame' should not add 'dllexport' attribute [-Wdll-attribute-on-redeclaration] _LIBUNWIND_WEAK_ALIAS(__unw_is_signal_frame, unw_is_signal_frame) ^ C:/Users/clang/libunwind/include\libunwind.h:121:12: note: previous declaration is here extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; ^ C:/Users/clang/libunwind/src/libunwind.cpp:293:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_APIS") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ C:/Users/clang/libunwind/src/libunwind.cpp:305:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_UNWINDING") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ C:/Users/clang/libunwind/src/libunwind.cpp:317:12: warning: 'getenv' is deprecated: This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. [-Wdeprecated-declarations] log = (getenv("LIBUNWIND_PRINT_DWARF") != NULL); ^ C:\Program Files\Windows Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been explicitly marked deprecated here _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: note: expanded from macro '_CRT_INSECURE_DEPRECATE' #define _CRT_INSECURE_DEPRECATE(_Replacement) _CRT_DEPRECATE_TEXT( \ ^ C:\Program Files\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: note: expanded from macro '_CRT_DEPRECATE_TEXT' #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) ^ 17 warnings generated. [9/9] Linking C shared library lib\unwind.dll FAILED: lib/unwind.dll lib/unwind.lib cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -nostartfiles -nostdlib -Werror=date-time -Werror=unguarded-availability-new -Wextra -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wdelete-non-virtual-dtor -Wstring-conversion -O3 -DNDEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrt -nodefaultlibs -shared -o lib\unwind.dll -Xlinker /implib:lib\unwind.lib -Xlinker /pdb:lib\unwind.pdb -Xlinker /version:1.0 src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj src/CMakeFiles/unwind_shared.dir/Unwind-EHABI.cpp.obj src/CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.obj src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj src/CMakeFiles/unwind_shared.dir/UnwindRegistersRestore.S.obj src/CMakeFiles/unwind_shared.dir/UnwindRegistersSave.S.obj -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 -loldnames && cd ." Creating library lib\unwind.lib and object lib\unwind.exp libunwind.cpp.obj : error LNK2019: unresolved external symbol "public: void __thiscall libunwind::Registers_x86::jumpto(void)" (?jumpto at Registers_x86@libunwind@@QAEXXZ) referenced in function "public: virtual void __thiscall libunwind::UnwindCursor<class libunwind::LocalAddressSpace,class libunwind::Registers_x86>::jumpto(void)" (?jumpto@?$UnwindCursor at VLocalAddressSpace@libunwind@@VRegisters_x86 at 2@@libunwind@@UAEXXZ) lib\unwind.dll : fatal error LNK1120: 1 unresolved externals clang: error: linker command failed with exit code 1120 (use -v to see invocation) ninja: build stopped: subcommand failed. So there were some linking issues. Some assistance would be much appreciated. Microsoft's linker has it's version 14.27.29109.0 (VS 2019). Clang's version is clang version 10.0.0 (Target: i686-pc-windows-msvc) Ninja's version is 1.10.0.git.kitware.jobserver-1 Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/34239656/attachment-0001.html>
Ivan Serdyuk via llvm-dev
2020-Aug-15 19:49 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
I had no targets on Itanium - and I do not have such hardware around. https://go.googlesource.com/gollvm/ depends on https://github.com/ianlancetaylor/libbacktrace . It was able to compile libbacktrace on x86_64 Linux (Intel) https://github.com/ianlancetaylor/libbacktrace/blob/5a99ff7fed66b8ea8f09c9805c138524a7035ece/README.md - and must say that Itanium related API was adopted to work on Linux. So my issues are around searching for a replacement - I thought that LLVM's subproject could be a modern option. Ian explained that he is not familiar with what LLVM's sub-projects offer - but it is more modern, compared to what GNU lib offers. So it would allow me to get read of GNU related dependencies. Back to the linking bug: the question is in a choice for Windows native functionality (library), which would either give similar capabilities or it would make sense to re-implemented unwinding API (Windows has its own support for unwinding, according to MSDN). So while patching the build config is a matter of the near future (just to check API compatibility and allow gollvm to compile, during the next stage) - alternative unwinding APIs could be proposed. https://github.com/ianlancetaylor/libbacktrace/tree/5a99ff7fed66b8ea8f09c9805c138524a7035ece doesn't have a Windows poty, so far. It would require re-designing, to use LLVM oriented approach. Ivan On Sat, Aug 15, 2020 at 6:48 PM Shoaib Meenai <smeenai at fb.com> wrote:> libunwind is only needed on Windows if you’re using the Itanium C++ ABI > (e.g. with MinGW). >That does not explain why I saw x86_64 options, among the source code.> What’s your end goal with building libunwind? > > > > *From: *llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Ivan > Serdyuk via llvm-dev <llvm-dev at lists.llvm.org> > *Reply-To: *Ivan Serdyuk <local.tourist.kiev at gmail.com> > *Date: *Saturday, August 15, 2020 at 10:05 AM > *To: *"llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org> > *Subject: *[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) > for MSVC and Clang > > > > > > Hello. > > I was trying to compile > https://github.com/llvm/llvm-project/tree/master/libunwind using: > > · MSVC > > · Clang > > I wasn't able to configure this project for using MSVC (directly or via > clang-cl): > > >cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm" > -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" ../libunwind > > -- The C compiler identification is MSVC 19.27.29109.0 > > -- The CXX compiler identification is MSVC 19.27.29109.0 > > -- Check for working C compiler: C:/Program Files/Microsoft Visual > Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe > > -- Check for working C compiler: C:/Program Files/Microsoft Visual > Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- > works > > -- Detecting C compiler ABI info > > -- Detecting C compiler ABI info - done > > -- Detecting C compile features > > -- Detecting C compile features - done > > -- Check for working CXX compiler: C:/Program Files/Microsoft Visual > Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe > > -- Check for working CXX compiler: C:/Program Files/Microsoft Visual > Studio/2019/Preview/VC/Tools/MSVC/14.27.29109/bin/Hostx86/x86/cl.exe -- > works > > -- Detecting CXX compiler ABI info > > -- Detecting CXX compiler ABI info - done > > -- Detecting CXX compile features > > -- Detecting CXX compile features - done > > -- Using Release VC++ CRT: MD > > -- Looking for os_signpost_interval_begin > > -- Looking for os_signpost_interval_begin - not found > > -- Looking for fopen in c > > -- Looking for fopen in c - not found > > -- Looking for __gcc_personality_v0 in gcc_s > > -- Looking for __gcc_personality_v0 in gcc_s - not found > > -- Looking for __absvdi2 in gcc > > -- Looking for __absvdi2 in gcc - not found > > -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG > > -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Failed > > -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG > > -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Failed > > -- Looking for __arm__ > > -- Looking for __arm__ - not found > > -- Looking for __USING_SJLJ_EXCEPTIONS__ > > -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found > > -- Looking for __ARM_DWARF_EH__ > > -- Looking for __ARM_DWARF_EH__ - not found > > -- Looking for dladdr in dl > > -- Looking for dladdr in dl - not found > > -- Looking for pthread_once in pthread > > -- Looking for pthread_once in pthread - not found > > -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Failed > > CMake Error at src/CMakeLists.txt:86 (message): > > Compiler doesn't support generation of unwind tables if exception support > > is disabled. Building libunwind DSO with runtime dependency on C++ ABI > > library is not supported. > > > > > > -- Configuring incomplete, errors occurred! > > See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeOutput.log". > > See also "C:/Users/clang/libunwind2/CMakeFiles/CMakeError.log". > > > > So I am attaching these logs. > > > > I tried to compile using Clang. > > I have configured libunwind: > > > > >cmake -G Ninja -DLLVM_PATH="C:/Users/clang/llvm-project-10.0.1/llvm" > -DCMAKE_BUILD_TYPE=Release > -DCMAKE_INSTALL_PREFIX="C:\Users\clang\libunwind_llvm" > -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../libunwind > > -- The C compiler identification is Clang 10.0.0 with GNU-like command-line > > -- The CXX compiler identification is Clang 10.0.0 with GNU-like > command-line > > -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe > > -- Check for working C compiler: C:/Program Files/LLVM/bin/clang.exe -- > works > > -- Detecting C compiler ABI info > > -- Detecting C compiler ABI info - done > > -- Detecting C compile features > > -- Detecting C compile features - done > > -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe > > -- Check for working CXX compiler: C:/Program Files/LLVM/bin/clang++.exe > -- works > > -- Detecting CXX compiler ABI info > > -- Detecting CXX compiler ABI info - done > > -- Detecting CXX compile features > > -- Detecting CXX compile features - done > > -- Performing Test C_SUPPORTS_WERROR_DATE_TIME > > -- Performing Test C_SUPPORTS_WERROR_DATE_TIME - Success > > -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME > > -- Performing Test CXX_SUPPORTS_WERROR_DATE_TIME - Success > > -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW > > -- Performing Test C_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success > > -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW > > -- Performing Test CXX_SUPPORTS_WERROR_UNGUARDED_AVAILABILITY_NEW - Success > > -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG > > -- Performing Test CXX_SUPPORTS_MISSING_FIELD_INITIALIZERS_FLAG - Success > > -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG > > -- Performing Test C_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success > > -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG > > -- Performing Test CXX_SUPPORTS_IMPLICIT_FALLTHROUGH_FLAG - Success > > -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG > > -- Performing Test C_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success > > -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG > > -- Performing Test CXX_SUPPORTS_COVERED_SWITCH_DEFAULT_FLAG - Success > > -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG > > -- Performing Test CXX_SUPPORTS_CLASS_MEMACCESS_FLAG - Failed > > -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG > > -- Performing Test CXX_SUPPORTS_NOEXCEPT_TYPE_FLAG - Success > > -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG > > -- Performing Test C_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success > > -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG > > -- Performing Test CXX_SUPPORTS_DELETE_NON_VIRTUAL_DTOR_FLAG - Success > > -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP > > -- Performing Test C_WCOMMENT_ALLOWS_LINE_WRAP - Success > > -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG > > -- Performing Test C_SUPPORTS_STRING_CONVERSION_FLAG - Success > > -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG > > -- Performing Test CXX_SUPPORTS_STRING_CONVERSION_FLAG - Success > > -- Looking for os_signpost_interval_begin > > -- Looking for os_signpost_interval_begin - not found > > -- Looking for fopen in c > > -- Looking for fopen in c - not found > > -- Looking for __gcc_personality_v0 in gcc_s > > -- Looking for __gcc_personality_v0 in gcc_s - not found > > -- Looking for __absvdi2 in gcc > > -- Looking for __absvdi2 in gcc - not found > > -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG > > -- Performing Test LIBUNWIND_HAS_NODEFAULTLIBS_FLAG - Success > > -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA > > -- Performing Test LIBUNWIND_HAS_COMMENT_LIB_PRAGMA - Failed > > -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG > > -- Performing Test LIBUNWIND_HAS_NOSTDINCXX_FLAG - Success > > -- Looking for __arm__ > > -- Looking for __arm__ - not found > > -- Looking for __USING_SJLJ_EXCEPTIONS__ > > -- Looking for __USING_SJLJ_EXCEPTIONS__ - not found > > -- Looking for __ARM_DWARF_EH__ > > -- Looking for __ARM_DWARF_EH__ - not found > > -- Looking for dladdr in dl > > -- Looking for dladdr in dl - not found > > -- Looking for pthread_once in pthread > > -- Looking for pthread_once in pthread - not found > > -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_W_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WALL_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WCONVERSION_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WMISMATCHED_TAGS_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WMISSING_BRACES_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNEWLINE_EOF_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_UNUSED_FUNCTION_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSHADOW_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_COMPARE_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSIGN_CONVERSION_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_PARAMETER_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNUSED_VARIABLE_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WWRITE_STRINGS_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WUNDEF_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WNO_ERROR_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_WX_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_PEDANTIC_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FSTRICT_ALIASING_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_EHSC_FLAG - Failed > > -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FUNWIND_TABLES_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_EXCEPTIONS_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_FNO_RTTI_FLAG - Success > > -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG > > -- Performing Test LIBUNWIND_SUPPORTS_NODEFAULTLIBS_FLAG - Success > > -- Configuring done > > -- Generating done > > -- Build files have been written to: C:/Users/clang/libunwind2 > > > > Then I tried to build it: > > > > >ninja -w dupbuild=warn > > ninja: warning: multiple rules generate lib/unwind.lib. builds involving > this target will not be correct; continuing anyway [-w dupbuild=warn] > > [4/9] Building C object src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj > > In file included from C:/Users/clang/libunwind/src/Unwind-sjlj.c:19: > > C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by > macro definition [-Wkeyword-macro] > > #define static_assert(__b, __m) \ > > ^ > > 1 warning generated. > > [5/9] Building C object src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj > > In file included from C:/Users/clang/libunwind/src/UnwindLevel1.c:28: > > C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by > macro definition [-Wkeyword-macro] > > #define static_assert(__b, __m) \ > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:350:1: warning: redeclaration > of '_Unwind_RaiseException' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_RaiseException(_Unwind_Exception *exception_object) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:174:5: note: previous > declaration is here > > _Unwind_RaiseException(_Unwind_Exception *exception_object); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:385:1: warning: redeclaration > of '_Unwind_Resume' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_Resume(_Unwind_Exception *exception_object) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:175:13: note: previous > declaration is here > > extern void _Unwind_Resume(_Unwind_Exception *exception_object); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:408:1: warning: redeclaration > of '_Unwind_ForcedUnwind' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:277:5: note: previous > declaration is here > > _Unwind_ForcedUnwind(_Unwind_Exception *exception_object, > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:428:1: warning: redeclaration > of '_Unwind_GetLanguageSpecificData' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:270:5: note: previous > declaration is here > > _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:449:1: warning: redeclaration > of '_Unwind_GetRegionStart' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_GetRegionStart(struct _Unwind_Context *context) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:268:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetRegionStart(struct _Unwind_Context *context); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:465:1: warning: redeclaration > of '_Unwind_DeleteException' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_DeleteException(_Unwind_Exception *exception_object) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:177:13: note: previous > declaration is here > > extern void _Unwind_DeleteException(_Unwind_Exception *exception_object); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:475:1: warning: redeclaration > of '_Unwind_GetGR' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_GetGR(struct _Unwind_Context *context, int index) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:221:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetGR(struct _Unwind_Context *context, int index); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:485:24: warning: redeclaration > of '_Unwind_SetGR' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void _Unwind_SetGR(struct _Unwind_Context *context, int > index, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:222:13: note: previous > declaration is here > > extern void _Unwind_SetGR(struct _Unwind_Context *context, int index, > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:495:29: warning: redeclaration > of '_Unwind_GetIP' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) > { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:224:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetIP(struct _Unwind_Context *context); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1.c:507:24: warning: redeclaration > of '_Unwind_SetIP' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:225:13: note: previous > declaration is here > > extern void _Unwind_SetIP(struct _Unwind_Context *, uintptr_t new_value); > > ^ > > 11 warnings generated. > > [6/9] Building C object > src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj > > In file included from > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:19: > > C:/Users/clang/libunwind/src/config.h:26:11: warning: keyword is hidden by > macro definition [-Wkeyword-macro] > > #define static_assert(__b, __m) \ > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:33:1: warning: > redeclaration of '_Unwind_Resume_or_Rethrow' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:299:5: note: previous > declaration is here > > _Unwind_Resume_or_Rethrow(_Unwind_Exception *exception_object); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:70:1: warning: > redeclaration of '_Unwind_GetDataRelBase' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _Unwind_GetDataRelBase(struct _Unwind_Context *context) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:356:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetDataRelBase(struct _Unwind_Context *context) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:80:1: warning: > redeclaration of '_Unwind_GetTextRelBase' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _Unwind_GetTextRelBase(struct _Unwind_Context *context) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:358:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetTextRelBase(struct _Unwind_Context *context) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:89:25: warning: > redeclaration of '_Unwind_FindEnclosingFunction' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void *_Unwind_FindEnclosingFunction(void *pc) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:352:14: note: previous > declaration is here > > extern void *_Unwind_FindEnclosingFunction(void *pc); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:108:1: warning: > redeclaration of '_Unwind_Backtrace' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:307:28: note: previous > declaration is here > > extern _Unwind_Reason_Code _Unwind_Backtrace(_Unwind_Trace_Fn, void *); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:187:31: warning: > redeclaration of '_Unwind_Find_FDE' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT const void *_Unwind_Find_FDE(const void *pc, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:344:20: note: previous > declaration is here > > extern const void *_Unwind_Find_FDE(const void *pc, struct dwarf_eh_bases > *); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:208:29: warning: > redeclaration of '_Unwind_GetCFA' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT uintptr_t _Unwind_GetCFA(struct _Unwind_Context > *context) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:312:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetCFA(struct _Unwind_Context *); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:221:29: warning: > redeclaration of '_Unwind_GetIPInfo' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context > *context, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:321:18: note: previous > declaration is here > > extern uintptr_t _Unwind_GetIPInfo(struct _Unwind_Context *context, > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:241:24: warning: > redeclaration of '__register_frame' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame(const void *fde) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:331:13: note: previous > declaration is here > > extern void __register_frame(const void *fde); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:251:24: warning: > redeclaration of '__deregister_frame' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __deregister_frame(const void *fde) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:332:13: note: previous > declaration is here > > extern void __deregister_frame(const void *fde); > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:266:24: warning: > redeclaration of '__register_frame_info_bases' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame_info_bases(const void *fde, void > *ob, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:364:13: note: previous > declaration is here > > extern void __register_frame_info_bases(const void *fde, void *ob, void > *tb, > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:277:24: warning: > redeclaration of '__register_frame_info' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame_info(const void *fde, void *ob) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:366:13: note: previous > declaration is here > > extern void __register_frame_info(const void *fde, void *ob) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:284:24: warning: > redeclaration of '__register_frame_info_table_bases' should not add > 'dllexport' attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame_info_table_bases(const void *fde, > > ^ > > C:/Users/clang/libunwind/include\unwind.h:368:13: note: previous > declaration is here > > extern void __register_frame_info_table_bases(const void *fde, void *ob, > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:296:24: warning: > redeclaration of '__register_frame_info_table' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame_info_table(const void *fde, void > *ob) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:371:13: note: previous > declaration is here > > extern void __register_frame_info_table(const void *fde, void *ob) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:303:24: warning: > redeclaration of '__register_frame_table' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void __register_frame_table(const void *fde) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:373:13: note: previous > declaration is here > > extern void __register_frame_table(const void *fde) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:309:25: warning: > redeclaration of '__deregister_frame_info' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void *__deregister_frame_info(const void *fde) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:375:14: note: previous > declaration is here > > extern void *__deregister_frame_info(const void *fde) > > ^ > > C:/Users/clang/libunwind/src/UnwindLevel1-gcc-ext.c:316:25: warning: > redeclaration of '__deregister_frame_info_bases' should not add 'dllexport' > attribute [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT void *__deregister_frame_info_bases(const void *fde) { > > ^ > > C:/Users/clang/libunwind/include\unwind.h:377:14: note: previous > declaration is here > > extern void *__deregister_frame_info_bases(const void *fde) > > ^ > > 18 warnings generated. > > [8/9] Building CXX object > src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj > > In file included from C:/Users/clang/libunwind/src/libunwind.cpp:22: > > In file included from C:/Users/clang/libunwind/src/UnwindCursor.hpp:67: > > In file included from C:/Users/clang/libunwind/src/CompactUnwinder.hpp:19: > > C:/Users/clang/libunwind/include\mach-o/compact_unwind_encoding.h:45:5: > warning: enumerator value is not representable in the underlying type 'int' > [-Wmicrosoft-enum-value] > > UNWIND_IS_NOT_FUNCTION_START = 0x80000000, > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:29:36: warning: redeclaration > of 'unw_local_addr_space' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_EXPORT unw_addr_space_t unw_local_addr_space > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:125:25: note: previous > declaration is here > > extern unw_addr_space_t unw_local_addr_space; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:76:41: warning: redeclaration > of 'unw_init_local' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_init_local, unw_init_local) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:104:12: note: previous > declaration is here > > extern int unw_init_local(unw_cursor_t *, unw_context_t *) LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:91:38: warning: redeclaration > of 'unw_get_reg' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_get_reg, unw_get_reg) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:106:12: note: previous > declaration is here > > extern int unw_get_reg(unw_cursor_t *, unw_regnum_t, unw_word_t *) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:123:38: warning: redeclaration > of 'unw_set_reg' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_set_reg, unw_set_reg) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:108:12: note: previous > declaration is here > > extern int unw_set_reg(unw_cursor_t *, unw_regnum_t, unw_word_t) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:138:40: warning: redeclaration > of 'unw_get_fpreg' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_get_fpreg, unw_get_fpreg) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:107:12: note: previous > declaration is here > > extern int unw_get_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t *) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:157:40: warning: redeclaration > of 'unw_set_fpreg' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_set_fpreg, unw_set_fpreg) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:109:12: note: previous > declaration is here > > extern int unw_set_fpreg(unw_cursor_t *, unw_regnum_t, unw_fpreg_t) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:165:35: warning: redeclaration > of 'unw_step' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_step, unw_step) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:105:12: note: previous > declaration is here > > extern int unw_step(unw_cursor_t *) LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:178:44: warning: redeclaration > of 'unw_get_proc_info' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_info, unw_get_proc_info) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:119:12: note: previous > declaration is here > > extern int unw_get_proc_info(unw_cursor_t *, unw_proc_info_t *) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:187:37: warning: redeclaration > of 'unw_resume' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_resume, unw_resume) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:110:12: note: previous > declaration is here > > extern int unw_resume(unw_cursor_t *) LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:200:44: warning: redeclaration > of 'unw_get_proc_name' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_get_proc_name, unw_get_proc_name) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:122:12: note: previous > declaration is here > > extern int unw_get_proc_name(unw_cursor_t *, char *, size_t, unw_word_t *) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:210:39: warning: redeclaration > of 'unw_is_fpreg' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_is_fpreg, unw_is_fpreg) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:120:12: note: previous > declaration is here > > extern int unw_is_fpreg(unw_cursor_t *, unw_regnum_t) LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:220:38: warning: redeclaration > of 'unw_regname' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_regname, unw_regname) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:118:20: note: previous > declaration is here > > extern const char *unw_regname(unw_cursor_t *, unw_regnum_t) > LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:229:46: warning: redeclaration > of 'unw_is_signal_frame' should not add 'dllexport' attribute > [-Wdll-attribute-on-redeclaration] > > _LIBUNWIND_WEAK_ALIAS(__unw_is_signal_frame, unw_is_signal_frame) > > ^ > > C:/Users/clang/libunwind/include\libunwind.h:121:12: note: previous > declaration is here > > extern int unw_is_signal_frame(unw_cursor_t *) LIBUNWIND_AVAIL; > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:293:12: warning: 'getenv' is > deprecated: This function or variable may be unsafe. Consider using > _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See > online help for details. [-Wdeprecated-declarations] > > log = (getenv("LIBUNWIND_PRINT_APIS") != NULL); > > ^ > > C:\Program Files\Windows > Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been > explicitly marked deprecated here > > _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: > note: expanded from macro '_CRT_INSECURE_DEPRECATE' > > #define _CRT_INSECURE_DEPRECATE(_Replacement) > _CRT_DEPRECATE_TEXT( \ > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: > note: expanded from macro '_CRT_DEPRECATE_TEXT' > > #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:305:12: warning: 'getenv' is > deprecated: This function or variable may be unsafe. Consider using > _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See > online help for details. [-Wdeprecated-declarations] > > log = (getenv("LIBUNWIND_PRINT_UNWINDING") != NULL); > > ^ > > C:\Program Files\Windows > Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been > explicitly marked deprecated here > > _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: > note: expanded from macro '_CRT_INSECURE_DEPRECATE' > > #define _CRT_INSECURE_DEPRECATE(_Replacement) > _CRT_DEPRECATE_TEXT( \ > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: > note: expanded from macro '_CRT_DEPRECATE_TEXT' > > #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) > > ^ > > C:/Users/clang/libunwind/src/libunwind.cpp:317:12: warning: 'getenv' is > deprecated: This function or variable may be unsafe. Consider using > _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See > online help for details. [-Wdeprecated-declarations] > > log = (getenv("LIBUNWIND_PRINT_DWARF") != NULL); > > ^ > > C:\Program Files\Windows > Kits\10\include\10.0.18362.0\ucrt\stdlib.h:1190:20: note: 'getenv' has been > explicitly marked deprecated here > > _Check_return_ _CRT_INSECURE_DEPRECATE(_dupenv_s) > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:320:55: > note: expanded from macro '_CRT_INSECURE_DEPRECATE' > > #define _CRT_INSECURE_DEPRECATE(_Replacement) > _CRT_DEPRECATE_TEXT( \ > > ^ > > C:\Program Files\Microsoft Visual > Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\vcruntime.h:310:47: > note: expanded from macro '_CRT_DEPRECATE_TEXT' > > #define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated(_Text)) > > ^ > > 17 warnings generated. > > [9/9] Linking C shared library lib\unwind.dll > > FAILED: lib/unwind.dll lib/unwind.lib > > cmd.exe /C "cd . && C:\PROGRA~1\LLVM\bin\clang.exe -nostartfiles > -nostdlib -Werror=date-time -Werror=unguarded-availability-new -Wextra > -Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers > -Wimplicit-fallthrough -Wcovered-switch-default -Wdelete-non-virtual-dtor > -Wstring-conversion -O3 -DNDEBUG -D_DLL -D_MT -Xclang > --dependent-lib=msvcrt -nodefaultlibs -shared -o lib\unwind.dll -Xlinker > /implib:lib\unwind.lib -Xlinker /pdb:lib\unwind.pdb -Xlinker /version:1.0 > src/CMakeFiles/unwind_shared.dir/libunwind.cpp.obj > src/CMakeFiles/unwind_shared.dir/Unwind-EHABI.cpp.obj > src/CMakeFiles/unwind_shared.dir/Unwind-seh.cpp.obj > src/CMakeFiles/unwind_shared.dir/UnwindLevel1.c.obj > src/CMakeFiles/unwind_shared.dir/UnwindLevel1-gcc-ext.c.obj > src/CMakeFiles/unwind_shared.dir/Unwind-sjlj.c.obj > src/CMakeFiles/unwind_shared.dir/UnwindRegistersRestore.S.obj > src/CMakeFiles/unwind_shared.dir/UnwindRegistersSave.S.obj -lkernel32 > -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 > -ladvapi32 -loldnames && cd ." > > Creating library lib\unwind.lib and object lib\unwind.exp > > libunwind.cpp.obj : > > error LNK2019: *unresolved external symbol "public: void __thiscall > libunwind::Registers_x86::jumpto(void)" > (?jumpto at Registers_x86@libunwind@@QAEXXZ) referenced in function "public: > virtual void __thiscall libunwind::UnwindCursor<class > libunwind::LocalAddressSpace,class libunwind::Registers_x86*>::jumpto(void)" > (?jumpto@?$UnwindCursor at VLocalAddressSpace@libunwind@@VRegisters_x86 at 2 > @@libunwind@@UAEXXZ) > > lib\unwind.dll : fatal error LNK1120: 1 unresolved externals > > clang: error: linker command failed with exit code 1120 (use -v to see > invocation) > > ninja: build stopped: subcommand failed. > > > > So there were some linking issues. > > Some assistance would be much appreciated. > > > > Microsoft's linker has it's version 14.27.29109.0 (VS 2019). > > Clang's version is clang version 10.0.0 (Target: i686-pc-windows-msvc) > > Ninja's version is 1.10.0.git.kitware.jobserver-1 > > > > Ivan >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/2086c4de/attachment-0001.html>
Martin Storsjö via llvm-dev
2020-Aug-15 20:02 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
Hi, On Sat, 15 Aug 2020, Ivan Serdyuk via llvm-dev wrote:> I was trying to > compile https://github.com/llvm/llvm-project/tree/master/libunwind using: > * MSVC > * Clang > I wasn't able to configure this project for using MSVC (directly or via > clang-cl):> error LNK2019: unresolved external symbol "public: void __thiscall > libunwind::Registers_x86::jumpto(void)" > (?jumpto at Registers_x86@libunwind@@QAEXXZ) referenced in function "public: > virtual void __thiscall libunwind::UnwindCursor<class > libunwind::LocalAddressSpace,class libunwind::Registers_x86>::jumpto(void)"(?jumpto@?$UnwindCursor at VLocalAddressSpace@libunwind@@VRegisters_x86 at 2@@lib > unwind@@UAEXXZ) > lib\unwind.dll : fatal error LNK1120: 1 unresolved externals > clang: error: linker command failed with exit code 1120 (use -v to see > invocation) > ninja: build stopped: subcommand failed.Just as Shoaib said, libunwind only is useful in environments that use the Itanium C++ ABI - there's really no use for it in an MSVC context (either using MSVC or clang-cl to compile it). The particular linker error comes from the fact that there's functions implemented in assembly, that expect the function name to be mangled the itanium way, while the object files built by the compiler expect the symbols to use the MSVC C++ name mangling, so there's an undefined reference. // Martin
Martin Storsjö via llvm-dev
2020-Aug-15 20:39 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
Hi, Please keep the discussion on the list. On Sat, 15 Aug 2020, Ivan Serdyuk wrote:> Just as Shoaib said, libunwind only is useful in environments > that use > the Itanium C++ ABI - there's really no use for it in an MSVC > context > (either using MSVC or clang-cl to compile it). > > The particular linker error comes from the fact that there's > functions > implemented in assembly, that expect the function name to be > mangled the > itanium way, while the object files built by the compiler expect > the > symbols to use the MSVC C++ name mangling, so there's an > undefined > reference. > > > I see, thanks. > > Which options exist for MSVC, in sense an alternative to libunwind and > libbacktrace ?Well for libunwind, there's really no use for it in an MSVC setting. All the unwinding functionality is already built into the operating system, available via the Rtl*Unwind* functions. For libbacktrace, I guess the _Unwind_Backtrace function in libunwind might work and be useful, even if the rest of libunwind doesn't make sense in such a context. I haven't tested this function on windows though, and it'd require you to fix the linker error one way or another. Another alternative, requiring much less code, would be to just extract the SEH version of _Unwind_Backtrace function from libgcc [1]. I think that function is fairly independent from the rest of libgcc and from the rest of the surrounding file, and only calls Windows system APIs. // Martin [1] https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind-seh.c#L434
Ivan Serdyuk via llvm-dev
2020-Aug-15 21:14 UTC
[llvm-dev] Supporting libunwind on Windows 10 (32bit; 64bit) for MSVC and Clang
On Sat, Aug 15, 2020 at 8:39 PM Martin Storsjö <martin at martin.st> wrote:> Hi, > > > On Sat, 15 Aug 2020, Ivan Serdyuk wrote: > > > Just as Shoaib said, libunwind only is useful in environments > > that use > > the Itanium C++ ABI - there's really no use for it in an MSVC > > context > > (either using MSVC or clang-cl to compile it). > > > > The particular linker error comes from the fact that there's > > functions > > implemented in assembly, that expect the function name to be > > mangled the > > itanium way, while the object files built by the compiler expect > > the > > symbols to use the MSVC C++ name mangling, so there's an > > undefined > > reference. > > > > > > I see, thanks. > > > > Which options exist for MSVC, in sense an alternative to libunwind and > > libbacktrace ? > > Well for libunwind, there's really no use for it in an MSVC setting. All > the unwinding functionality is already built into the operating system, > available via the Rtl*Unwind* functions. >Martin, you mean these functions https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlunwind https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlunwind2 https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlunwindex https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-rtlvirtualunwind ?> > For libbacktrace, I guess the _Unwind_Backtrace function in libunwind > might work and be useful, even if the rest of libunwind doesn't make sense > in such a context.Ian, please share your vision/propose some plan.> I haven't tested this function on windows though, and > it'd require you to fix the linker error one way or another. >I see.> > Another alternative, requiring much less code, would be to just extract > the SEH version of _Unwind_Backtrace function from libgcc [1]. I think > that function is fairly independent from the rest of libgcc and from the > rest of the surrounding file, and only calls Windows system APIs. >Well, adding committers to the discussion. Richard, Tristan, Bernd, Jon - please verify/elaborate. Thanks in advance. Ivan> > // Martin > > [1] https://github.com/gcc-mirror/gcc/blob/master/libgcc/unwind-seh.c#L434 > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200815/448809e9/attachment.html>
Maybe Matching Threads
- Failed to build libunwind the libcxx's __config header
- [LLVMdev] MS C++ gives error C2371 on this code while (obviously)gcc compiles it fine
- 3.9 regression with legacy static assert macros (bad type resolution)
- 3.9 regression with legacy static assert macros (bad type resolution)
- 3.9 regression with legacy static assert macros (bad type resolution)