summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO18
-rw-r--r--PKGBUILD32
-rw-r--r--comgr-find-lld-includes.patch43
3 files changed, 93 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..68b8dff5a949
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,18 @@
+pkgbase = comgr
+ pkgdesc = Radeon Open Compute - compiler support
+ pkgver = 3.3.0
+ pkgrel = 1
+ url = https://github.com/RadeonOpenCompute/ROCm-CompilerSupport
+ arch = x86_64
+ license = custom:NCSAOSL
+ makedepends = cmake
+ makedepends = rocm-cmake
+ makedepends = rocm-device-libs
+ depends = llvm-amdgpu
+ source = https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/archive/rocm-3.3.0.tar.gz
+ source = comgr-find-lld-includes.patch
+ sha256sums = 01e2524e0f28ecd6f46c9720f279207de935d826b0172158792aa3ec86af9ca7
+ sha256sums = 4571b16961f15249e8cc8b9a9ae7f0863600345aa5e95959192149eacdb01d2e
+
+pkgname = comgr
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1719902292e0
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,32 @@
+# Maintainer: acxz <akashpatel2008 at yahoo dot com>
+
+pkgname=comgr
+pkgdesc='Radeon Open Compute - compiler support'
+pkgver=3.3.0
+pkgrel=1
+arch=('x86_64')
+url='https://github.com/RadeonOpenCompute/ROCm-CompilerSupport'
+license=('custom:NCSAOSL')
+depends=(llvm-amdgpu)
+makedepends=(cmake rocm-cmake rocm-device-libs)
+source=("$url/archive/rocm-$pkgver.tar.gz"
+ "comgr-find-lld-includes.patch")
+sha256sums=('01e2524e0f28ecd6f46c9720f279207de935d826b0172158792aa3ec86af9ca7'
+ '4571b16961f15249e8cc8b9a9ae7f0863600345aa5e95959192149eacdb01d2e')
+_dirname="$(basename "$url")-$(basename "${source[0]}" .tar.gz)"
+
+prepare() {
+ patch -uN ${srcdir}/${_dirname}/lib/comgr/CMakeLists.txt comgr-find-lld-includes.patch
+}
+
+build() {
+ cmake -DCMAKE_INSTALL_PREFIX=/opt/rocm \
+ -DCMAKE_PREFIX_PATH="/opt/rocm/llvm;/opt/rocm" \
+ "$_dirname/lib/comgr"
+ make
+}
+
+package() {
+ DESTDIR="$pkgdir" make install
+ install -Dm644 "$_dirname/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+}
diff --git a/comgr-find-lld-includes.patch b/comgr-find-lld-includes.patch
new file mode 100644
index 000000000000..5b44feaf1b3d
--- /dev/null
+++ b/comgr-find-lld-includes.patch
@@ -0,0 +1,43 @@
+https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/pull/17
+
+From 4588c1a5aad3edae9d3e121685d8d1f5fddd54ba Mon Sep 17 00:00:00 2001
+From: Craig Andrews <candrews@integralblue.com>
+Date: Wed, 31 Jul 2019 10:45:01 -0400
+Subject: [PATCH] Find lld includes in LLVM_INCLUDE_DIRS
+
+Allows building against an LLVM build tree
+---
+ CMakeLists.txt | 20 ++------------------
+ 1 file changed, 2 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 454b830..db28533 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,24 +19,8 @@ include_directories(${LLVM_INCLUDE_DIRS})
+ link_directories(${LLVM_LIBRARY_DIRS})
+ include_directories(${CLANG_INCLUDE_DIRS})
+
+-# FIXME: There is no way to directly determine the include paths for LLD when
+-# working with an LLVM build tree, but we want to avoid having to install LLVM
+-# to build Comgr. This should eventually be fixed in usptream LLD so this can
+-# be removed.
+-if(DEFINED LLVM_BUILD_MAIN_SRC_DIR)
+- set(INTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/tools/lld/include")
+- set(EXTERNAL_LLD_INCLUDE_DIRS "${LLVM_BUILD_MAIN_SRC_DIR}/../lld/include")
+- if (EXISTS "${INTERNAL_LLD_INCLUDE_DIRS}"
+- AND IS_DIRECTORY "${INTERNAL_LLD_INCLUDE_DIRS}")
+- set(LLD_INCLUDE_DIRS "${INTERNAL_LLD_INCLUDE_DIRS}")
+- elseif (EXISTS "${EXTERNAL_LLD_INCLUDE_DIRS}"
+- AND IS_DIRECTORY "${EXTERNAL_LLD_INCLUDE_DIRS}")
+- set(LLD_INCLUDE_DIRS "${EXTERNAL_LLD_INCLUDE_DIRS}")
+- else()
+- message(FATAL_ERROR "You are attempting to compile using an LLVM build tree, but the LLD include directory could not be located. The paths '${INTERNAL_LLD_INCLUDE_DIRS}' and '${EXTERNAL_LLD_INCLUDE_DIRS}' were tried.")
+- endif()
+- include_directories(${LLD_INCLUDE_DIRS})
+-endif()
++set(LLD_INCLUDE_DIRS "${LLVM_INCLUDE_DIRS}/lld")
++include_directories(${LLD_INCLUDE_DIRS})
+
+ find_package(AMDDeviceLibs CONFIG)
+