commit:     955640ef357de349e242eca5d7848286a450f35e
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 22 20:45:03 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Jun 22 20:55:57 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=955640ef

dev-libs/opencl-clang:10: Fix llvm-tblgen detection

Upstream CMake scripts simply set LLVM_TABLEGEN_EXE to "llvm-tblgen".
This works fine for 32-bit builds of SLOT=8 and 9 as well as 64-bit
builds of all three slots, however 32-bit builds of SLOT=10 fail due to
having been unable to locate the executable in question. Whatever the
reason for this is, actually looking for llvm-tblgen with
find_program() solves the issue, at least on my system anyway.

Closes: https://bugs.gentoo.org/728804
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../files/opencl-clang-10.0.0.1_find-llvm-tblgen.patch        | 11 +++++++++++
 dev-libs/opencl-clang/opencl-clang-10.0.0.1.ebuild            |  1 +
 2 files changed, 12 insertions(+)

diff --git 
a/dev-libs/opencl-clang/files/opencl-clang-10.0.0.1_find-llvm-tblgen.patch 
b/dev-libs/opencl-clang/files/opencl-clang-10.0.0.1_find-llvm-tblgen.patch
new file mode 100644
index 00000000000..bf013c33a59
--- /dev/null
+++ b/dev-libs/opencl-clang/files/opencl-clang-10.0.0.1_find-llvm-tblgen.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -137,7 +137,7 @@
+ set (COMPILE_OPTIONS_TD  opencl_clang_options.td)
+ set (COMPILE_OPTIONS_INC opencl_clang_options.inc)
+ 
+-set(LLVM_TABLEGEN_EXE "llvm-tblgen")
++find_program(LLVM_TABLEGEN_EXE "llvm-tblgen")
+ set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD})
+ if(USE_PREBUILT_LLVM)
+   set(TABLEGEN_ADDITIONAL -I ${LLVM_INCLUDE_DIRS})

diff --git a/dev-libs/opencl-clang/opencl-clang-10.0.0.1.ebuild 
b/dev-libs/opencl-clang/opencl-clang-10.0.0.1.ebuild
index d09e936af38..eaa015b40fe 100644
--- a/dev-libs/opencl-clang/opencl-clang-10.0.0.1.ebuild
+++ b/dev-libs/opencl-clang/opencl-clang-10.0.0.1.ebuild
@@ -29,6 +29,7 @@ LLVM_MAX_SLOT=10
 
 PATCHES=(
        "${FILESDIR}"/${PN}-8.0.0-clang_library_dir.patch
+       "${FILESDIR}"/${PN}-10.0.0.1_find-llvm-tblgen.patch
 )
 
 multilib_src_configure() {

Reply via email to