opencl-clang project release branches links to
different LLVM versions. So, in order to use latest igc version
with both clang 10.x and 9.x, added seprated recipes.

Signed-off-by: Naveen Saini <[email protected]>
---
 conf/machine/include/meta-intel.inc           |  3 ++
 .../files/point-to-correct-llvm-tblgen.patch  | 43 +++++++++++++++++++
 .../opencl-clang/opencl-clang.inc             | 27 ++++++++++++
 .../opencl-clang/opencl-clang_10.0.0.bb       | 28 +-----------
 .../opencl-clang/opencl-clang_9.0.0.bb        |  7 +++
 5 files changed, 81 insertions(+), 27 deletions(-)
 create mode 100644 
dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/point-to-correct-llvm-tblgen.patch
 create mode 100644 
dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
 create mode 100644 
dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_9.0.0.bb

diff --git a/conf/machine/include/meta-intel.inc 
b/conf/machine/include/meta-intel.inc
index 47976cde..dd37d018 100644
--- a/conf/machine/include/meta-intel.inc
+++ b/conf/machine/include/meta-intel.inc
@@ -25,6 +25,9 @@ PREFERRED_VERSION_linux-intel-rt ?= "5.4%"
 PREFERRED_VERSION_linux-intel_poky-altcfg ?= "4.19%"
 PREFERRED_VERSION_linux-intel-rt_poky-altcfg ?= "4.19%"
 
+PREFERRED_VERSION_opencl-clang ?= "${@bb.utils.contains('LLVMVERSION', 
'9.0.1', '9.0.0', '10.0.0', d)}"
+PREFERRED_VERSION_opencl-clang-native ?= "${@bb.utils.contains('LLVMVERSION', 
'9.0.1', '9.0.0', '10.0.0', d)}"
+
 XSERVER_X86_ASPEED_AST = "xf86-video-ast \
            "
 
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/point-to-correct-llvm-tblgen.patch
 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/point-to-correct-llvm-tblgen.patch
new file mode 100644
index 00000000..417e0221
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/point-to-correct-llvm-tblgen.patch
@@ -0,0 +1,43 @@
+From 2ce2619b544678541e0cc56494e2927086718613 Mon Sep 17 00:00:00 2001
+From: Anuj Mittal <[email protected]>
+Date: Tue, 26 Mar 2019 14:11:29 +0800
+Subject: [PATCH] point to correct llvm-tblgen
+
+Let llvm-tblgen path be passed from recipe itself.
+
+Also since we're going to do the patching ourselves, no need to look for
+git through cmake.
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Anuj Mittal <[email protected]>
+Signed-off-by: Naveen Saini <[email protected]>
+---
+ CMakeLists.txt | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1371a67..f83ffcc 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -53,7 +53,7 @@ endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+ include(AddLLVM)
+ include(TableGen)
+ 
+-find_package(Git REQUIRED)
++#find_package(Git REQUIRED)
+ 
+ if (NOT WIN32)
+     add_subdirectory( linux_linker )
+@@ -138,7 +138,7 @@ endif(NOT USE_PREBUILT_LLVM)
+ set (COMPILE_OPTIONS_TD  opencl_clang_options.td)
+ set (COMPILE_OPTIONS_INC opencl_clang_options.inc)
+ 
+-set(LLVM_TABLEGEN_EXE "llvm-tblgen")
++#set(LLVM_TABLEGEN_EXE "llvm-tblgen")
+ set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD})
+ if(USE_PREBUILT_LLVM)
+   set(TABLEGEN_ADDITIONAL -I ${LLVM_INCLUDE_DIRS})
+-- 
+2.17.1
+
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
new file mode 100644
index 00000000..c099a509
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
@@ -0,0 +1,27 @@
+SUMMARY = "Common clang is a thin wrapper library around clang"
+DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \
+ to compile OpenCL C kernels to SPIR-V modules."
+
+LICENSE = "NCSA"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+DEPENDS += "clang"
+DEPENDS_append_class-target = " opencl-clang-native"
+
+COMPATIBLE_HOST = '(x86_64).*-linux'
+COMPATIBLE_HOST_libc-musl = "null"
+
+EXTRA_OECMAKE += "\
+                  -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
+                  -DCMAKE_SKIP_RPATH=TRUE \
+                  "
+
+do_install_append_class-native() {
+        install -d ${D}${bindir}
+        install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
+}
+
+BBCLASSEXTEND = "native nativesdk"
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
index 042cfa30..dcee4fa0 100644
--- 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_10.0.0.bb
@@ -1,9 +1,4 @@
-SUMMARY = "Common clang is a thin wrapper library around clang"
-DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \
- to compile OpenCL C kernels to SPIR-V modules."
-
-LICENSE = "NCSA"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c"
+require opencl-clang.inc
 
 SRC_URI = 
"git://github.com/intel/opencl-clang.git;branch=ocl-open-100;protocol=https \
            file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
@@ -12,24 +7,3 @@ SRC_URI = 
"git://github.com/intel/opencl-clang.git;branch=ocl-open-100;protocol=
 SRC_URI_append_class-native = " 
file://0002-make-sure-only-static-libraries-linked-for-native-bu.patch"
 
 SRCREV = "9f0c2c0f5ddea1accc921aed4c94bc52c1b85637"
-
-S = "${WORKDIR}/git"
-
-inherit cmake
-DEPENDS += "clang"
-DEPENDS_append_class-target = " opencl-clang-native"
-
-COMPATIBLE_HOST = '(x86_64).*-linux'
-COMPATIBLE_HOST_libc-musl = "null"
-
-EXTRA_OECMAKE += "\
-                  -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \
-                  -DCMAKE_SKIP_RPATH=TRUE \
-                  "
-
-do_install_append_class-native() {
-        install -d ${D}${bindir}
-        install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
-}
-
-BBCLASSEXTEND = "native nativesdk"
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_9.0.0.bb 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_9.0.0.bb
new file mode 100644
index 00000000..f262a5eb
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_9.0.0.bb
@@ -0,0 +1,7 @@
+require opencl-clang.inc
+
+SRC_URI = 
"git://github.com/intel/opencl-clang.git;branch=ocl-open-90;protocol=https \
+           file://point-to-correct-llvm-tblgen.patch \
+           "
+
+SRCREV = "6f8c329bea44321aef1a1716dd206c1f7bed23cf"
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#6512): 
https://lists.yoctoproject.org/g/meta-intel/message/6512
Mute This Topic: https://lists.yoctoproject.org/mt/73235528/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to