From c016558410610fbbe3b9c6bcaf37f2c76dafc592 Mon Sep 17 00:00:00 2001 From: Thomas Rodgers Date: Thu, 3 Jun 2021 12:30:44 -0700 Subject: [PATCH] Fix ABI regression in tbb::empty_task caused by switch to LTO --- ...ark-empty_task-execute-with-gnu-used.patch | 26 +++++++++++++++++++ tbb.spec | 9 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tbb-mark-empty_task-execute-with-gnu-used.patch diff --git a/tbb-mark-empty_task-execute-with-gnu-used.patch b/tbb-mark-empty_task-execute-with-gnu-used.patch new file mode 100644 index 0000000..597efcd --- /dev/null +++ b/tbb-mark-empty_task-execute-with-gnu-used.patch @@ -0,0 +1,26 @@ +From db2f2116adfb545bb76c92205f91e3e3f0f9e44a Mon Sep 17 00:00:00 2001 +From: Thomas Rodgers +Date: Wed, 2 Jun 2021 15:18:30 -0700 +Subject: [PATCH] Mark tbb::empty_task::execute with [[gnu::used]] + +--- + include/tbb/task.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/include/tbb/task.h b/include/tbb/task.h +index 5e137c6..5b60163 100644 +--- a/include/tbb/task.h ++++ b/include/tbb/task.h +@@ -1040,6 +1040,9 @@ inline void task::resume(suspend_point tag) { + //! task that does nothing. Useful for synchronization. + /** @ingroup task_scheduling */ + class __TBB_DEPRECATED_IN_VERBOSE_MODE empty_task: public task { ++#if __has_cpp_attribute(gnu::used) ++ [[gnu::used]] ++#endif + task* execute() __TBB_override { + return NULL; + } +-- +2.31.1 + diff --git a/tbb.spec b/tbb.spec index 532cdba..e8f8889 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: 5%{?dist} +Release: 6%{?dist} License: ASL 2.0 URL: http://threadingbuildingblocks.org/ @@ -27,6 +27,10 @@ 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 ABI break resulting from tbb::empty_task being removed from libtbb.so's +# exported symbols +Patch4: tbb-mark-empty_task-execute-with-gnu-used.patch + BuildRequires: cmake BuildRequires: doxygen BuildRequires: gcc-c++ @@ -201,6 +205,9 @@ cmake \ %{python3_sitearch}/__pycache__/TBB* %changelog +* Thu Jun 3 2021 Thomas Rodgers - 2020.3-6 +- Fix ABI regression in tbb::empty_task caused by switch to LTO + * Mon Feb 22 2021 Jerry James - 2020.3-5 - Fix cmake file installation some more (bz 1930389)