diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2016-12-01 05:26:15 +0300 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2016-12-01 05:32:40 +0300 |
commit | c6571c6eb7b99afec7d69cd5f52fb3c5058a2e3c (patch) | |
tree | 2c80417e8d707248d040b7edd5c72dfae3812371 /src/Native/Runtime/CMakeLists.txt | |
parent | a48e1a6702d3678e7de02d36bd689b0c96fddeaa (diff) |
Use LLVM libunwind for stack unwinding on Unix
This change replaces external libunwind usage on Unix by a copy of the LLVM libunwind.
It also modifies libunwind to support reporting register location and implements
the unw_get_save_loc API to get this location.
For now, only memory locations are supported (register locations are not).
Diffstat (limited to 'src/Native/Runtime/CMakeLists.txt')
-rw-r--r-- | src/Native/Runtime/CMakeLists.txt | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/Native/Runtime/CMakeLists.txt b/src/Native/Runtime/CMakeLists.txt index fe2786573..59afa5b37 100644 --- a/src/Native/Runtime/CMakeLists.txt +++ b/src/Native/Runtime/CMakeLists.txt @@ -73,6 +73,9 @@ if(WIN32) list(APPEND COMMON_RUNTIME_SOURCES windows/PalRedhawkCommon.cpp windows/PalRedhawkMinWin.cpp + ) + + list(APPEND FULL_RUNTIME_SOURCES windows/CoffNativeCodeManager.cpp ) @@ -88,14 +91,32 @@ if(WIN32) else() include_directories(unix) + include_directories(../libunwind/include) + + # Disable building _Unwind_XXX style APIs of libunwind, since we don't use them. + add_definitions(-D_LIBUNWIND_DISABLE_ZERO_COST_APIS=1) + + # Compile unwinding only for the current compilation target architecture + add_definitions(-D_LIBUNWIND_IS_NATIVE_ONLY) list(APPEND COMMON_RUNTIME_SOURCES - unix/HardwareExceptions.cpp unix/PalRedhawkUnix.cpp + ) + + list(APPEND FULL_RUNTIME_SOURCES + unix/HardwareExceptions.cpp unix/UnixContext.cpp unix/UnixNativeCodeManager.cpp + ../libunwind/src/Unwind-EHABI.cpp + ../libunwind/src/libunwind.cpp ) + if(CLR_CMAKE_PLATFORM_DARWIN) + list(APPEND FULL_RUNTIME_SOURCES + ../libunwind/src/Unwind_AppleExtras.cpp + ) + endif() + if(CLR_CMAKE_PLATFORM_ARCH_AMD64) set(ARCH_SOURCES_DIR amd64) set(ASM_SUFFIX S) @@ -107,6 +128,10 @@ else() set(ASM_SUFFIX S) endif() + list(APPEND RUNTIME_SOURCES_ARCH_ASM + ../libunwind/src/UnwindRegistersRestore.S + ../libunwind/src/UnwindRegistersSave.S + ) endif() list(APPEND RUNTIME_SOURCES_ARCH_ASM |