Skip to content

Commit

Permalink
Move libunwind directories to src/native/external (#64043)
Browse files Browse the repository at this point in the history
* Move libunwind directories to src/native/external

* Move extra additions to single directory

* Extract coreclr configs in libunwind.cmake

* Reapply upstream patches

* Fixups
  • Loading branch information
am11 authored Mar 21, 2022
1 parent c992dc2 commit 9c9ebb9
Show file tree
Hide file tree
Showing 927 changed files with 626 additions and 158 deletions.
8 changes: 4 additions & 4 deletions src/coreclr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ if(CLR_CMAKE_HOST_UNIX)

add_subdirectory(pal)
add_subdirectory(hosts)
else(CLR_CMAKE_HOST_UNIX)
else()
if(CLR_CMAKE_TARGET_UNIX)
add_subdirectory(pal/src/libunwind)
endif(CLR_CMAKE_TARGET_UNIX)
endif(CLR_CMAKE_HOST_UNIX)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/external/libunwind_extras ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind)
endif()
endif()

# Add this subdir. We install the headers for the jit.
add_subdirectory(pal/prebuilt/inc)
Expand Down
21 changes: 10 additions & 11 deletions src/coreclr/pal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ elseif (CLR_CMAKE_TARGET_FREEBSD)
endif()

if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
include_directories(libunwind/include)
include_directories(libunwind/include/tdep)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/libunwind/include)
include_directories(${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep)
include_directories(${CLR_SRC_NATIVE_DIR}/external/libunwind/include)
include_directories(${CLR_SRC_NATIVE_DIR}/external/libunwind/include/tdep)
include_directories(${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include)
include_directories(${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include/tdep)

add_subdirectory(libunwind)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/external/libunwind_extras ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind)
elseif(NOT CLR_CMAKE_TARGET_OSX)
find_unwind_libs(UNWIND_LIBS)
else()
add_subdirectory(libunwind)
add_subdirectory(${CLR_SRC_NATIVE_DIR}/external/libunwind_extras ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind)
endif(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)

include(configure.cmake)
Expand Down Expand Up @@ -251,11 +251,10 @@ endif(CLR_CMAKE_TARGET_OSX)

if(NOT FEATURE_CROSSBITNESS)
target_include_directories(coreclrpal_dac PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include
${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include/tdep
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/libunwind/include
${CMAKE_CURRENT_BINARY_DIR}/libunwind/include/tdep
${CLR_SRC_NATIVE_DIR}/external/libunwind/include
${CLR_SRC_NATIVE_DIR}/external/libunwind/include/tdep
${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include
${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include/tdep
)
endif(NOT FEATURE_CROSSBITNESS)

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/pal/src/configure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ set(SYNCHMGR_SUSPENSION_SAFE_CONDITION_SIGNALING 1)
set(ERROR_FUNC_FOR_GLOB_HAS_FIXED_PARAMS 1)

if(NOT CLR_CMAKE_USE_SYSTEM_LIBUNWIND)
list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CMAKE_CURRENT_SOURCE_DIR}/libunwind/include ${CMAKE_CURRENT_BINARY_DIR}/libunwind/include)
list(INSERT CMAKE_REQUIRED_INCLUDES 0 ${CLR_SRC_NATIVE_DIR}/external/libunwind/include ${CLR_ARTIFACTS_OBJ_DIR}/external/libunwind/include)
endif()

check_c_source_compiles("
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
v1.6.2
https://github.com/libunwind/libunwind/commit/b3ca1b59a795a617877c01fe5d299ab7a07ff29d

Replace CMakeLists.txt, src/CMakeLists.txt, configure.cmake with .NET custom version
Keep .NET oop directory
Reapply changes from https://github.com/dotnet/runtime/commit/1b5719c2e3dde393531eaeb5b5cde05dabeef5b8
Apply https://github.com/libunwind/libunwind/pull/317
Apply https://github.com/libunwind/libunwind/pull/333
Expand Down
Loading

0 comments on commit 9c9ebb9

Please sign in to comment.