Date: Monday, March 12, 2018 @ 14:11:07
  Author: foutrelis
Revision: 318749

upgpkg: lldb 6.0.0-2

Use upstream patch to properly fix two linking issues.

Added:
  lldb/trunk/D44379-fix-standalone-build-with-llvm-dylib.patch
Modified:
  lldb/trunk/PKGBUILD

---------------------------------------------------+
 D44379-fix-standalone-build-with-llvm-dylib.patch |   61 ++++++++++++++++++++
 PKGBUILD                                          |   23 +++----
 2 files changed, 71 insertions(+), 13 deletions(-)

Added: D44379-fix-standalone-build-with-llvm-dylib.patch
===================================================================
--- D44379-fix-standalone-build-with-llvm-dylib.patch                           
(rev 0)
+++ D44379-fix-standalone-build-with-llvm-dylib.patch   2018-03-12 14:11:07 UTC 
(rev 318749)
@@ -0,0 +1,61 @@
+Index: cmake/modules/LLDBConfig.cmake
+===================================================================
+--- cmake/modules/LLDBConfig.cmake
++++ cmake/modules/LLDBConfig.cmake
+@@ -346,12 +346,15 @@
+ 
+ endif()
+ 
+-if (HAVE_LIBPTHREAD)
+-  list(APPEND system_libs pthread)
+-endif(HAVE_LIBPTHREAD)
+-
+-if (HAVE_LIBDL)
+-  list(APPEND system_libs ${CMAKE_DL_LIBS})
++if(UNIX)
++  set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
++  find_package(Threads REQUIRED)
++  list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
++
++  check_library_exists(dl dlopen "" HAVE_LIBDL)
++  if (HAVE_LIBDL)
++    list(APPEND system_libs ${CMAKE_DL_LIBS})
++  endif()
+ endif()
+ 
+ # Figure out if lldb could use lldb-server.  If so, then we'll
+Index: cmake/modules/LLDBStandalone.cmake
+===================================================================
+--- cmake/modules/LLDBStandalone.cmake
++++ cmake/modules/LLDBStandalone.cmake
+@@ -17,7 +17,9 @@
+       "--includedir"
+       "--prefix"
+       "--src-root"
+-      "--cmakedir")
++      "--cmakedir"
++      "--shared-mode"
++      )
+     execute_process(
+       COMMAND ${CONFIG_COMMAND}
+       RESULT_VARIABLE HAD_ERROR
+@@ -44,6 +46,7 @@
+   list(GET CONFIG_OUTPUT 4 LLVM_OBJ_ROOT)
+   list(GET CONFIG_OUTPUT 5 MAIN_SRC_DIR)
+   list(GET CONFIG_OUTPUT 6 LLVM_CMAKE_PATH)
++  list(GET CONFIG_OUTPUT 7 SHARED_MODE)
+ 
+   if(NOT MSVC_IDE)
+     set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
+@@ -72,6 +75,11 @@
+     message(FATAL_ERROR "Not found: ${LLVMCONFIG_FILE}")
+   endif()
+ 
++  if(SHARED_MODE STREQUAL "shared")
++    set(LLVM_LINK_LLVM_DYLIB ON)
++    set(LLVM_DYLIB_COMPONENTS all)
++  endif()
++
+   # They are used as destination of target generators.
+   set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin)
+   set(LLVM_LIBRARY_OUTPUT_INTDIR 
${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2018-03-12 13:28:56 UTC (rev 318748)
+++ PKGBUILD    2018-03-12 14:11:07 UTC (rev 318749)
@@ -4,7 +4,7 @@
 
 pkgname=lldb
 pkgver=6.0.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Next generation, high-performance debugger"
 arch=('x86_64')
 url="https://lldb.llvm.org/";
@@ -11,9 +11,11 @@
 license=('custom:University of Illinois/NCSA Open Source License')
 depends=('llvm-libs' 'clang' 'python2' 'python2-six')
 makedepends=('llvm' 'cmake' 'ninja' 'swig')
-source=(https://releases.llvm.org/$pkgver/$pkgname-$pkgver.src.tar.xz{,.sig})
+source=(https://releases.llvm.org/$pkgver/$pkgname-$pkgver.src.tar.xz{,.sig}
+        D44379-fix-standalone-build-with-llvm-dylib.patch)
 sha256sums=('46f54c1d7adcd047d87c0179f7b6fa751614f339f4f87e60abceaa45f414d454'
-            'SKIP')
+            'SKIP'
+            '18d382ed1273740faa0bd6d4565649636b62bd2aaf078ddc30eb151a1b24ec7b')
 validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg 
<h...@chromium.org>
 validpgpkeys+=('11E521D646982372EB577A1F8F0871F202119294') # Tom Stellard 
<t...@stellard.net>
 
@@ -20,6 +22,10 @@
 prepare() {
   cd "$srcdir/$pkgname-$pkgver.src"
   mkdir build
+
+  # https://bugs.llvm.org/show_bug.cgi?id=36687
+  # https://reviews.llvm.org/D44379
+  patch -Np0 -i ../D44379-fix-standalone-build-with-llvm-dylib.patch
 }
 
 build() {
@@ -31,16 +37,7 @@
     -DPYTHON_EXECUTABLE=/usr/bin/python2 \
     -DPYTHON_LIBRARY=/usr/lib/libpython2.7.so \
     -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 \
-    -DLLVM_LINK_LLVM_DYLIB=ON \
-    -DLLDB_USE_SYSTEM_SIX=1 \
-    -DHAVE_LIBDL=ON \
-    -DHAVE_LIBPTHREAD=ON
-
-  # For the lldb-{server,test} targets, libLLVMSupport.a appears before
-  # libLLVM-6.0.so and conflicts at runtime (within the options parser)
-  # https://bugs.llvm.org/show_bug.cgi?id=36687
-  sed -i 's|/usr/lib/libLLVMSupport.a||g' build.ninja
-
+    -DLLDB_USE_SYSTEM_SIX=1
   ninja
 }
 

Reply via email to