From d9d4392e6628effd6f8fe064f25f824607648893 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Thu, 3 Aug 2023 09:33:41 +0800 Subject: opencl-clang/15.0: update to latest Include the latest changes from ocl-open-150 branch. Backport fixes from main and include another patch to fix issues with building target binaries. Signed-off-by: Anuj Mittal --- ...ative-clang-only-when-cross-compiling-464.patch | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch (limited to 'dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch') diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch new file mode 100644 index 00000000..2f1814f8 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch @@ -0,0 +1,60 @@ +From 43c806ef321b1f677a49d28c89fb7ffecf539c2d Mon Sep 17 00:00:00 2001 +From: Tim Creech +Date: Wed, 28 Jun 2023 03:45:51 -0400 +Subject: [PATCH 2/2] Request native clang only when cross-compiling (#464) + +* Request native clang only when cross-compiling + +LLVM_USE_HOST_TOOLS may be set if LLVM is configured with +LLVM_OPTIMIZED_TABLEGEN, which does not necessarily indicate +cross-compilation or that clang will only execute on the target. + +By checking that CMAKE_CROSSCOMPILING is set, we ensure that we only +build/use clang again if necessary for host execution. + +* fixup: CMAKE_CROSSCOMPILING implies LLVM_USE_HOST_TOOLS + +Co-authored-by: Wenju He + +* fixup: also use CMAKE_CROSSCOMPILING in top-level CMakeLists.txt + +--------- + +Co-authored-by: Wenju He + +Upstream-Status: Backport [https://github.com/intel/opencl-clang/commit/53843eee13cfb2357919ee02714a43bef1af0f86] +Signed-off-by: Anuj Mittal +--- + CMakeLists.txt | 2 +- + cl_headers/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e772de9..5864009 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -35,7 +35,7 @@ set(CMAKE_MODULE_PATH + + include(CMakeFunctions) + +-if(LLVM_USE_HOST_TOOLS AND OPENCL_CLANG_BUILD_EXTERNAL) ++if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL) + include(CrossCompile) + llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) + endif() +diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt +index 18296c2..16cabb7 100644 +--- a/cl_headers/CMakeLists.txt ++++ b/cl_headers/CMakeLists.txt +@@ -4,7 +4,7 @@ if(USE_PREBUILT_LLVM) + else() + set(CLANG_COMMAND $) + endif() +-if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) ++if(CMAKE_CROSSCOMPILING AND NOT OPENCL_CLANG_BUILD_EXTERNAL) + build_native_tool(clang CLANG_COMMAND) + endif() + +-- +2.37.3 + -- cgit v1.2.3-54-g00ecf