diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2020-04-10 08:19:49 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-04-09 17:45:01 -0700 |
commit | 681555bf55ae02c6efaf4fd3e65c53dda1095131 (patch) | |
tree | aea78554afa60b0db9844b1a3caf4c66478af4e9 /meta-oe/recipes-support/tbb | |
parent | 061cb505ee357c9319c1a85098ce8aab1cf99e81 (diff) | |
download | meta-openembedded-681555bf55ae02c6efaf4fd3e65c53dda1095131.tar.gz |
tbb: upgrade 2017 -> 2020.2
* Remove patches that are not needed anymore and fix the recipe to point
to new source location.
* Remove the compilation tweaks that don't seem to be required anymore.
* Include a patch to fix builds on musl.
Signed-off-by: Anuj Mittal <anuj.mittal@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/0002-linux-Fix-gcc-version-check.patch | 57 | ||||
-rw-r--r-- | meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch | 42 | ||||
-rw-r--r-- | meta-oe/recipes-support/tbb/tbb/cross-compile.patch | 62 | ||||
-rw-r--r-- | meta-oe/recipes-support/tbb/tbb/tbb.pc | 4 | ||||
-rw-r--r-- | meta-oe/recipes-support/tbb/tbb_2020.2.bb (renamed from meta-oe/recipes-support/tbb/tbb.bb) | 17 |
5 files changed, 80 insertions, 102 deletions
diff --git a/meta-oe/recipes-support/tbb/tbb/0002-linux-Fix-gcc-version-check.patch b/meta-oe/recipes-support/tbb/tbb/0002-linux-Fix-gcc-version-check.patch deleted file mode 100644 index 9824b61e9..000000000 --- a/meta-oe/recipes-support/tbb/tbb/0002-linux-Fix-gcc-version-check.patch +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | From aee098f1bf0511c6b5544de3170a9e8b51673b60 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pierre Le Magourou <plemagourou@softbankrobotics.com> | ||
3 | Date: Tue, 23 Jan 2018 15:25:50 +0100 | ||
4 | Subject: [PATCH] linux.gcc: Fix cross compilation error. | ||
5 | |||
6 | When cross compiling on linux with gcc, the host gcc was used instead of | ||
7 | the cross gcc to set compilation flags according to gcc version. | ||
8 | |||
9 | When the cross gcc was in version 5.X and the host gcc in version 7.X, | ||
10 | tbb was compiled with the -flifetime-dse=1 flag that does not exist on | ||
11 | gcc 5.X. | ||
12 | --- | ||
13 | build/linux.gcc.inc | 10 +++++----- | ||
14 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc | ||
17 | index 5c1889c..a4d6698 100644 | ||
18 | --- a/build/linux.gcc.inc | ||
19 | +++ b/build/linux.gcc.inc | ||
20 | @@ -41,29 +41,29 @@ LINK_FLAGS = -Wl,-rpath-link=. -rdynamic | ||
21 | C_FLAGS = $(CPLUS_FLAGS) | ||
22 | |||
23 | # gcc 4.2 and higher support OpenMP | ||
24 | -ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[2-9]|[5-9])")) | ||
25 | +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[2-9]|[5-9])")) | ||
26 | OPENMP_FLAG = -fopenmp | ||
27 | endif | ||
28 | |||
29 | # gcc 4.8 and later support RTM intrinsics, but require command line switch to enable them | ||
30 | -ifneq (,$(shell gcc -dumpversion | egrep "^(4\.[8-9]|[5-9])")) | ||
31 | +ifneq (,$(shell $(CC) -dumpversion | egrep "^(4\.[8-9]|[5-9])")) | ||
32 | RTM_KEY = -mrtm | ||
33 | endif | ||
34 | |||
35 | # gcc 4.0 and later have -Wextra that is used by some our customers. | ||
36 | -ifneq (,$(shell gcc -dumpversion | egrep "^([4-9])")) | ||
37 | +ifneq (,$(shell $(CC) -dumpversion | egrep "^([4-9])")) | ||
38 | TEST_WARNING_KEY += -Wextra | ||
39 | endif | ||
40 | |||
41 | # gcc 5.0 and later have -Wsuggest-override option | ||
42 | # enable it via a pre-included header in order to limit to C++11 and above | ||
43 | -ifneq (,$(shell gcc -dumpversion | egrep "^([5-9])")) | ||
44 | +ifneq (,$(shell $(CC) -dumpversion | egrep "^([5-9])")) | ||
45 | INCLUDE_TEST_HEADERS = -include $(tbb_root)/src/test/harness_preload.h | ||
46 | endif | ||
47 | |||
48 | # gcc 6.0 and later have -flifetime-dse option that controls | ||
49 | # elimination of stores done outside the object lifetime | ||
50 | -ifneq (,$(shell gcc -dumpversion | egrep "^([6-9])")) | ||
51 | +ifneq (,$(shell $(CC) -dumpversion | egrep "^([6-9])")) | ||
52 | # keep pre-contruction stores for zero initialization | ||
53 | DSE_KEY = -flifetime-dse=1 | ||
54 | endif | ||
55 | -- | ||
56 | 2.15.1 | ||
57 | |||
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 new file mode 100644 index 000000000..6f28f6f3a --- /dev/null +++ b/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | From 27956d4c5fb615098231cebfb8eef11057639d3c Mon Sep 17 00:00:00 2001 | ||
2 | From: Fabrice Fontaine <fontaine.fabrice@gmail.com> | ||
3 | Date: Sun, 8 Dec 2019 18:14:38 +0100 | ||
4 | Subject: [PATCH] src/tbbmalloc/proxy.cpp: __GLIBC_PREREQ is not defined on | ||
5 | musl | ||
6 | |||
7 | Do not call __GLIBC_PREREQ if it is not defined otherwise build will | ||
8 | fail on musl | ||
9 | |||
10 | Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/oneapi-src/oneTBB/pull/203] | ||
13 | |||
14 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
15 | --- | ||
16 | src/tbbmalloc/proxy.cpp | 6 ++++-- | ||
17 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/src/tbbmalloc/proxy.cpp b/src/tbbmalloc/proxy.cpp | ||
20 | index d96ae7a0..709ae839 100644 | ||
21 | --- a/src/tbbmalloc/proxy.cpp | ||
22 | +++ b/src/tbbmalloc/proxy.cpp | ||
23 | @@ -24,7 +24,8 @@ | ||
24 | // 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 | // version, it still needs it to be redefined, thus tricking system headers | ||
27 | -#if defined(__GLIBC_PREREQ) && !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC | ||
28 | +#if defined(__GLIBC_PREREQ) | ||
29 | +#if !__GLIBC_PREREQ(2, 16) && _GLIBCXX_HAVE_ALIGNED_ALLOC | ||
30 | // tell <cstdlib> that there is no aligned_alloc | ||
31 | #undef _GLIBCXX_HAVE_ALIGNED_ALLOC | ||
32 | // trick <stdlib.h> to define another symbol instead | ||
33 | @@ -32,7 +33,8 @@ | ||
34 | // Fix the state and undefine the trick | ||
35 | #include <cstdlib> | ||
36 | #undef aligned_alloc | ||
37 | -#endif // defined(__GLIBC_PREREQ)&&!__GLIBC_PREREQ(2, 16)&&_GLIBCXX_HAVE_ALIGNED_ALLOC | ||
38 | +#endif // defined(__GLIBC_PREREQ) | ||
39 | +#endif // !__GLIBC_PREREQ(2, 16)&&_GLIBCXX_HAVE_ALIGNED_ALLOC | ||
40 | #endif // __linux__ && !__ANDROID__ | ||
41 | |||
42 | #include "proxy.h" | ||
diff --git a/meta-oe/recipes-support/tbb/tbb/cross-compile.patch b/meta-oe/recipes-support/tbb/tbb/cross-compile.patch index d54b307ee..36578543f 100644 --- a/meta-oe/recipes-support/tbb/tbb/cross-compile.patch +++ b/meta-oe/recipes-support/tbb/tbb/cross-compile.patch | |||
@@ -1,39 +1,35 @@ | |||
1 | Author: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> | 1 | Author: Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> |
2 | 2 | ||
3 | Upstream-Status: unsuitable | 3 | Upstream-Status: unsuitable |
4 | --- | 4 | --- |
5 | build/linux.gcc.inc | 5 +++-- | ||
6 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
7 | 5 | ||
8 | Index: tbb2017_20170118oss/build/linux.gcc.inc | 6 | diff --git a/build/linux.clang.inc b/build/linux.clang.inc |
9 | =================================================================== | 7 | index fe9b5c98..b0dcd68b 100644 |
10 | --- tbb2017_20170118oss.orig/build/linux.gcc.inc | 8 | --- a/build/linux.clang.inc |
11 | +++ tbb2017_20170118oss/build/linux.gcc.inc | 9 | +++ b/build/linux.clang.inc |
12 | @@ -32,8 +32,9 @@ DYLIB_KEY = -shared | 10 | @@ -12,8 +12,8 @@ |
13 | EXPORT_KEY = -Wl,--version-script, | 11 | # See the License for the specific language governing permissions and |
14 | LIBDL = -ldl | 12 | # limitations under the License. |
15 | 13 | ||
16 | -CPLUS = g++ | 14 | -CPLUS ?= clang++ |
17 | -CONLY = gcc | 15 | -CONLY ?= clang |
18 | +CPLUS = $(CXX) | 16 | +CPLUS ?= $(CXX) |
19 | +CONLY = $(CC) | 17 | +CONLY ?= $(CC) |
20 | +CPLUS_FLAGS = $(CXXFLAGS) | 18 | COMPILE_ONLY = -c -MMD |
21 | LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY) | 19 | PREPROC_ONLY = -E -x c++ |
22 | LIBS += -lpthread -lrt | 20 | INCLUDE_KEY = -I |
23 | LINK_FLAGS = -Wl,-rpath-link=. -rdynamic | 21 | diff --git a/build/linux.gcc.inc b/build/linux.gcc.inc |
24 | Index: tbb2017_20170118oss/build/linux.clang.inc | 22 | index d820c15d..62c76afd 100644 |
25 | =================================================================== | 23 | --- a/build/linux.gcc.inc |
26 | --- tbb2017_20170118oss.orig/build/linux.clang.inc | 24 | +++ b/build/linux.gcc.inc |
27 | +++ tbb2017_20170118oss/build/linux.clang.inc | 25 | @@ -12,8 +12,8 @@ |
28 | @@ -31,8 +31,9 @@ DYLIB_KEY = -shared | 26 | # See the License for the specific language governing permissions and |
29 | EXPORT_KEY = -Wl,--version-script, | 27 | # limitations under the License. |
30 | LIBDL = -ldl | ||
31 | 28 | ||
32 | -CPLUS = clang++ | 29 | -CPLUS ?= g++ |
33 | -CONLY = clang | 30 | -CONLY ?= gcc |
34 | +CPLUS = $(CXX) | 31 | +CPLUS ?= $(CXX) |
35 | +CONLY = $(CC) | 32 | +CONLY ?= $(CC) |
36 | +CPLUS_FLAGS = $(CXXFLAGS) | 33 | COMPILE_ONLY = -c -MMD |
37 | LIB_LINK_FLAGS = $(DYLIB_KEY) -Wl,-soname=$(BUILDING_LIBRARY) | 34 | PREPROC_ONLY = -E -x c++ |
38 | LIBS += -lpthread -lrt | 35 | INCLUDE_KEY = -I |
39 | LINK_FLAGS = -Wl,-rpath-link=. -rdynamic | ||
diff --git a/meta-oe/recipes-support/tbb/tbb/tbb.pc b/meta-oe/recipes-support/tbb/tbb/tbb.pc index 644b64fbf..4f9da1140 100644 --- a/meta-oe/recipes-support/tbb/tbb/tbb.pc +++ b/meta-oe/recipes-support/tbb/tbb/tbb.pc | |||
@@ -5,7 +5,7 @@ includedir=${prefix}/include | |||
5 | 5 | ||
6 | Name: Threading Building Blocks | 6 | Name: Threading Building Blocks |
7 | Description: Intel's parallelism library for C++ | 7 | Description: Intel's parallelism library for C++ |
8 | URL: http://www.threadingbuildingblocks.org/ | 8 | URL: https://software.intel.com/en-us/tbb |
9 | Version: 3.0+r018 | 9 | Version: 2020.2 |
10 | Libs: -L${libdir} -ltbb | 10 | Libs: -L${libdir} -ltbb |
11 | Cflags: -I${includedir} | 11 | Cflags: -I${includedir} |
diff --git a/meta-oe/recipes-support/tbb/tbb.bb b/meta-oe/recipes-support/tbb/tbb_2020.2.bb index 911139b0d..2f9fd7f58 100644 --- a/meta-oe/recipes-support/tbb/tbb.bb +++ b/meta-oe/recipes-support/tbb/tbb_2020.2.bb | |||
@@ -3,27 +3,26 @@ DESCRIPTION = "Parallelism library for C++ - runtime files \ | |||
3 | performance without having to be a threading expert. It represents a \ | 3 | performance without having to be a threading expert. It represents a \ |
4 | higher-level, task-based parallelism that abstracts platform details \ | 4 | higher-level, task-based parallelism that abstracts platform details \ |
5 | and threading mechanism for performance and scalability." | 5 | and threading mechanism for performance and scalability." |
6 | HOMEPAGE = "http://threadingbuildingblocks.org/" | 6 | HOMEPAGE = "https://software.intel.com/en-us/tbb" |
7 | LICENSE = "Apache-2.0" | 7 | LICENSE = "Apache-2.0" |
8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | 8 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" |
9 | PRDATE = "20170412" | 9 | BRANCH = "tbb_2020" |
10 | BRANCH = "tbb_2017" | 10 | SRCREV = "60b7d0a78f8910976678ba63a19fdaee22c0ef65" |
11 | SRCREV = "a2cfdfe946933cbe38bffe1d8086ae36f06691a3" | 11 | SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \ |
12 | PV = "${PRDATE}+${SRCPV}" | ||
13 | SRC_URI = "git://github.com/01org/tbb;branch=${BRANCH} \ | ||
14 | file://cross-compile.patch \ | 12 | file://cross-compile.patch \ |
15 | file://0001-mallinfo-is-glibc-specific-API-mark-it-so.patch \ | 13 | file://0001-mallinfo-is-glibc-specific-API-mark-it-so.patch \ |
16 | file://0002-linux-Fix-gcc-version-check.patch \ | 14 | file://GLIBC-PREREQ-is-not-defined-on-musl.patch \ |
17 | file://tbb.pc \ | 15 | file://tbb.pc \ |
18 | " | 16 | " |
19 | 17 | ||
20 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
19 | PE = "1" | ||
21 | 20 | ||
22 | COMPILER ?= "gcc" | 21 | COMPILER ?= "gcc" |
23 | COMPILER_toolchain-clang = "clang" | 22 | COMPILER_toolchain-clang = "clang" |
24 | 23 | ||
25 | do_compile() { | 24 | do_compile() { |
26 | oe_runmake compiler=${COMPILER} arch=${HOST_ARCH} runtime=cc4 | 25 | oe_runmake compiler=${COMPILER} arch=${HOST_ARCH} |
27 | } | 26 | } |
28 | 27 | ||
29 | do_install() { | 28 | do_install() { |
@@ -44,5 +43,3 @@ do_install() { | |||
44 | # ... | 43 | # ... |
45 | # | make[1]: *** [concurrent_queue.o] Error 1 | 44 | # | make[1]: *** [concurrent_queue.o] Error 1 |
46 | ARM_INSTRUCTION_SET = "arm" | 45 | ARM_INSTRUCTION_SET = "arm" |
47 | SECURITY_CFLAGS_append = " -fPIC" | ||
48 | |||