diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-12-11 10:25:49 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2019-12-26 10:59:39 -0800 |
commit | b4cb98f1f5dbb262b28c15281700305ef8a4b2e3 (patch) | |
tree | bd1330b6a3144fabe91cbbf75e4cdb3d7bf0ad34 /recipes-devtools | |
parent | 180d86ec4714b63b661dfc3f21f50076f0cf5082 (diff) | |
download | meta-clang-b4cb98f1f5dbb262b28c15281700305ef8a4b2e3.tar.gz |
clang: Use cmake variable for libdl
This ensures that clang can link with libdl on platforms where needed
Fixes issue #241
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-devtools')
-rw-r--r-- | recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch | 33 | ||||
-rw-r--r-- | recipes-devtools/clang/common.inc | 1 |
2 files changed, 34 insertions, 0 deletions
diff --git a/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch b/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch new file mode 100644 index 0000000..18008c3 --- /dev/null +++ b/recipes-devtools/clang/clang/0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 9c37e644d96de108d931a6bcce1819a666ae91d8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 11 Dec 2019 10:23:15 -0800 | ||
4 | Subject: [PATCH] libclang: Use CMAKE_DL_LIBS for deducing libdl | ||
5 | |||
6 | This helps in getting right settings for libdl irrespective of platform | ||
7 | it also fixes build with -DLLVM_BUILD_LLVM_DYLIB=ON -DLLVM_LINK_LLVM_DYLIB=ON | ||
8 | |||
9 | Fixes | ||
10 | |||
11 | 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' | ||
12 | |||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | clang/tools/libclang/CMakeLists.txt | 5 ++--- | ||
16 | 1 file changed, 2 insertions(+), 3 deletions(-) | ||
17 | |||
18 | diff --git a/clang/tools/libclang/CMakeLists.txt b/clang/tools/libclang/CMakeLists.txt | ||
19 | index 613ead1a36b..9d5cd0ba9df 100644 | ||
20 | --- a/clang/tools/libclang/CMakeLists.txt | ||
21 | +++ b/clang/tools/libclang/CMakeLists.txt | ||
22 | @@ -58,9 +58,8 @@ if (TARGET clangTidyPlugin) | ||
23 | endif() | ||
24 | endif () | ||
25 | |||
26 | -find_library(DL_LIBRARY_PATH dl) | ||
27 | -if (DL_LIBRARY_PATH) | ||
28 | - list(APPEND LIBS dl) | ||
29 | +if (HAVE_LIBDL) | ||
30 | + list(APPEND LIBS ${CMAKE_DL_LIBS}) | ||
31 | endif() | ||
32 | |||
33 | option(LIBCLANG_BUILD_STATIC | ||
diff --git a/recipes-devtools/clang/common.inc b/recipes-devtools/clang/common.inc index c5e8d48..0f632f8 100644 --- a/recipes-devtools/clang/common.inc +++ b/recipes-devtools/clang/common.inc | |||
@@ -33,6 +33,7 @@ SRC_URI = "\ | |||
33 | file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ | 33 | file://0023-openmp-Recognise-ARMv7ve-machine-arch.patch \ |
34 | file://0024-Check-for-atomic-double-intrinsics.patch \ | 34 | file://0024-Check-for-atomic-double-intrinsics.patch \ |
35 | file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ | 35 | file://0025-llvm-Let-llvm-ar-name-contain-lib.patch \ |
36 | file://0026-libclang-Use-CMAKE_DL_LIBS-for-deducing-libdl.patch \ | ||
36 | " | 37 | " |
37 | 38 | ||
38 | # Fallback to no-PIE if not set | 39 | # Fallback to no-PIE if not set |