summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConrad Kostecki <conikost@gentoo.org>2023-04-09 21:53:45 +0200
committerConrad Kostecki <conikost@gentoo.org>2023-04-09 21:55:07 +0200
commit8d83abc346d4856b7a87a8007b4094f4996056b6 (patch)
tree42e07d20979d3f6b9679fde970a0939a5ff4d44a /dev-util/spirv-llvm-translator
parentdev-libs/cudnn-frontend: add 0.7.3 (diff)
downloadgentoo-8d83abc346d4856b7a87a8007b4094f4996056b6.tar.gz
gentoo-8d83abc346d4856b7a87a8007b4094f4996056b6.tar.bz2
gentoo-8d83abc346d4856b7a87a8007b4094f4996056b6.zip
dev-util/spirv-llvm-translator: fix build
Closes: https://bugs.gentoo.org/903017 Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Diffstat (limited to 'dev-util/spirv-llvm-translator')
-rw-r--r--dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch73
-rw-r--r--dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild2
2 files changed, 75 insertions, 0 deletions
diff --git a/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch
new file mode 100644
index 000000000000..5cd90086f1e2
--- /dev/null
+++ b/dev-util/spirv-llvm-translator/files/spirv-llvm-translator-16.0.0-llvm-link-llvm-dylib.patch
@@ -0,0 +1,73 @@
+From 98fadafeae0204defedd89f015f7fb88f2888b2f Mon Sep 17 00:00:00 2001
+From: Tulio Magno Quites Machado Filho <tuliom@redhat.com>
+Date: Fri, 17 Mar 2023 14:27:10 -0300
+Subject: [PATCH] Fix standalone builds with LLVM_LINK_LLVM_DYLIB=ON
+
+Move the LLVM components to LINK_COMPONENTS because the DEPENDS list has
+the same semantics as add_dependencies(). In this
+case it doesn't include the LLVM components when calling the linker.
+---
+ lib/SPIRV/CMakeLists.txt | 47 ++++++++++++----------------------------
+ 1 file changed, 14 insertions(+), 33 deletions(-)
+
+diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
+index bbef00528..2810c6b2c 100644
+--- a/lib/SPIRV/CMakeLists.txt
++++ b/lib/SPIRV/CMakeLists.txt
+@@ -38,42 +38,23 @@ set(SRC_LIST
+ libSPIRV/SPIRVType.cpp
+ libSPIRV/SPIRVValue.cpp
+ )
+-if(LLVM_LINK_LLVM_DYLIB)
+- add_llvm_library(LLVMSPIRVLib STATIC DISABLE_LLVM_LINK_LLVM_DYLIB
+- ${SRC_LIST}
+- DEPENDS
+- intrinsics_gen
+- LLVMAnalysis
+- LLVMBitWriter
+- LLVMCodeGen
+- LLVMCore
+- LLVMDemangle
+- LLVMIRReader
+- LLVMLinker
+- LLVMPasses
+- LLVMSupport
+- LLVMTargetParser
+- LLVMTransformUtils
+- )
+-else()
+- add_llvm_library(LLVMSPIRVLib
+- ${SRC_LIST}
+- LINK_COMPONENTS
+- Analysis
+- BitWriter
+- CodeGen
+- Core
+- Demangle
+- IRReader
+- Linker
+- Passes
+- Support
+- TargetParser
+- TransformUtils
++add_llvm_library(LLVMSPIRVLib
++ ${SRC_LIST}
++ LINK_COMPONENTS
++ Analysis
++ BitWriter
++ CodeGen
++ Core
++ Demangle
++ IRReader
++ Linker
++ Passes
++ Support
++ TargetParser
++ TransformUtils
+ DEPENDS
+ intrinsics_gen
+ )
+-endif()
+
+ target_include_directories(LLVMSPIRVLib
+ PRIVATE
diff --git a/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild b/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild
index efc42671a704..2ecbe13bf889 100644
--- a/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild
+++ b/dev-util/spirv-llvm-translator/spirv-llvm-translator-16.0.0.ebuild
@@ -34,6 +34,8 @@ BDEPEND="
test? ( dev-python/lit )
"
+PATCHES=( "${FILESDIR}/${PN}-16.0.0-llvm-link-llvm-dylib.patch" )
+
src_prepare() {
append-flags -fPIC
cmake_src_prepare