diff options
Diffstat (limited to 'recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch')
| -rw-r--r-- | recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch b/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/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch | |||
| @@ -0,0 +1,60 @@ | |||
| 1 | From 43c806ef321b1f677a49d28c89fb7ffecf539c2d Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Tim Creech <timothy.m.creech@intel.com> | ||
| 3 | Date: Wed, 28 Jun 2023 03:45:51 -0400 | ||
| 4 | Subject: [PATCH 2/2] Request native clang only when cross-compiling (#464) | ||
| 5 | |||
| 6 | * Request native clang only when cross-compiling | ||
| 7 | |||
| 8 | LLVM_USE_HOST_TOOLS may be set if LLVM is configured with | ||
| 9 | LLVM_OPTIMIZED_TABLEGEN, which does not necessarily indicate | ||
| 10 | cross-compilation or that clang will only execute on the target. | ||
| 11 | |||
| 12 | By checking that CMAKE_CROSSCOMPILING is set, we ensure that we only | ||
| 13 | build/use clang again if necessary for host execution. | ||
| 14 | |||
| 15 | * fixup: CMAKE_CROSSCOMPILING implies LLVM_USE_HOST_TOOLS | ||
| 16 | |||
| 17 | Co-authored-by: Wenju He <wenju.he@intel.com> | ||
| 18 | |||
| 19 | * fixup: also use CMAKE_CROSSCOMPILING in top-level CMakeLists.txt | ||
| 20 | |||
| 21 | --------- | ||
| 22 | |||
| 23 | Co-authored-by: Wenju He <wenju.he@intel.com> | ||
| 24 | |||
| 25 | Upstream-Status: Backport [https://github.com/intel/opencl-clang/commit/53843eee13cfb2357919ee02714a43bef1af0f86] | ||
| 26 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
| 27 | --- | ||
| 28 | CMakeLists.txt | 2 +- | ||
| 29 | cl_headers/CMakeLists.txt | 2 +- | ||
| 30 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 31 | |||
| 32 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 33 | index e772de9..5864009 100644 | ||
| 34 | --- a/CMakeLists.txt | ||
| 35 | +++ b/CMakeLists.txt | ||
| 36 | @@ -35,7 +35,7 @@ set(CMAKE_MODULE_PATH | ||
| 37 | |||
| 38 | include(CMakeFunctions) | ||
| 39 | |||
| 40 | -if(LLVM_USE_HOST_TOOLS AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
| 41 | +if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
| 42 | include(CrossCompile) | ||
| 43 | llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) | ||
| 44 | endif() | ||
| 45 | diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt | ||
| 46 | index 18296c2..16cabb7 100644 | ||
| 47 | --- a/cl_headers/CMakeLists.txt | ||
| 48 | +++ b/cl_headers/CMakeLists.txt | ||
| 49 | @@ -4,7 +4,7 @@ if(USE_PREBUILT_LLVM) | ||
| 50 | else() | ||
| 51 | set(CLANG_COMMAND $<TARGET_FILE:clang>) | ||
| 52 | endif() | ||
| 53 | -if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) | ||
| 54 | +if(CMAKE_CROSSCOMPILING AND NOT OPENCL_CLANG_BUILD_EXTERNAL) | ||
| 55 | build_native_tool(clang CLANG_COMMAND) | ||
| 56 | endif() | ||
| 57 | |||
| 58 | -- | ||
| 59 | 2.37.3 | ||
| 60 | |||
