diff --git a/tbb-2019-test-task-scheduler-init.patch b/tbb-2019-test-task-scheduler-init.patch new file mode 100644 index 0000000..9eca318 --- /dev/null +++ b/tbb-2019-test-task-scheduler-init.patch @@ -0,0 +1,12 @@ +diff -up tbb-2019_U8/src/test/test_task_scheduler_init.cpp.orig tbb-2019_U8/src/test/test_task_scheduler_init.cpp +--- tbb-2019_U8/src/test/test_task_scheduler_init.cpp.orig 2019-06-06 04:29:15.000000000 -0600 ++++ tbb-2019_U8/src/test/test_task_scheduler_init.cpp 2019-08-26 12:08:19.547880295 -0600 +@@ -285,7 +285,7 @@ namespace TestBlockingTerminateNS { + } + }; + void operator()() { +- const int numThreads = 4; ++ const int numThreads = 2; + tbb::task_scheduler_init init( numThreads ); + Harness::SpinBarrier barrier( numThreads ); + tbb::parallel_for( 0, numThreads, Body( barrier ) ); diff --git a/tbb-2019-test-thread-monitor.patch b/tbb-2019-test-thread-monitor.patch new file mode 100644 index 0000000..27d6a19 --- /dev/null +++ b/tbb-2019-test-thread-monitor.patch @@ -0,0 +1,47 @@ +--- tbb-2019_U8/src/rml/test/test_thread_monitor.cpp.orig 2019-06-06 04:29:15.000000000 -0600 ++++ tbb-2019_U8/src/rml/test/test_thread_monitor.cpp 2019-08-27 11:36:44.253575223 -0600 +@@ -33,21 +33,21 @@ public: + } + typedef rml::internal::thread_monitor thread_monitor; + thread_monitor monitor; +- volatile int request; +- volatile int ack; +- volatile unsigned clock; +- volatile unsigned stamp; ++ tbb::atomic request; ++ tbb::atomic ack; ++ tbb::atomic clock; ++ unsigned stamp; + ThreadState() : request(-1), ack(-1), clock(0) {} + }; + + void ThreadState::loop() { + for(;;) { +- ++clock; + if( ack==request ) { + thread_monitor::cookie c; + monitor.prepare_wait(c); + if( ack==request ) { + REMARK("%p: request=%d ack=%d\n", this, request, ack ); ++ ++clock; + monitor.commit_wait(c); + } else + monitor.cancel_wait(); +@@ -60,7 +60,7 @@ void ThreadState::loop() { + rml::internal::thread_monitor::yield(); + } + int r = request; +- ack = request; ++ ack = r; + if( !r ) return; + } + } +@@ -89,7 +89,7 @@ int TestMain () { + REPORT("Warning: thread %d not waiting\n",i); + break; + } +- } while( t[i].stamp!=t[i].clock ); ++ } while( t[i].stamp==0 || t[i].stamp!=t[i].clock ); + } + } + REMARK("notifying threads\n"); diff --git a/tbb.spec b/tbb.spec index d2f7342..0c5eaca 100644 --- a/tbb.spec +++ b/tbb.spec @@ -23,6 +23,14 @@ Patch0: tbb-2019-dont-snip-Wall.patch # Make attributes of aliases match those on the aliased function. Patch1: tbb-2019-attributes.patch +# Fix test-thread-monitor, which had multiple bugs that could (and did, on +# ppc64le) result in a hang. +Patch2: tbb-2019-test-thread-monitor.patch + +# Fix a test that builds a 4-thread barrier, but cannot guarantee that more +# than 2 threads will be available to use it. +Patch3: tbb-2019-test-task-scheduler-init.patch + BuildRequires: doxygen BuildRequires: gcc-c++ BuildRequires: python3-devel @@ -180,6 +188,9 @@ rm $RPM_BUILD_ROOT%{_libdir}/cmake/%{name}/README.rst %{python3_sitearch}/__pycache__/TBB* %changelog +* Tue Aug 27 2019 Jerry James - 2019.8-3 +- Add -test-thread-monitor and -test-task-scheduler-init patches to fix FTBFS + * Mon Aug 19 2019 Miro HronĨok - 2019.8-3 - Rebuilt for Python 3.8