[beignet] 01/04: Statically link to LLVM to work around #852746

Rebecca Palmer rnpalmer-guest at moszumanska.debian.org
Tue Feb 21 23:11:41 UTC 2017


This is an automated email from the git hooks/post-receive script.

rnpalmer-guest pushed a commit to branch master
in repository beignet.

commit f21108c2cf80cccda8aeef2a8217063fd4c849ec
Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
Date:   Tue Feb 21 08:12:59 2017 +0000

    Statically link to LLVM to work around #852746
    
    (The reason we need a patch for either 'shared' or 'static' is
    that the upstream default is what used to be 'static' but due to
    LLVM changes is now 'shared with pointless extra dependencies')
---
 debian/changelog                 |  7 +++++++
 debian/control                   |  5 ++++-
 debian/patches/series            |  2 +-
 debian/patches/shared-llvm.patch | 33 ---------------------------------
 debian/patches/static-llvm.patch | 36 ++++++++++++++++++++++++++++++++++++
 5 files changed, 48 insertions(+), 35 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2e05f71..4054f2d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+beignet (1.3.0-2) UNRELEASED; urgency=medium
+
+  * Statically link to LLVM to allow installation together with
+    mesa-opencl-icd (workaround for #852746).
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Tue, 21 Feb 2017 07:34:02 +0000
+
 beignet (1.3.0-1) unstable; urgency=medium
 
   * New upstream release.
diff --git a/debian/control b/debian/control
index cb2623c..a04fa1e 100644
--- a/debian/control
+++ b/debian/control
@@ -26,7 +26,10 @@ Build-Depends:
  libxext-dev,
  libxfixes-dev,
  libx11-dev,
- ikiwiki
+ ikiwiki,
+ libtinfo-dev,
+ libedit-dev,
+ zlib1g-dev
 Standards-Version: 3.9.8
 Homepage: https://www.freedesktop.org/wiki/Software/Beignet/
 Vcs-Git: https://anonscm.debian.org/git/pkg-opencl/beignet.git
diff --git a/debian/patches/series b/debian/patches/series
index c340adc..ee4a597 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,6 @@
 Debian-compliant-compiler-flags-handling.patch
 support-kfreebsd.patch
 reduce-notfound-output.patch
-shared-llvm.patch
 update-docs.patch
 ship-test-tool.patch
 find-python35.patch
@@ -11,3 +10,4 @@ llvm39-support.patch
 add-appstream-metadata.patch
 spelling.patch
 opencl2-runtime-detection.patch
+static-llvm.patch
diff --git a/debian/patches/shared-llvm.patch b/debian/patches/shared-llvm.patch
deleted file mode 100644
index d2bc0fa..0000000
--- a/debian/patches/shared-llvm.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Description: Dynamically link to libllvm
-
-Trying to do libclang as well fails with many undefined symbols,
-probably due to #698247
-
-Author: Rebecca Palmer <rebecca_palmer at zoho.com>
-
---- beignet.orig/CMake/FindLLVM.cmake
-+++ beignet/CMake/FindLLVM.cmake
-@@ -87,22 +87,7 @@ execute_process(
-   OUTPUT_STRIP_TRAILING_WHITESPACE
- )
- 
--execute_process(
--  COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs
--  OUTPUT_VARIABLE LLVM_MODULE_LIBS
--  OUTPUT_STRIP_TRAILING_WHITESPACE
--)
--
--if (LLVM_VERSION_NODOT VERSION_GREATER 34)
--execute_process(
--  COMMAND ${LLVM_CONFIG_EXECUTABLE} --system-libs
--  OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_ORIG
--  OUTPUT_STRIP_TRAILING_WHITESPACE
--)
--if (LLVM_SYSTEM_LIBS_ORIG)
--string(REGEX REPLACE " *\n" "" LLVM_SYSTEM_LIBS ${LLVM_SYSTEM_LIBS_ORIG})
--endif (LLVM_SYSTEM_LIBS_ORIG)
--endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
-+set(LLVM_MODULE_LIBS "-lLLVM-${LLVM_VERSION}")
- 
- macro(add_one_lib name)
-   FIND_LIBRARY(CLANG_LIB
diff --git a/debian/patches/static-llvm.patch b/debian/patches/static-llvm.patch
new file mode 100644
index 0000000..f50b02d
--- /dev/null
+++ b/debian/patches/static-llvm.patch
@@ -0,0 +1,36 @@
+Description: Statically link to libllvm
+
+When multiple ICDs are installed, libopencl1 needs to dlopen() them all
+to find out which one works on the available hardware.  If they are
+dynamically linked, this leads to them sharing a libllvm, which has
+enough global state that this is likely to error out.  (This is a known
+LLVM bug, https://bugs.llvm.org/show_bug.cgi?id=22952 , but currently
+has no real fix.)
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Bug: https://bugs.llvm.org/show_bug.cgi?id=30587
+Bug-Debian: https://bugs.debian.org/852746
+
+--- beignet-1.3.0.orig/CMake/FindLLVM.cmake
++++ beignet-1.3.0/CMake/FindLLVM.cmake
+@@ -87,11 +87,19 @@ execute_process(
+   OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ 
++if (LLVM_VERSION_NODOT VERSION_GREATER 38)
++execute_process(
++  COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs --link-static
++  OUTPUT_VARIABLE LLVM_MODULE_LIBS
++  OUTPUT_STRIP_TRAILING_WHITESPACE
++)
++else (LLVM_VERSION_NODOT VERSION_GREATER 38)
+ execute_process(
+   COMMAND ${LLVM_CONFIG_EXECUTABLE} --libs
+   OUTPUT_VARIABLE LLVM_MODULE_LIBS
+   OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
++endif (LLVM_VERSION_NODOT VERSION_GREATER 38)
+ 
+ if (LLVM_VERSION_NODOT VERSION_GREATER 34)
+ execute_process(
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/beignet.git



More information about the Pkg-opencl-commits mailing list