Drop patch 0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
which is not needed anymore

Backport a fix from main branch to fix build issues.

Move do_install:append:class-native to individual recipe

Signed-off-by: Yogesh Tyagi <[email protected]>
---
 .../files/0001-Fix-standalone-build-415.patch | 32 +++++++++++++++++++
 ...001-don-t-redefine-LLVM_TABLEGEN_EXE.patch | 32 -------------------
 .../opencl-clang/opencl-clang.inc             |  5 ---
 .../opencl-clang/opencl-clang_12.0.0.bb       |  5 +++
 .../opencl-clang/opencl-clang_14.0.0.bb       |  9 ++++--
 5 files changed, 44 insertions(+), 39 deletions(-)
 create mode 100644 
dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Fix-standalone-build-415.patch
 delete mode 100644 
dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch

diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Fix-standalone-build-415.patch
 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Fix-standalone-build-415.patch
new file mode 100644
index 00000000..732589f2
--- /dev/null
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Fix-standalone-build-415.patch
@@ -0,0 +1,32 @@
+From 3a281f634be5e56d5fb49d07da85fe24e5971dd0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= <[email protected]>
+Date: Fri, 21 Apr 2023 04:07:21 +0200
+Subject: [PATCH] Fix standalone build (#415)
+
+Fixes https://github.com/intel/opencl-clang/issues/406
+Fixes https://github.com/intel/opencl-clang/issues/374
+
+Upstream-Status: Backport 
[https://github.com/intel/opencl-clang/commit/529a9188114bcbd8ed753d2276942384fa50d7a1]
+Signed-off-by: Anuj Mittal <[email protected]>
+---
+ cl_headers/CMakeLists.txt | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt
+index 69cf11e..a258b62 100644
+--- a/cl_headers/CMakeLists.txt
++++ b/cl_headers/CMakeLists.txt
+@@ -1,5 +1,9 @@
+ set(CL_HEADERS_LIB cl_headers)
+-set(CLANG_COMMAND $<TARGET_FILE:clang> )
++if(USE_PREBUILT_LLVM)
++    find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR})
++else()
++    set(CLANG_COMMAND $<TARGET_FILE:clang>)
++endif()
+ if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL)
+   build_native_tool(clang CLANG_COMMAND)
+ endif()
+-- 
+2.34.1
+
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
deleted file mode 100644
index 8df7e3ab..00000000
--- 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-From f3ef79a6301bab0b3a447f07ceb94c39a95009df Mon Sep 17 00:00:00 2001
-From: Anuj Mittal <[email protected]>
-Date: Thu, 2 Apr 2020 08:59:20 +0800
-Subject: [PATCH] don't redefine LLVM_TABLEGEN_EXE
-
-Use the value that has been passed by the user.
-
-Upstream-Status: Submitted
-Signed-off-by: Anuj Mittal <[email protected]>
----
- CMakeLists.txt | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 6893e97..941b0ae 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -137,7 +137,10 @@ 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")
-+if(NOT DEFINED LLVM_TABLEGEN_EXE)
-+  set(LLVM_TABLEGEN_EXE "llvm-tblgen")
-+endif()
-+
- set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD})
- if(USE_PREBUILT_LLVM)
-   set(TABLEGEN_ADDITIONAL -I ${LLVM_INCLUDE_DIRS})
--- 
-2.25.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
index 1d9b4d51..0886e43b 100644
--- a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
+++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc
@@ -16,9 +16,4 @@ DEPENDS:append:class-target = " opencl-clang-native"
 COMPATIBLE_HOST = '(x86_64).*-linux'
 COMPATIBLE_HOST:libc-musl = "null"
 
-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_12.0.0.bb 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
index d0b2acfb..6cab99c2 100644
--- 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_12.0.0.bb
@@ -10,3 +10,8 @@ EXTRA_OECMAKE += "\
                   -DCMAKE_SKIP_RPATH=TRUE \
                   -DPREFERRED_LLVM_VERSION="12.0.0" \
                   "
+
+do_install:append:class-native() {
+        install -d ${D}${bindir}
+        install -m 0755 ${B}/linux_linker/linux_resource_linker ${D}${bindir}/
+}
diff --git 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb
index 367ca7e9..2ca50d3d 100644
--- 
a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb
+++ 
b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_14.0.0.bb
@@ -1,8 +1,8 @@
 require opencl-clang.inc
 
-SRC_URI:append = " file://0001-don-t-redefine-LLVM_TABLEGEN_EXE.patch \
+SRC_URI:append = "  file://0001-Fix-standalone-build-415.patch \
            "
-SRCREV = "06c7c0d7f5cbd13810d79489a533fa6c5b6c7d9f"
+SRCREV = "cf95b338d14685e4f3402ab1828bef31d48f1fd6"
 
 BRANCH = "ocl-open-140"
 
@@ -13,3 +13,8 @@ EXTRA_OECMAKE += "\
                   -DCMAKE_SKIP_RPATH=TRUE \
                   -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \
                   "
+
+do_install:append:class-native() {
+        install -d ${D}${bindir}
+        install -m 0755 ${B}/bin/linux_resource_linker ${D}${bindir}/
+}
-- 
2.34.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#8082): 
https://lists.yoctoproject.org/g/meta-intel/message/8082
Mute This Topic: https://lists.yoctoproject.org/mt/100949339/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-intel/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to