summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-support/tbb
diff options
context:
space:
mode:
authorNaveen Saini <naveen.kumar.saini@intel.com>2021-04-12 15:00:47 +0800
committerKhem Raj <raj.khem@gmail.com>2021-04-15 09:28:43 -0700
commit644b75926b0d2c707dc6406bbfa40c436b84c4ff (patch)
tree05214fd5133641287c0ea2b5a2ce796fce48093c /meta-oe/recipes-support/tbb
parenta2f2e752c201bf5e6a7345c63671e40dd14031c9 (diff)
downloadmeta-openembedded-644b75926b0d2c707dc6406bbfa40c436b84c4ff.tar.gz
tbb: upgrade 2020.3 -> 2021.2.0
Switched to cmake build tool. Rebased some patches due to directory re-structuring. Dropped patches, which are not required anymore. Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/tbb')
-rw-r--r--meta-oe/recipes-support/tbb/tbb/0001-CMakeLists.txt-exclude-riscv64-riscv32.patch42
-rw-r--r--meta-oe/recipes-support/tbb/tbb/0001-Disable-use-of-_tpause-instruction.patch34
-rw-r--r--meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch27
-rw-r--r--meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch22
-rw-r--r--meta-oe/recipes-support/tbb/tbb/cross-compile.patch35
-rw-r--r--meta-oe/recipes-support/tbb/tbb/improve-reproducibility.patch30
-rw-r--r--meta-oe/recipes-support/tbb/tbb/tbb.pc11
-rw-r--r--meta-oe/recipes-support/tbb/tbb_2021.2.0.bb (renamed from meta-oe/recipes-support/tbb/tbb_2020.3.bb)37
8 files changed, 116 insertions, 122 deletions
diff --git a/meta-oe/recipes-support/tbb/tbb/0001-CMakeLists.txt-exclude-riscv64-riscv32.patch b/meta-oe/recipes-support/tbb/tbb/0001-CMakeLists.txt-exclude-riscv64-riscv32.patch
new file mode 100644
index 000000000..ff6154808
--- /dev/null
+++ b/meta-oe/recipes-support/tbb/tbb/0001-CMakeLists.txt-exclude-riscv64-riscv32.patch
@@ -0,0 +1,42 @@
1From cb9e9b5b1ad05dd9de07a65ee7147cdb3433746a Mon Sep 17 00:00:00 2001
2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Fri, 9 Apr 2021 15:41:35 +0800
4Subject: [PATCH] CMakeLists.txt: exclude riscv64 & riscv32
5
6Upstream-Status: Pending
7
8Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
9---
10 src/tbb/CMakeLists.txt | 2 +-
11 src/tbbmalloc/CMakeLists.txt | 2 +-
12 2 files changed, 2 insertions(+), 2 deletions(-)
13
14diff --git a/src/tbb/CMakeLists.txt b/src/tbb/CMakeLists.txt
15index a6edb6ad..4f261813 100644
16--- a/src/tbb/CMakeLists.txt
17+++ b/src/tbb/CMakeLists.txt
18@@ -55,7 +55,7 @@ target_compile_definitions(tbb
19 PRIVATE
20 __TBB_BUILD)
21
22-if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(armv7-a|aarch64|mips|arm64)" OR
23+if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(armv7-a|aarch64|mips|arm64|riscv64|riscv32)" OR
24 "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64" OR
25 WINDOWS_STORE OR
26 TBB_WINDOWS_DRIVER))
27diff --git a/src/tbbmalloc/CMakeLists.txt b/src/tbbmalloc/CMakeLists.txt
28index de7ca7ea..31e854fe 100644
29--- a/src/tbbmalloc/CMakeLists.txt
30+++ b/src/tbbmalloc/CMakeLists.txt
31@@ -28,7 +28,7 @@ target_compile_definitions(tbbmalloc
32 PRIVATE
33 __TBBMALLOC_BUILD)
34
35-if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(armv7-a|aarch64|mips|arm64)" OR
36+if (NOT ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "(armv7-a|aarch64|mips|arm64|riscv64|riscv32)" OR
37 "${CMAKE_OSX_ARCHITECTURES}" MATCHES "arm64" OR
38 WINDOWS_STORE OR
39 TBB_WINDOWS_DRIVER))
40--
412.17.1
42
diff --git a/meta-oe/recipes-support/tbb/tbb/0001-Disable-use-of-_tpause-instruction.patch b/meta-oe/recipes-support/tbb/tbb/0001-Disable-use-of-_tpause-instruction.patch
new file mode 100644
index 000000000..7a4cc3e4e
--- /dev/null
+++ b/meta-oe/recipes-support/tbb/tbb/0001-Disable-use-of-_tpause-instruction.patch
@@ -0,0 +1,34 @@
1From 26bc87fdad9f29c00a5e37d6d9aed7f6dc7ff416 Mon Sep 17 00:00:00 2001
2From: Anuj Mittal <anuj.mittal@intel.com>
3Date: Mon, 12 Apr 2021 14:15:53 +0800
4Subject: [PATCH] Disable use of _tpause instruction
5
6It is assuming right now that WAITPKG instructions are available when using
7gcc 11 or clang 12. It's possible that we are building for a
8CPU where it's not available - in this case anything older than Alder Lake.
9
10Disable for now until the detection isn't fixed upstream.
11
12Upstream-Status: Inappropriate
13
14Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
15---
16 src/tbb/scheduler_common.h | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/tbb/scheduler_common.h b/src/tbb/scheduler_common.h
20index ee13dbf9..49052001 100644
21--- a/src/tbb/scheduler_common.h
22+++ b/src/tbb/scheduler_common.h
23@@ -219,7 +219,7 @@ inline void prolonged_pause_impl() {
24 #endif
25
26 inline void prolonged_pause() {
27-#if __TBB_WAITPKG_INTRINSICS_PRESENT && (_WIN32 || _WIN64 || __linux__) && (__TBB_x86_32 || __TBB_x86_64)
28+#if 0
29 if (governor::wait_package_enabled()) {
30 std::uint64_t time_stamp = machine_time_stamp();
31 // _tpause function directs the processor to enter an implementation-dependent optimized state
32--
332.29.0
34
diff --git a/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch b/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch
index 7e66945fa..49325447e 100644
--- a/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch
+++ b/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch
@@ -1,22 +1,23 @@
1From 6b2b136caa68912d77ffe26143cd3da768b9ef80 Mon Sep 17 00:00:00 2001 1From 52c1586bff0ecb418ac21d6678f8963d70959f04 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Sat, 3 Jun 2017 08:39:37 -0700 3Date: Wed, 7 Apr 2021 11:14:13 +0800
4Subject: [PATCH] mallinfo() is glibc specific API mark it so 4Subject: [PATCH] mallinfo() is glibc specific API mark it so
5 5
6Helps compiling with musl 6Helps compiling with musl
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10Upstream-Status: Pending 8Upstream-Status: Pending
11 9
12 src/tbbmalloc/proxy.cpp | 2 ++ 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
12---
13 src/tbbmalloc_proxy/proxy.cpp | 2 ++
13 1 file changed, 2 insertions(+) 14 1 file changed, 2 insertions(+)
14 15
15diff --git a/src/tbbmalloc/proxy.cpp b/src/tbbmalloc/proxy.cpp 16diff --git a/src/tbbmalloc_proxy/proxy.cpp b/src/tbbmalloc_proxy/proxy.cpp
16index 5ef279d..06c4872 100644 17index f9942bf1..fe0dad89 100644
17--- a/src/tbbmalloc/proxy.cpp 18--- a/src/tbbmalloc_proxy/proxy.cpp
18+++ b/src/tbbmalloc/proxy.cpp 19+++ b/src/tbbmalloc_proxy/proxy.cpp
19@@ -185,6 +185,7 @@ int mallopt(int /*param*/, int /*value*/) __THROW 20@@ -253,6 +253,7 @@ int mallopt(int /*param*/, int /*value*/) __THROW
20 return 1; 21 return 1;
21 } 22 }
22 23
@@ -24,7 +25,7 @@ index 5ef279d..06c4872 100644
24 struct mallinfo mallinfo() __THROW 25 struct mallinfo mallinfo() __THROW
25 { 26 {
26 struct mallinfo m; 27 struct mallinfo m;
27@@ -192,6 +193,7 @@ struct mallinfo mallinfo() __THROW 28@@ -260,6 +261,7 @@ struct mallinfo mallinfo() __THROW
28 29
29 return m; 30 return m;
30 } 31 }
@@ -33,5 +34,5 @@ index 5ef279d..06c4872 100644
33 #if __ANDROID__ 34 #if __ANDROID__
34 // Android doesn't have malloc_usable_size, provide it to be compatible 35 // Android doesn't have malloc_usable_size, provide it to be compatible
35-- 36--
362.13.0 372.17.1
37 38
diff --git a/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch b/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch
index 6f28f6f3a..fb10684cd 100644
--- a/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch
+++ b/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch
@@ -1,7 +1,7 @@
1From 27956d4c5fb615098231cebfb8eef11057639d3c Mon Sep 17 00:00:00 2001 1From 5cac8b5fffa4ebf5f0090456c9e0cbf43827242a Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com> 2From: Naveen Saini <naveen.kumar.saini@intel.com>
3Date: Sun, 8 Dec 2019 18:14:38 +0100 3Date: Wed, 7 Apr 2021 11:32:52 +0800
4Subject: [PATCH] src/tbbmalloc/proxy.cpp: __GLIBC_PREREQ is not defined on 4Subject: [PATCH] src/tbbmalloc/proxy.cpp: __GLIBC_PREREQ is not defined on
5 musl 5 musl
6 6
7Do not call __GLIBC_PREREQ if it is not defined otherwise build will 7Do not call __GLIBC_PREREQ if it is not defined otherwise build will
@@ -12,14 +12,15 @@ Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
12Upstream-Status: Submitted [https://github.com/oneapi-src/oneTBB/pull/203] 12Upstream-Status: Submitted [https://github.com/oneapi-src/oneTBB/pull/203]
13 13
14Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> 14Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
15Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com>
15--- 16---
16 src/tbbmalloc/proxy.cpp | 6 ++++-- 17 src/tbbmalloc_proxy/proxy.cpp | 6 ++++--
17 1 file changed, 4 insertions(+), 2 deletions(-) 18 1 file changed, 4 insertions(+), 2 deletions(-)
18 19
19diff --git a/src/tbbmalloc/proxy.cpp b/src/tbbmalloc/proxy.cpp 20diff --git a/src/tbbmalloc_proxy/proxy.cpp b/src/tbbmalloc_proxy/proxy.cpp
20index d96ae7a0..709ae839 100644 21index fe0dad89..93e68049 100644
21--- a/src/tbbmalloc/proxy.cpp 22--- a/src/tbbmalloc_proxy/proxy.cpp
22+++ b/src/tbbmalloc/proxy.cpp 23+++ b/src/tbbmalloc_proxy/proxy.cpp
23@@ -24,7 +24,8 @@ 24@@ -24,7 +24,8 @@
24 // of aligned_alloc as required by new C++ standard, this makes it hard to 25 // of aligned_alloc as required by new C++ standard, this makes it hard to
25 // redefine aligned_alloc here. However, running on systems with new libc 26 // redefine aligned_alloc here. However, running on systems with new libc
@@ -40,3 +41,6 @@ index d96ae7a0..709ae839 100644
40 #endif // __linux__ && !__ANDROID__ 41 #endif // __linux__ && !__ANDROID__
41 42
42 #include "proxy.h" 43 #include "proxy.h"
44--
452.17.1
46
diff --git a/meta-oe/recipes-support/tbb/tbb/cross-compile.patch b/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
deleted file mode 100644
index 36578543f..000000000
--- a/meta-oe/recipes-support/tbb/tbb/cross-compile.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1Author: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org>
2
3Upstream-Status: unsuitable
4---
5
6diff --git a/build/linux.clang.inc b/build/linux.clang.inc
7index fe9b5c98..b0dcd68b 100644
8--- a/build/linux.clang.inc
9+++ b/build/linux.clang.inc
10@@ -12,8 +12,8 @@
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14-CPLUS ?= clang++
15-CONLY ?= clang
16+CPLUS ?= $(CXX)
17+CONLY ?= $(CC)
18 COMPILE_ONLY = -c -MMD
19 PREPROC_ONLY = -E -x c++
20 INCLUDE_KEY = -I
21diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc
22index d820c15d..62c76afd 100644
23--- a/build/linux.gcc.inc
24+++ b/build/linux.gcc.inc
25@@ -12,8 +12,8 @@
26 # See the License for the specific language governing permissions and
27 # limitations under the License.
28
29-CPLUS ?= g++
30-CONLY ?= gcc
31+CPLUS ?= $(CXX)
32+CONLY ?= $(CC)
33 COMPILE_ONLY = -c -MMD
34 PREPROC_ONLY = -E -x c++
35 INCLUDE_KEY = -I
diff --git a/meta-oe/recipes-support/tbb/tbb/improve-reproducibility.patch b/meta-oe/recipes-support/tbb/tbb/improve-reproducibility.patch
deleted file mode 100644
index 91d10cb7a..000000000
--- a/meta-oe/recipes-support/tbb/tbb/improve-reproducibility.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From f56eeb18a07df139864a99e1967d450cc5c8c0bb Mon Sep 17 00:00:00 2001
2From: Lee Chee Yang <chee.yang.lee@intel.com>
3Date: Wed, 30 Sep 2020 16:18:35 +0800
4Subject: [PATCH] improve reproducibility
5
6remove the WORKDIR info from BUILD_COMMAND to improve reproducibility.
7also use SOURCE_DATE_EPOCH as DATETIME wherever possible.
8
9Upstream-Status: Inappropriate [sed WORKDIR does not applies to upstream]
10Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com>
11---
12 build/version_info_linux.sh | 4 +-
13 1 file changed, 2 insertion(+), 2 deletion(-)
14
15diff --git a/build/version_info_linux.sh b/build/version_info_linux.sh
16index 793cad11..ed6f4b2a 100644
17--- a/build/version_info_linux.sh
18+++ b/build/version_info_linux.sh
19@@ -25,6 +25,6 @@ echo '#N": BUILD_GCC'"\t\t"`g++ --version </dev/null 2>&1 | grep 'g++'`'" ENDL \
20 echo '#N": BUILD_LIBC'"\t"`getconf GNU_LIBC_VERSION | grep glibc | sed -e 's/^glibc //'`'" ENDL \'
21 echo '#N": BUILD_LD'"\t\t"`ld -v 2>&1 | grep 'version'`'" ENDL \'
22 echo '#N": BUILD_TARGET'"\t$arch on $runtime"'" ENDL \'
23-echo '#N": BUILD_COMMAND'"\t"$*'" ENDL \'
24+echo '#N": BUILD_COMMAND'"\t"$(echo $* | sed 's#'$WORKDIR'#/workdir#g')'" ENDL \'
25 echo ""
26-echo "#define __TBB_DATETIME \""`date -u`"\""
27+echo "#define __TBB_DATETIME \""`$(date -u -d "@$SOURCE_DATE_EPOCH" 2>/dev/null || date -u -r "$SOURCE_DATE_EPOCH" 2>/dev/null || date -u )`"\""
28--
292.25.1
30
diff --git a/meta-oe/recipes-support/tbb/tbb/tbb.pc b/meta-oe/recipes-support/tbb/tbb/tbb.pc
deleted file mode 100644
index 4f9da1140..000000000
--- a/meta-oe/recipes-support/tbb/tbb/tbb.pc
+++ /dev/null
@@ -1,11 +0,0 @@
1prefix=/usr
2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib
4includedir=${prefix}/include
5
6Name: Threading Building Blocks
7Description: Intel's parallelism library for C++
8URL: https://software.intel.com/en-us/tbb
9Version: 2020.2
10Libs: -L${libdir} -ltbb
11Cflags: -I${includedir}
diff --git a/meta-oe/recipes-support/tbb/tbb_2020.3.bb b/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb
index 8e0094b31..d0e231140 100644
--- a/meta-oe/recipes-support/tbb/tbb_2020.3.bb
+++ b/meta-oe/recipes-support/tbb/tbb_2021.2.0.bb
@@ -5,37 +5,26 @@ DESCRIPTION = "Parallelism library for C++ - runtime files \
5 and threading mechanism for performance and scalability." 5 and threading mechanism for performance and scalability."
6HOMEPAGE = "https://software.intel.com/en-us/tbb" 6HOMEPAGE = "https://software.intel.com/en-us/tbb"
7LICENSE = "Apache-2.0" 7LICENSE = "Apache-2.0"
8LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" 8LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=86d3f3a95c324c9479bd8986968f4327"
9BRANCH = "tbb_2020" 9BRANCH = "onetbb_2021"
10SRCREV = "eca91f16d7490a8abfdee652dadf457ec820cc37" 10SRCREV = "2dba2072869a189b9fdab3ffa431d3ea49059a19"
11SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \ 11SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
12 file://cross-compile.patch \ 12 file://0001-mallinfo-is-glibc-specific-API-mark-it-so.patch \
13 file://0001-mallinfo-is-glibc-specific-API-mark-it-so.patch \ 13 file://GLIBC-PREREQ-is-not-defined-on-musl.patch \
14 file://GLIBC-PREREQ-is-not-defined-on-musl.patch \ 14 file://0001-CMakeLists.txt-exclude-riscv64-riscv32.patch \
15 file://tbb.pc \ 15 file://0001-Disable-use-of-_tpause-instruction.patch \
16 file://improve-reproducibility.patch \
17" 16"
18 17
19S = "${WORKDIR}/git" 18S = "${WORKDIR}/git"
20PE = "1"
21 19
22COMPILER ?= "gcc" 20inherit cmake
23COMPILER_toolchain-clang = "clang"
24 21
25do_compile() { 22# test build fails, error: 'mallinfo mallinfo()' is deprecated
26 oe_runmake compiler=${COMPILER} arch=${HOST_ARCH} 23EXTRA_OECMAKE += " \
27} 24 -DTBB_TEST=OFF \
25 -DCMAKE_BUILD_TYPE=Release \
26 "
28 27
29do_install() {
30 install -d ${D}${includedir} ${D}${libdir}
31 rm ${S}/include/tbb/index.html -f
32 cp -R --no-dereference --preserve=mode,links -v ${S}/include/tbb ${D}${includedir}
33 for f in ${B}/build/linux_*_release/lib*.so*
34 do
35 install -Dm 0755 $f ${D}${libdir}/
36 done
37 install -Dm 0644 ${WORKDIR}/tbb.pc ${D}${libdir}/pkgconfig/tbb.pc
38}
39 28
40# fails with thumb enabled: 29# fails with thumb enabled:
41# | arm-oe-linux-gnueabi-g++ -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -mcpu=cortex-a9 -D__ARM__ -D__LINUX_ARM_ARCH__=7 -funwind-tables -mvectorize-with-neon-quad -rdynamic --sysroot=/OE/sysroots/m14tv -c -MMD -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD -fPIC -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-non-virtual-dtor -O2 -pipe -g -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp 30# | arm-oe-linux-gnueabi-g++ -march=armv7-a -mthumb -mthumb-interwork -mfloat-abi=softfp -mfpu=neon -mtune=cortex-a9 -mcpu=cortex-a9 -D__ARM__ -D__LINUX_ARM_ARCH__=7 -funwind-tables -mvectorize-with-neon-quad -rdynamic --sysroot=/OE/sysroots/m14tv -c -MMD -DTBB_USE_DEBUG -g -O0 -DUSE_PTHREAD -fPIC -D__TBB_BUILD=1 -Wall -Wno-parentheses -Wno-non-virtual-dtor -O2 -pipe -g -feliminate-unused-debug-types -fpermissive -fvisibility-inlines-hidden -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_queue.cpp