12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- From ec494876174df1ca3f3ca21577796914848bc1ee Mon Sep 17 00:00:00 2001
- From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
- Date: Fri, 22 Oct 2021 11:14:13 +0800
- Subject: [PATCH] libcxxabi: Find libunwind headers when
- LIBCXXABI_LIBUNWIND_INCLUDES is set
- Currently, when LIBCXXABI_LIBUNWIND_INCLUDES is set via CMake arguments
- then it ends up not searching the specified dir and unwind.h is not found
- especially for ARM targets
- This patch makes the searching synthesized directories and then set
- LIBCXXABI_LIBUNWIND_INCLUDES if its there in environment
- Rebased to LLVM 14.0.0 by Jun Yuan Tan
- Signed-off-by: Khem Raj <raj.khem@gmail.com>
- Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
- ---
- libcxxabi/CMakeLists.txt | 21 +++++++++++----------
- 1 file changed, 11 insertions(+), 10 deletions(-)
- diff --git a/libcxxabi/CMakeLists.txt b/libcxxabi/CMakeLists.txt
- index cc1c395b14d1..91174d19bca7 100644
- --- a/libcxxabi/CMakeLists.txt
- +++ b/libcxxabi/CMakeLists.txt
- @@ -522,14 +522,9 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${LIBCXXABI_C_FLAGS}")
- # Setup Source Code
- #===============================================================================
-
- -set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
- - "Specify path to libunwind includes." FORCE)
- -set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
- - "Specify path to libunwind source." FORCE)
- -
- include_directories(include)
- if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
- - find_path(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL libunwind.h
- + find_path(LIBCXXABI_LIBUNWIND_INCLUDES libunwind.h
- PATHS ${LIBCXXABI_LIBUNWIND_INCLUDES}
- ${LIBCXXABI_LIBUNWIND_PATH}/include
- ${CMAKE_BINARY_DIR}/${LIBCXXABI_LIBUNWIND_INCLUDES}
- @@ -540,15 +535,21 @@ if (LIBCXXABI_USE_LLVM_UNWINDER OR LLVM_NATIVE_ARCH MATCHES ARM)
- NO_CMAKE_FIND_ROOT_PATH
- )
-
- - if (LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL-NOTFOUND")
- - set(LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL "")
- + if (LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "LIBCXXABI_LIBUNWIND_INCLUDES-NOTFOUND")
- + set(LIBCXXABI_LIBUNWIND_INCLUDES "")
- endif()
-
- - if (NOT LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL STREQUAL "")
- - include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES_INTERNAL}")
- + if (NOT LIBCXXABI_LIBUNWIND_INCLUDES STREQUAL "")
- + include_directories("${LIBCXXABI_LIBUNWIND_INCLUDES}")
- endif()
- endif()
-
- +set(LIBCXXABI_LIBUNWIND_INCLUDES "${LIBCXXABI_LIBUNWIND_INCLUDES}" CACHE PATH
- + "Specify path to libunwind includes." FORCE)
- +set(LIBCXXABI_LIBUNWIND_PATH "${LIBCXXABI_LIBUNWIND_PATH}" CACHE PATH
- + "Specify path to libunwind source." FORCE)
- +
- +
- # Add source code. This also contains all of the logic for deciding linker flags
- # soname, etc...
- add_subdirectory(src)
- --
- 2.33.0
|