#7 Link against libclang-cpp.so
Merged 4 years ago by rdossant. Opened 4 years ago by tstellar.
rpms/ tstellar/bcc libclang-cpp  into  master

@@ -0,0 +1,72 @@ 

+ From 344a0966e89508ae80a69b6936c455ea726b7b3c Mon Sep 17 00:00:00 2001

+ From: Tom Stellard <tstellar@redhat.com>

+ Date: Thu, 12 Dec 2019 22:59:29 +0000

+ Subject: [PATCH] Link against libclang-cpp.so

+ 

+ ---

+  CMakeLists.txt         | 16 ++--------------

+  cmake/clang_libs.cmake | 21 +--------------------

+  2 files changed, 3 insertions(+), 34 deletions(-)

+ 

+ diff --git a/CMakeLists.txt b/CMakeLists.txt

+ index c2b72665..71b7d50e 100644

+ --- a/CMakeLists.txt

+ +++ b/CMakeLists.txt

+ @@ -42,20 +42,8 @@ find_package(LibElf REQUIRED)

+  # clang is linked as a library, but the library path searching is

+  # primitively supported, unlike libLLVM

+  set(CLANG_SEARCH "/opt/local/llvm/lib;/usr/lib/llvm-3.7/lib;${LLVM_LIBRARY_DIRS}")

+ -find_library(libclangAnalysis NAMES clangAnalysis HINTS ${CLANG_SEARCH})

+ -find_library(libclangAST NAMES clangAST HINTS ${CLANG_SEARCH})

+ -find_library(libclangBasic NAMES clangBasic HINTS ${CLANG_SEARCH})

+ -find_library(libclangCodeGen NAMES clangCodeGen HINTS ${CLANG_SEARCH})

+ -find_library(libclangDriver NAMES clangDriver HINTS ${CLANG_SEARCH})

+ -find_library(libclangEdit NAMES clangEdit HINTS ${CLANG_SEARCH})

+ -find_library(libclangFrontend NAMES clangFrontend HINTS ${CLANG_SEARCH})

+ -find_library(libclangLex NAMES clangLex HINTS ${CLANG_SEARCH})

+ -find_library(libclangParse NAMES clangParse HINTS ${CLANG_SEARCH})

+ -find_library(libclangRewrite NAMES clangRewrite HINTS ${CLANG_SEARCH})

+ -find_library(libclangSema NAMES clangSema HINTS ${CLANG_SEARCH})

+ -find_library(libclangSerialization NAMES clangSerialization HINTS ${CLANG_SEARCH})

+ -find_library(libclangASTMatchers NAMES clangASTMatchers HINTS ${CLANG_SEARCH})

+ -if(libclangBasic STREQUAL "libclangBasic-NOTFOUND")

+ +find_library(libclang-cpp NAMES clang-cpp HINTS ${CLANG_SEARCH})

+ +if(libclang-cpp STREQUAL "libclang-cpp-NOTFOUND")

+    message(FATAL_ERROR "Unable to find clang libraries")

+  endif()

+  FOREACH(DIR ${LLVM_INCLUDE_DIRS})

+ diff --git a/cmake/clang_libs.cmake b/cmake/clang_libs.cmake

+ index 5ebfaa54..321ba722 100644

+ --- a/cmake/clang_libs.cmake

+ +++ b/cmake/clang_libs.cmake

+ @@ -22,26 +22,7 @@ llvm_map_components_to_libnames(_llvm_libs ${llvm_raw_libs})

+  llvm_expand_dependencies(llvm_libs ${_llvm_libs})

+  endif()

+  

+ -# order is important

+ -set(clang_libs

+ -  ${libclangFrontend}

+ -  ${libclangSerialization}

+ -  ${libclangDriver})

+ -

+ -if (${LLVM_PACKAGE_VERSION} VERSION_EQUAL 8 OR ${LLVM_PACKAGE_VERSION} VERSION_GREATER 8)

+ -  list(APPEND clang_libs ${libclangASTMatchers})

+ -endif()

+ -

+ -list(APPEND clang_libs

+ -  ${libclangParse}

+ -  ${libclangSema}

+ -  ${libclangCodeGen}

+ -  ${libclangAnalysis}

+ -  ${libclangRewrite}

+ -  ${libclangEdit}

+ -  ${libclangAST}

+ -  ${libclangLex}

+ -  ${libclangBasic})

+ +set(clang_libs ${libclang-cpp})

+  

+  # prune unused llvm static library stuff when linking into the new .so

+  set(_exclude_flags)

+ -- 

+ 2.20.1

+ 

file modified
+6 -1
@@ -9,7 +9,7 @@ 

  

  Name:           bcc

  Version:        0.12.0

- Release:        1%{?dist}

+ Release:        2%{?dist}

  Summary:        BPF Compiler Collection (BCC)

  License:        ASL 2.0

  URL:            https://github.com/iovisor/bcc
@@ -19,6 +19,7 @@ 

  

  # https://github.com/iovisor/bcc/issues/2679

  Patch0:         0001-Fix-compilation-error-ppc64le.patch

+ Patch1:		0001-Link-against-libclang-cpp.so.patch

  

  # Arches will be included as upstream support is added and dependencies are

  # satisfied in the respective arches
@@ -180,6 +181,10 @@ 

  

  

  %changelog

+ * Mon Jan 06 2020 Tom Stellard <tstellar@redhat.com> - 0.12.0-2

+ - Link against libclang-cpp.so

+ - https://fedoraproject.org/wiki/Changes/Stop-Shipping-Individual-Component-Libraries-In-clang-lib-Package

+ 

  * Tue Dec 17 2019 Rafael dos Santos <rdossant@redhat.com> - 0.12.0-1

  - Rebase to latest upstream version (#1758417)

  

rebased onto 8cfd84c

4 years ago

rebased onto bd587e6

4 years ago

Metadata Update from @rdossant:
- Request assigned

4 years ago

Pull-Request has been merged by rdossant

4 years ago