summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2020-10-13 23:37:05 +0800
committerAnuj Mittal <anuj.mittal@intel.com>2020-10-15 11:55:42 +0800
commit26de78f5fece9313f9158b0bac8e0c575e68c1fa (patch)
treeb719b66ed429e9a26ad987456234d9b5d4d5456e
parent7643a33e99651af887cab97c70e11e3f9be8f783 (diff)
downloadmeta-intel-26de78f5fece9313f9158b0bac8e0c575e68c1fa.tar.gz
llvm: fix build with LLVM11
Ensure that we can build with both dunfell (LLVM10) and current master (LLVM11) of meta-clang. Look for LLVMVERSION set by meta-clang and include relevant patches based on the version. There's no official release for SPIRV-LLVM-Translator yet for LLVM11 so pick the latest. Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch51
-rw-r--r--dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend28
2 files changed, 73 insertions, 6 deletions
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch
new file mode 100644
index 00000000..011c09ee
--- /dev/null
+++ b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-skip-building-tests.patch
@@ -0,0 +1,51 @@
1From d362652617c5e840089273df0c6623a9745c92a2 Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Wed, 21 Aug 2019 14:35:31 +0800
4Subject: [PATCH] llvm-spirv: skip building tests
5
6Some of these need clang to be built and since we're building this in-tree,
7that leads to problems when compiling libcxx, compiler-rt which aren't built
8in-tree.
9
10Instead of using SPIRV_SKIP_CLANG_BUILD to skip clang build and adding this to
11all components, disable the building of tests altogether.
12
13Upstream-Status: Inappropriate
14
15Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
16Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
17---
18 CMakeLists.txt | 10 ----------
19 1 file changed, 10 deletions(-)
20
21diff --git a/CMakeLists.txt b/CMakeLists.txt
22index ecebb4cb..578ca602 100644
23--- a/CMakeLists.txt
24+++ b/CMakeLists.txt
25@@ -25,13 +25,6 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
26 set(CMAKE_CXX_STANDARD 14)
27 set(CMAKE_CXX_STANDARD_REQUIRED ON)
28
29- if(LLVM_SPIRV_INCLUDE_TESTS)
30- set(LLVM_TEST_COMPONENTS
31- llvm-as
32- llvm-dis
33- )
34- endif(LLVM_SPIRV_INCLUDE_TESTS)
35-
36 find_package(LLVM ${BASE_LLVM_VERSION} REQUIRED
37 COMPONENTS
38 Analysis
39@@ -62,9 +55,6 @@ set(LLVM_SPIRV_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/include)
40
41 add_subdirectory(lib/SPIRV)
42 add_subdirectory(tools/llvm-spirv)
43-if(LLVM_SPIRV_INCLUDE_TESTS)
44- add_subdirectory(test)
45-endif(LLVM_SPIRV_INCLUDE_TESTS)
46
47 install(
48 FILES
49--
502.26.2
51
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend b/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
index 4c05b659..8a6f6c70 100644
--- a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
+++ b/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend
@@ -1,11 +1,27 @@
1FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:" 1FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:"
2 2
3SPIRV_BRANCH = "${@bb.utils.contains('LLVMVERSION', '10.0.1', 'llvm_release_100', 'llvm_release_110', d)}"
4
5SPIRV10_SRCREV = "4d43f68a30a510b4e7607351caab3df8e7426a6b"
6SPIRV11_SRCREV = "61a10b27604bc4a9f6840f8fad82b779e708a279"
7
8SPIRV_SRCREV = "${@bb.utils.contains('LLVMVERSION', '10.0.1', '${SPIRV10_SRCREV}', '${SPIRV11_SRCREV}', d)}"
9
10SRC_URI_LLVM10 = " \
11 file://llvm10-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
12 file://fix-shared-libs.patch;patchdir=llvm/projects/llvm-spirv \
13 file://BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch;patchdir=llvm \
14 file://IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch;patchdir=llvm \
15 "
16
17SRC_URI_LLVM11 = " \
18 file://llvm11-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
19 "
20
3SRC_URI_append_intel-x86-common = " \ 21SRC_URI_append_intel-x86-common = " \
4 git://github.com/KhronosGroup/SPIRV-LLVM-Translator.git;protocol=https;branch=llvm_release_100;destsuffix=git/llvm/projects/llvm-spirv;name=spirv \ 22 git://github.com/KhronosGroup/SPIRV-LLVM-Translator.git;protocol=https;branch=${SPIRV_BRANCH};destsuffix=git/llvm/projects/llvm-spirv;name=spirv \
5 file://llvm10-skip-building-tests.patch;patchdir=llvm/projects/llvm-spirv \
6 file://fix-shared-libs.patch;patchdir=llvm/projects/llvm-spirv \
7 file://BasicBlockUtils-Add-metadata-fixing-in-SplitBlockPre.patch;patchdir=llvm \
8 file://IndVarSimplify-Do-not-use-SCEV-expander-for-IVCount-.patch;patchdir=llvm \
9 " 23 "
10 24
11SRCREV_spirv = "4d43f68a30a510b4e7607351caab3df8e7426a6b" 25SRC_URI_append_intel-x86-common = "${@bb.utils.contains('LLVMVERSION', '10.0.1', '${SRC_URI_LLVM10}', '${SRC_URI_LLVM11}', d)}"
26
27SRCREV_spirv = "${SPIRV_SRCREV}"