From 000c04938819544e80008314fa15ce07ab0bbb5c Mon Sep 17 00:00:00 2001 From: Jerry James Date: Thu, 18 Feb 2021 16:34:41 -0700 Subject: [PATCH] Fix cmake file installation (bz 1930389). - Allow use of RTM instructions when available. - At upstream's suggestion, do not force ITT_NOTIFY support. - Drop -fetchadd64 patch, only needed for forced ITT_NOTIFY support. --- tbb-2019-fetchadd4.patch | 12 ------------ tbb.spec | 29 +++++++++++++++-------------- 2 files changed, 15 insertions(+), 26 deletions(-) delete mode 100644 tbb-2019-fetchadd4.patch diff --git a/tbb-2019-fetchadd4.patch b/tbb-2019-fetchadd4.patch deleted file mode 100644 index 72b0d09..0000000 --- a/tbb-2019-fetchadd4.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up tbb-2019_U9/src/tbb/tools_api/ittnotify_config.h.orig tbb-2019_U9/src/tbb/tools_api/ittnotify_config.h ---- tbb-2020.1/src/tbb/tools_api/ittnotify_config.h.orig 2020-01-21 04:26:46.000000000 -0700 -+++ tbb-2020.1/src/tbb/tools_api/ittnotify_config.h 2020-01-22 20:59:51.911673011 -0700 -@@ -335,7 +335,7 @@ ITT_INLINE long - __itt_interlocked_increment(volatile long* ptr) ITT_INLINE_ATTRIBUTE; - ITT_INLINE long __itt_interlocked_increment(volatile long* ptr) - { -- return __TBB_machine_fetchadd4(ptr, 1) + 1L; -+ return __atomic_fetch_add(ptr, 1L, __ATOMIC_SEQ_CST) + 1L; - } - #endif /* ITT_SIMPLE_INIT */ - diff --git a/tbb.spec b/tbb.spec index cd0cb31..8a258f9 100644 --- a/tbb.spec +++ b/tbb.spec @@ -1,7 +1,7 @@ Name: tbb Summary: The Threading Building Blocks library abstracts low-level threading details Version: 2020.3 -Release: 3%{?dist} +Release: 4%{?dist} License: ASL 2.0 URL: http://threadingbuildingblocks.org/ @@ -27,10 +27,7 @@ Patch2: tbb-2019-test-thread-monitor.patch # than 2 threads will be available to use it. Patch3: tbb-2019-test-task-scheduler-init.patch -# Fix compilation on aarch64 and s390x. See -# https://github.com/intel/tbb/issues/186 -Patch4: tbb-2019-fetchadd4.patch - +BuildRequires: cmake BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: make @@ -81,11 +78,8 @@ Python 3 TBB module. sed -i 's/"`hostname -s`" ("`uname -m`"/fedorabuild (%{_arch}/' \ build/version_info_linux.sh -# Do not assume the RTM instructions are available. # Insert --as-needed before the libraries to be linked. -sed -e 's/-mrtm//' \ - -e "s/-fPIC/& -Wl,--as-needed/" \ - -i build/linux.gcc.inc +sed -i "s/-fPIC/& -Wl,--as-needed/" build/linux.gcc.inc # Invoke the right python binary directly sed -i 's,env python,python3,' python/TBB.py python/tbb/__*.py @@ -105,7 +99,7 @@ fi %make_build tbb_build_prefix=obj stdver=c++14 \ compiler=${compiler} \ - CXXFLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \ + CXXFLAGS="%{optflags} -DUSE_PTHREAD" \ LDFLAGS="$RPM_LD_FLAGS -lpthread" for file in %{SOURCE6} %{SOURCE7} %{SOURCE8}; do base=$(basename ${file}) @@ -118,7 +112,7 @@ done pushd python %make_build -C rml stdver=c++14 \ compiler=${compiler} \ - CPLUS_FLAGS="%{optflags} -DDO_ITT_NOTIFY -DUSE_PTHREAD" \ + CPLUS_FLAGS="%{optflags} -DUSE_PTHREAD" \ LDFLAGS="$RPM_LD_FLAGS -lpthread" cp -p rml/libirml.so* . %py3_build @@ -175,8 +169,9 @@ popd # Install the cmake files mkdir -p $RPM_BUILD_ROOT%{_libdir}/cmake -cp -a cmake $RPM_BUILD_ROOT%{_libdir}/cmake/%{name} -rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst +cmake -DTBB_ROOT=$RPM_BUILD_ROOT%{_prefix} -DTBB_OS=Linux \ + -P cmake/tbb_config_generator.cmake +mv $RPM_BUILD_ROOT%{_prefix}/cmake $RPM_BUILD_ROOT%{_libdir}/cmake/TBB %files %doc doc/Release_Notes.txt README.md @@ -191,7 +186,7 @@ rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst %{_includedir}/rml/ %{_includedir}/tbb/ %{_libdir}/*.so -%{_libdir}/cmake/tbb/ +%{_libdir}/cmake/TBB/ %{_libdir}/pkgconfig/*.pc %files doc @@ -205,6 +200,12 @@ rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst %{python3_sitearch}/__pycache__/TBB* %changelog +* Thu Feb 18 2021 Jerry James - 2020.3-4 +- Fix cmake file installation (bz 1930389) +- Allow use of RTM instructions when available +- At upstream's suggestion, do not force ITT_NOTIFY support +- Drop -fetchadd64 patch, only needed for forced ITT_NOTIFY support + * Wed Jan 27 2021 Fedora Release Engineering - 2020.3-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild