0001-libcxxabi-Find-libunwind-headers-when.patch 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From 2ca03d2f8cc86821efb781c7ae97b84592c3888a Mon Sep 17 00:00:00 2001
  2. From: "yang.lee" <yang.lee@starfivetech.com>
  3. Date: Thu, 26 May 2022 11:01:19 +0800
  4. Subject: [PATCH 1/3] libcxxabi: Find libunwind headers when
  5. LIBCXXABI_LIBUNWIND_INCLUDES is set
  6. Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments
  7. then it ends up not searching the specified dir and unwind.h is not found
  8. especially for ARM targets
  9. This patch makes the searching synthesized directories and then set
  10. LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment
  11. Rebased by Lee Yang
  12. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  13. ---
  14. libcxxabi/CMakeLists.txt | 21 +++++++++++----------
  15. 1 file changed, 11 insertions(+), 10 deletions(-)
  16. diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
  17. index a7d6d1902158..16a040fcef27 100644
  18. --- a/libcxxabi/CMakeLists.txt
  19. +++ b/libcxxabi/CMakeLists.txt
  20. @@ -517,13 +517,8 @@ endif()
  21. # Setup Source Code
  22. #===============================================================================
  23. -set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
  24. - "Specify path to libunwind includes." FORCE)
  25. -set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
  26. - "Specify path to libunwind source." FORCE)
  27. -
  28. if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
  29. - find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
  30. + find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
  31. PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
  32. ${LIBCXXABI_LIBUNWIND_PATH}/include
  33. ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
  34. @@ -534,15 +529,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
  35. NO_CMAKE_FIND_ROOT_PATH
  36. )
  37. - if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
  38. - set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
  39. + if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
  40. + set(LIBCXXABI_LIBUNWIND_INCLUDES "")
  41. endif()
  42. - if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
  43. - include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
  44. + if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "")
  45. + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
  46. endif()
  47. endif()
  48. +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
  49. + "Specify path to libunwind includes." FORCE)
  50. +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
  51. + "Specify path to libunwind source." FORCE)
  52. +
  53. +
  54. # Add source code. This also contains all of the logic for deciding linker flags
  55. # soname, etc...
  56. add_subdirectory(include)
  57. --
  58. 2.25.1