From 52dc0273759daaf167bf38656bab5cb2da27028f Mon Sep 17 00:00:00 2001 From: Naveen Saini Date: Thu, 16 Apr 2020 16:22:38 +0800 Subject: opencl-clang: fix runtime error Error log: clang (LLVM option parsing): Unknown command line argument '-pgo-warn-misexpect'. Try: 'clang (LLVM option parsing) --help' Force opencl-clang to link with shared clang-cpp for target builds and explicitly link with spirv library because of a change in behaviour in llvm 10. Use the patch to link with all static libs only for native cases where meta-clang default to building static libs only by default. Signed-off-by: Naveen Saini Signed-off-by: Anuj Mittal --- ...-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch | 35 ++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch (limited to 'dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch') diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch new file mode 100644 index 00000000..8ffa853b --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-Building-in-tree-with-LLVM-10.0-with-the-LLVM_LINK_L.patch @@ -0,0 +1,35 @@ +From 7fc05c52dd91902fa324a7aac9b90715cfca4717 Mon Sep 17 00:00:00 2001 +From: Naveen Saini +Date: Wed, 15 Apr 2020 17:55:32 +0800 +Subject: [PATCH] Building in-tree with LLVM 10.0 with the LLVM_LINK_LLVM_DYLIB + +Failed to link with the LLVMSPIRVLib library. + +Add an explicit dependency to force the correct build order and linking. + +Reference: +https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/a6d4ccf082858e63e139ca06c02a071c343d2657 + +Upstream-Status: Submitted [https://github.com/intel/opencl-clang/pull/118] + +Signed-off-by: Naveen Saini +--- + CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 51c140d..b8b514e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -208,7 +208,7 @@ link_directories( + + set(OPENCL_CLANG_LINK_LIBS ${CMAKE_DL_LIBS}) + +-if(NOT LLVMSPIRVLib IN_LIST LLVM_AVAILABLE_LIBS) ++if(NOT LLVMSPIRVLib IN_LIST LLVM_AVAILABLE_LIBS OR (USE_PREBUILT_LLVM AND LLVM_LINK_LLVM_DYLIB)) + # SPIRV-LLVM-Translator is not included into LLVM as a component. + # So, we need to list it here explicitly as an external library + list(APPEND OPENCL_CLANG_LINK_LIBS LLVMSPIRVLib) +-- +2.17.1 + -- cgit v1.2.3-54-g00ecf