diff options
Diffstat (limited to 'external/meta-clang/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch')
-rw-r--r-- | external/meta-clang/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/external/meta-clang/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch b/external/meta-clang/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch new file mode 100644 index 00000000..f5bc7730 --- /dev/null +++ b/external/meta-clang/recipes-devtools/clang/clang/0017-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch @@ -0,0 +1,33 @@ +From cfe4473e8447cd2c73a2f42c9c235ce1dfd08bec Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Wed, 11 Dec 2019 10:23:15 -0800 +Subject: [PATCH] libclang: Use CMAKE_DL_LIBS for deducing libdl + +This helps in getting right settings for libdl irrespective of platform +it also fixes build with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON + +Fixes + +tools/clang/tools/libclang/CMakeFiles/libclang.dir/CIndexer.cpp.o: In function clang::CIndexer::getClangResourcesPath[abi:cxx11]()': 2019-12-06T06:04:39.2987601Z | CIndexer.cpp:(.text._ZN5clang8CIndexer21getClangResourcesPathB5cxx11Ev+0x8b): undefined reference to dladdr' + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + clang/tools/libclang/CMakeLists.txt | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt +index bd0c945a5e1..723fa95f14b 100644 +--- a/clang/tools/libclang/CMakeLists.txt ++++ b/clang/tools/libclang/CMakeLists.txt +@@ -60,9 +60,8 @@ if (TARGET clangTidyPlugin) + endif() + endif () + +-find_library(DL_LIBRARY_PATH dl) +-if (DL_LIBRARY_PATH) +- list(APPEND LIBS dl) ++if (HAVE_LIBDL) ++ list(APPEND LIBS ${CMAKE_DL_LIBS}) + endif() + + option(LIBCLANG_BUILD_STATIC |