From aa1ab889bcbb580f33151933d7ed44fd4a93f1bf Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 14 Feb 2021 21:04:45 -0800 Subject: spirv-llvm-translator: Add recipe Signed-off-by: Khem Raj --- .../0001-Use-12.0.0-for-base-llvm-version.patch | 26 ++++++++++++++ .../spirv-llvm-translator_git.bb | 40 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch create mode 100644 recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch new file mode 100644 index 0000000..b52d97b --- /dev/null +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator/0001-Use-12.0.0-for-base-llvm-version.patch @@ -0,0 +1,26 @@ +From 1e38777c321605d13f9ad254880e73459877d7da Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 14 Feb 2021 18:43:21 -0800 +Subject: [PATCH] Use 12.0.0 for base llvm version + +Upstream-Status: Pending +Signed-off-by: Khem Raj +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ddb55ce..a9cd1978 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,6 +1,6 @@ + cmake_minimum_required(VERSION 3.3) + +-set (BASE_LLVM_VERSION 13.0.0) ++set (BASE_LLVM_VERSION 12.0.0) + set(LLVM_SPIRV_VERSION ${BASE_LLVM_VERSION}.0) + + option(LLVM_SPIRV_INCLUDE_TESTS +-- +2.30.1 + diff --git a/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb new file mode 100644 index 0000000..a7b5580 --- /dev/null +++ b/recipes-devtools/spirv-llvm-translator/spirv-llvm-translator_git.bb @@ -0,0 +1,40 @@ +LICENSE = "NCSA" +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=47e311aa9caedd1b3abf098bd7814d1d" + +BRANCH = "llvm_release_120" +SRC_URI = "git://github.com/KhronosGroup/SPIRV-LLVM-Translator/;protocol=https;branch=${BRANCH} \ + file://0001-Use-12.0.0-for-base-llvm-version.patch \ + " + +PV = "12.0.0" +SRCREV = "c65388fcd4eac9ce070fc330d5fe263ba2c72d66" + +S = "${WORKDIR}/git" + +DEPENDS = "spirv-tools clang" + +inherit cmake pkgconfig python3native + +OECMAKE_GENERATOR = "Unix Makefiles" + +# Specify any options you want to pass to cmake using EXTRA_OECMAKE: +EXTRA_OECMAKE = "\ + -DBUILD_SHARED_LIBS=ON \ + -DLLVM_SPIRV_BUILD_EXTERNAL=YES \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_SKIP_RPATH=ON \ + -DLLVM_EXTERNAL_LIT=lit \ + -DLLVM_INCLUDE_TESTS=ON \ + -Wno-dev \ +" + +do_compile_append() { + oe_runmake llvm-spirv +} + +do_install_append() { + install -Dm755 ${B}/tools/llvm-spirv/llvm-spirv ${D}${bindir}/llvm-spirv +} + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf