0001-libcxxabi-Find-libunwind-headers-when-LIBCXXABI_LIBU.patch 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. From 60d418bdd291f061e32a73ffee7ad7acc27a4768 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Sun, 27 Aug 2017 10:37:49 -0700
  4. Subject: [PATCH] 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. Upstream-Status: Pending
  12. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  13. ---
  14. libcxxabi/CMakeLists.txt | 16 +++++++++++-----
  15. 1 file changed, 11 insertions(+), 5 deletions(-)
  16. diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
  17. index 8f48d402bc22..c2470267d8e3 100644
  18. --- a/libcxxabi/CMakeLists.txt
  19. +++ b/libcxxabi/CMakeLists.txt
  20. @@ -483,7 +483,7 @@ set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
  21. "Specify path to libunwind source." FORCE)
  22. if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
  23. - find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
  24. + find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
  25. PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
  26. ${LIBCXXABI_LIBUNWIND_PATH}/include
  27. ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
  28. @@ -494,15 +494,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
  29. NO_CMAKE_FIND_ROOT_PATH
  30. )
  31. - if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
  32. - set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
  33. + if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
  34. + set(LIBCXXABI_LIBUNWIND_INCLUDES "")
  35. endif()
  36. - if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
  37. - include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
  38. + if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "")
  39. + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
  40. endif()
  41. endif()
  42. +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
  43. + "Specify path to libunwind includes." FORCE)
  44. +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
  45. + "Specify path to libunwind source." FORCE)
  46. +
  47. +
  48. # Add source code. This also contains all of the logic for deciding linker flags
  49. # soname, etc...
  50. add_subdirectory(include)