Skip to contentSkip to conversation

tbb-native: Fix build with gcc-13

PATCH In review Yogesh Tyagi 2 participants 4 messages Sep 25, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tbb-native: Fix build with gcc-13

* Fixes following stringop-overflow warning with gcc-13:

In file included from /usr/include/c++/13/atomic:41,

                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/../../include/oneapi/tbb/detail/_utils.h:22,
                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/task_dispatcher.h:20,
                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/arena.cpp:17:

In member function ‘void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]’,
inlined from ‘void std::atomic<bool>::store(bool, std::memory_order)’ at /usr/include/c++/13/atomic:104:20,
inlined from ‘void tbb::detail::r1::concurrent_monitor_base<Context>::notify_one_relaxed() [with Context = long unsigned int]’ at /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/concurrent_monitor.h:293:53:
/usr/include/c++/13/bits/atomic_base.h:481:25: error: ‘void __atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

  481 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

(cherry picked from commit e131071769ee3df51b56b053ba6bfa06ae9eff25)

---
 ...suppress-new-GCC-12-13-warnings-1192.patch | 57 +++++++++++++++++++
 meta-oe/recipes-support/tbb/tbb_2021.11.0.bb  |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch new file +57 -0
new file mode 100644
index 0000000000..489f011b84
@@ -0,0 +1,57 @@
+From e131071769ee3df51b56b053ba6bfa06ae9eff25 Mon Sep 17 00:00:00 2001
+From: Dmitri Mokhov <[email protected]>
+Date: Mon, 11 Sep 2023 10:35:07 -0500
+Subject: [PATCH] Fix/suppress new GCC 12/13 warnings (#1192)
+
+Upstream-Status: Backport [https://github.com/oneapi-src/oneTBB/commit/e131071769ee3df51b56b053ba6bfa06ae9eff25]
+Signed-off-by: Dmitri Mokhov <[email protected]>
+---
+ .../oneapi/tbb/detail/_concurrent_unordered_base.h   |  2 +-
+ src/tbb/concurrent_monitor.h                         | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/include/oneapi/tbb/detail/_concurrent_unordered_base.h b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+index ade91c33..40829208 100644
+--- a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
++++ b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+@@ -921,7 +921,7 @@ private:
+             node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
+         } else {
+             // GCC 11.1 issues a warning here that incorrect destructor might be called for dummy_nodes
+-            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 130000 ) && !__clang__ && !__INTEL_COMPILER
++            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
+             volatile
+             #endif
+             value_node_ptr val_node = static_cast<value_node_ptr>(node);
+diff --git a/src/tbb/concurrent_monitor.h b/src/tbb/concurrent_monitor.h
+index 3d20ef5b..3e5c4beb 100644
+--- a/src/tbb/concurrent_monitor.h
++++ b/src/tbb/concurrent_monitor.h
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2005-2021 Intel Corporation
++    Copyright (c) 2005-2023 Intel Corporation
+ 
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+@@ -290,7 +290,17 @@ public:
+             n = my_waitset.front();
+             if (n != end) {
+                 my_waitset.remove(*n);
++
++// GCC 12.x-13.x issues a warning here that to_wait_node(n)->my_is_in_list might have size 0, since n is
++// a base_node pointer. (This cannot happen, because only wait_node pointers are added to my_waitset.)
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wstringop-overflow"
++#endif
+                 to_wait_node(n)->my_is_in_list.store(false, std::memory_order_relaxed);
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
++#pragma GCC diagnostic pop
++#endif
+             }
+         }
+ 
+-- 
+2.43.0
+
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +1 -0
index f834726bd6..318cd87643 100644
@@ -16,6 +16,7 @@ BRANCH = "onetbb_2021"
 SRCREV = "8b829acc65569019edb896c5150d427f288e8aba"
 SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
             file://0001-hwloc_detection.cmake-remove-cross-compiation-check.patch \
+            file://0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch \
 "
 S = "${WORKDIR}/git"
 
Signature · 1 line
2.43.0
#1 lore raw

do we need this on master as well ?

Quoted 112 lines · Yogesh Tyagi via lists.openembedded.org

* Fixes following stringop-overflow warning with gcc-13:

In file included from /usr/include/c++/13/atomic:41,

                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/../../include/oneapi/tbb/detail/_utils.h:22,
                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/task_dispatcher.h:20,
                 from /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/arena.cpp:17:

In member function ‘void std::__atomic_base<_IntTp>::store(__int_type, std::memory_order) [with _ITp = bool]’,
inlined from ‘void std::atomic<bool>::store(bool, std::memory_order)’ at /usr/include/c++/13/atomic:104:20,
inlined from ‘void tbb::detail::r1::concurrent_monitor_base<Context>::notify_one_relaxed() [with Context = long unsigned int]’ at /poky/build/tmp/work/x86_64-linux/tbb-native/2021.11.0/git/src/tbb/concurrent_monitor.h:293:53:
/usr/include/c++/13/bits/atomic_base.h:481:25: error: ‘void __atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

  481 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

(cherry picked from commit e131071769ee3df51b56b053ba6bfa06ae9eff25)

---
 ...suppress-new-GCC-12-13-warnings-1192.patch | 57 +++++++++++++++++++
 meta-oe/recipes-support/tbb/tbb_2021.11.0.bb  |  1 +
 2 files changed, 58 insertions(+)
 create mode 100644 meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch new file +57 -0
new file mode 100644
index 0000000000..489f011b84
@@ -0,0 +1,57 @@
+From e131071769ee3df51b56b053ba6bfa06ae9eff25 Mon Sep 17 00:00:00 2001
+From: Dmitri Mokhov <[email protected]>
+Date: Mon, 11 Sep 2023 10:35:07 -0500
+Subject: [PATCH] Fix/suppress new GCC 12/13 warnings (#1192)
+
+Upstream-Status: Backport [https://github.com/oneapi-src/oneTBB/commit/e131071769ee3df51b56b053ba6bfa06ae9eff25]
+Signed-off-by: Dmitri Mokhov <[email protected]>
+---
+ .../oneapi/tbb/detail/_concurrent_unordered_base.h   |  2 +-
+ src/tbb/concurrent_monitor.h                         | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/include/oneapi/tbb/detail/_concurrent_unordered_base.h b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+index ade91c33..40829208 100644
+--- a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
++++ b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+@@ -921,7 +921,7 @@ private:
+             node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
+         } else {
+             // GCC 11.1 issues a warning here that incorrect destructor might be called for dummy_nodes
+-            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 130000 ) && !__clang__ && !__INTEL_COMPILER
++            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
+             volatile
+             #endif
+             value_node_ptr val_node = static_cast<value_node_ptr>(node);
+diff --git a/src/tbb/concurrent_monitor.h b/src/tbb/concurrent_monitor.h
+index 3d20ef5b..3e5c4beb 100644
+--- a/src/tbb/concurrent_monitor.h
++++ b/src/tbb/concurrent_monitor.h
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2005-2021 Intel Corporation
++    Copyright (c) 2005-2023 Intel Corporation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+@@ -290,7 +290,17 @@ public:
+             n = my_waitset.front();
+             if (n != end) {
+                 my_waitset.remove(*n);
++
++// GCC 12.x-13.x issues a warning here that to_wait_node(n)->my_is_in_list might have size 0, since n is
++// a base_node pointer. (This cannot happen, because only wait_node pointers are added to my_waitset.)
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wstringop-overflow"
++#endif
+                 to_wait_node(n)->my_is_in_list.store(false, std::memory_order_relaxed);
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 ) && !__clang__ && !__INTEL_COMPILER
++#pragma GCC diagnostic pop
++#endif
+             }
+         }
+
+--
+2.43.0
+
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +1 -1
index f834726bd6..318cd87643 100644
@@ -16,6 +16,7 @@ BRANCH = "onetbb_2021"
 SRCREV = "8b829acc65569019edb896c5150d427f288e8aba"
 SRC_URI = "git://github.com/oneapi-src/oneTBB.git;protocol=https;branch=${BRANCH} \
             file://0001-hwloc_detection.cmake-remove-cross-compiation-check.patch \
+            file://0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch \
 "
 S = "${WORKDIR}/git"
 
--

2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#112495): https://lists.openembedded.org/g/openembedded-devel/message/112495
Mute This Topic: https://lists.openembedded.org/mt/108644971/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 10 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: Wednesday, September 25, 2024 8:41 PM
To: Tyagi, Yogesh <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [scarthgap][PATCH] tbb-native: Fix build with gcc-13

do we need this on master as well ?

tbb-native is building fine on master.

Quoted 153 lines
Quoted 5 lines · Yogesh Tyagi via lists.openembedded.org

* Fixes following stringop-overflow warning with gcc-13:

In file included from /usr/include/c++/13/atomic:41,

                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/../../include/oneapi/tbb/detail/_utils.h:22,

Quoted 1 line
                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/task_dispatcher.h:20,

Quoted 1 line
                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/arena.cpp:17:

Quoted 1 line

In member function ‘void std::__atomic_base<_IntTp>::store(__int_type,

std::memory_order) [with _ITp = bool]’,

Quoted 1 line

inlined from ‘void std::atomic<bool>::store(bool, std::memory_order)’ at

/usr/include/c++/13/atomic:104:20,

Quoted 1 line

inlined from ‘void

tbb::detail::r1::concurrent_monitor_base<Context>::notify_one_relaxed() [with Context = long unsigned int]’ at /poky/build/tmp/work/x86_64-linux/tbb- native/2021.11.0/git/src/tbb/concurrent_monitor.h:293:53:

Quoted 1 line

/usr/include/c++/13/bits/atomic_base.h:481:25: error: ‘void

__atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

Quoted 28 lines
  481 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

(cherry picked from commit e131071769ee3df51b56b053ba6bfa06ae9eff25)

---
 ...suppress-new-GCC-12-13-warnings-1192.patch | 57
+++++++++++++++++++  meta-oe/recipes-support/tbb/tbb_2021.11.0.bb  |
1 +
 2 files changed, 58 insertions(+)
 create mode 100644

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnin gs-1192.patch

diff --git a/meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warn ings-1192.patch b/meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warn ings-1192.patch
new file mode 100644
index 0000000000..489f011b84

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +1 -0
+++ warnings-1192.patch

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 8

Quoted 8 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +8 -0
@@ -0,0 +1,57 @@
+From e131071769ee3df51b56b053ba6bfa06ae9eff25 Mon Sep 17 00:00:00
+2001
+From: Dmitri Mokhov <[email protected]>
+Date: Mon, 11 Sep 2023 10:35:07 -0500
+Subject: [PATCH] Fix/suppress new GCC 12/13 warnings (#1192)
+
+Upstream-Status: Backport
+[https://github.com/oneapi-

src/oneTBB/commit/e131071769ee3df51b56b053

Quoted 6 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +6 -0
+ba6bfa06ae9eff25]
+Signed-off-by: Dmitri Mokhov <[email protected]>
+---
+ .../oneapi/tbb/detail/_concurrent_unordered_base.h   |  2 +-
+ src/tbb/concurrent_monitor.h                         | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 24

Quoted 10 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +10 -0
+
+diff --git a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+index ade91c33..40829208 100644
+--- a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
++++ b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+@@ -921,7 +921,7 @@ private:
+             node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
+         } else {
+             // GCC 11.1 issues a warning here that incorrect destructor might be

called for dummy_nodes

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 25

Quoted 1 line
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +1 -0
+-            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION <

130000 ) && !__clang__ && !__INTEL_COMPILER

Quoted 17 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +17 -0
++            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION <
++ 140000 ) && !__clang__ && !__INTEL_COMPILER
+             volatile
+             #endif
+             value_node_ptr val_node =
+static_cast<value_node_ptr>(node);
+diff --git a/src/tbb/concurrent_monitor.h
+b/src/tbb/concurrent_monitor.h index 3d20ef5b..3e5c4beb 100644
+--- a/src/tbb/concurrent_monitor.h
++++ b/src/tbb/concurrent_monitor.h
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2005-2021 Intel Corporation
++    Copyright (c) 2005-2023 Intel Corporation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 52

Quoted 10 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +10 -0
+@@ -290,7 +290,17 @@ public:
+             n = my_waitset.front();
+             if (n != end) {
+                 my_waitset.remove(*n);
++
++// GCC 12.x-13.x issues a warning here that
++to_wait_node(n)->my_is_in_list might have size 0, since n is // a
++base_node pointer. (This cannot happen, because only wait_node
++pointers are added to my_waitset.) #if (__TBB_GCC_VERSION >= 120100
++&& __TBB_GCC_VERSION < 140000 ) && !__clang__ &&

!__INTEL_COMPILER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-overflow"

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 56

Quoted 4 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +4 -0
++#endif
+                 to_wait_node(n)->my_is_in_list.store(false,
+ std::memory_order_relaxed);
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 )

&&

Quoted 13 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +7 -0
++!__clang__ && !__INTEL_COMPILER #pragma GCC diagnostic pop #endif
+             }
+         }
+
+--
+2.43.0
+
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +0 -0
index f834726bd6..318cd87643 100644

meta-oe/recipes-support/tbb/tbb_2021.11.0.bb BRANCH = "onetbb_2021" · line 17

Quoted 2 lines
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +0 -0
@@ -16,6 +16,7 @@ BRANCH = "onetbb_2021"
 SRCREV = "8b829acc65569019edb896c5150d427f288e8aba"
 SRC_URI = "git://github.com/oneapi-

src/oneTBB.git;protocol=https;branch=${BRANCH} \

Quoted 22 lines

file://0001-hwloc_detection.cmake-remove-cross-compiation-check.patch \
+
+ file://0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch \
"
S = "${WORKDIR}/git"

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#112495):
https://lists.openembedded.org/g/openembedded-devel/message/112495
Mute This Topic: https://lists.openembedded.org/mt/108644971/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#3 lore raw
Quoted 10 lines · Yogesh
Quoted 10 lines

-----Original Message-----
From: Khem Raj <[email protected]>
Sent: Wednesday, September 25, 2024 8:41 PM
To: Tyagi, Yogesh <[email protected]>
Cc: [email protected]
Subject: Re: [oe] [scarthgap][PATCH] tbb-native: Fix build with gcc-13

Quoted 3 lines
Quoted 1 line

do we need this on master as well ?

tbb-native is building fine on master.

Thanks for confirming.

Quoted 154 lines
Quoted 154 lines
Quoted 5 lines · Yogesh Tyagi via lists.openembedded.org

* Fixes following stringop-overflow warning with gcc-13:

In file included from /usr/include/c++/13/atomic:41,

                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/../../include/oneapi/tbb/detail/_utils.h:22,

Quoted 1 line
                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/task_dispatcher.h:20,

Quoted 1 line
                 from /poky/build/tmp/work/x86_64-linux/tbb-

native/2021.11.0/git/src/tbb/arena.cpp:17:

Quoted 1 line

In member function ‘void std::__atomic_base<_IntTp>::store(__int_type,

std::memory_order) [with _ITp = bool]’,

Quoted 1 line

inlined from ‘void std::atomic<bool>::store(bool, std::memory_order)’ at

/usr/include/c++/13/atomic:104:20,

Quoted 1 line

inlined from ‘void

tbb::detail::r1::concurrent_monitor_base<Context>::notify_one_relaxed() [with Context = long unsigned int]’ at /poky/build/tmp/work/x86_64-linux/tbb- native/2021.11.0/git/src/tbb/concurrent_monitor.h:293:53:

Quoted 1 line

/usr/include/c++/13/bits/atomic_base.h:481:25: error: ‘void

__atomic_store_1(volatile void*, unsigned char, int)’ writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]

Quoted 28 lines
  481 |         __atomic_store_n(&_M_i, __i, int(__m));
      |         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors

(cherry picked from commit e131071769ee3df51b56b053ba6bfa06ae9eff25)

---
 ...suppress-new-GCC-12-13-warnings-1192.patch | 57
+++++++++++++++++++  meta-oe/recipes-support/tbb/tbb_2021.11.0.bb  |
1 +
 2 files changed, 58 insertions(+)
 create mode 100644

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warnin gs-1192.patch

diff --git a/meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warn ings-1192.patch b/meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13-warn ings-1192.patch
new file mode 100644
index 0000000000..489f011b84

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +1 -0
+++ warnings-1192.patch

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 8

Quoted 8 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +8 -0
@@ -0,0 +1,57 @@
+From e131071769ee3df51b56b053ba6bfa06ae9eff25 Mon Sep 17 00:00:00
+2001
+From: Dmitri Mokhov <[email protected]>
+Date: Mon, 11 Sep 2023 10:35:07 -0500
+Subject: [PATCH] Fix/suppress new GCC 12/13 warnings (#1192)
+
+Upstream-Status: Backport
+[https://github.com/oneapi-

src/oneTBB/commit/e131071769ee3df51b56b053

Quoted 6 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +6 -0
+ba6bfa06ae9eff25]
+Signed-off-by: Dmitri Mokhov <[email protected]>
+---
+ .../oneapi/tbb/detail/_concurrent_unordered_base.h   |  2 +-
+ src/tbb/concurrent_monitor.h                         | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 2 deletions(-)

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 24

Quoted 10 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +10 -0
+
+diff --git a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+index ade91c33..40829208 100644
+--- a/include/oneapi/tbb/detail/_concurrent_unordered_base.h
++++ b/include/oneapi/tbb/detail/_concurrent_unordered_base.h
+@@ -921,7 +921,7 @@ private:
+             node_allocator_traits::deallocate(dummy_node_allocator, node, 1);
+         } else {
+             // GCC 11.1 issues a warning here that incorrect destructor might be

called for dummy_nodes

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 25

Quoted 1 line
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +1 -0
+-            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION <

130000 ) && !__clang__ && !__INTEL_COMPILER

Quoted 17 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +17 -0
++            #if (__TBB_GCC_VERSION >= 110100 && __TBB_GCC_VERSION <
++ 140000 ) && !__clang__ && !__INTEL_COMPILER
+             volatile
+             #endif
+             value_node_ptr val_node =
+static_cast<value_node_ptr>(node);
+diff --git a/src/tbb/concurrent_monitor.h
+b/src/tbb/concurrent_monitor.h index 3d20ef5b..3e5c4beb 100644
+--- a/src/tbb/concurrent_monitor.h
++++ b/src/tbb/concurrent_monitor.h
+@@ -1,5 +1,5 @@
+ /*
+-    Copyright (c) 2005-2021 Intel Corporation
++    Copyright (c) 2005-2023 Intel Corporation
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 52

Quoted 10 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +10 -0
+@@ -290,7 +290,17 @@ public:
+             n = my_waitset.front();
+             if (n != end) {
+                 my_waitset.remove(*n);
++
++// GCC 12.x-13.x issues a warning here that
++to_wait_node(n)->my_is_in_list might have size 0, since n is // a
++base_node pointer. (This cannot happen, because only wait_node
++pointers are added to my_waitset.) #if (__TBB_GCC_VERSION >= 120100
++&& __TBB_GCC_VERSION < 140000 ) && !__clang__ &&

!__INTEL_COMPILER #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wstringop-overflow"

meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- line 56

Quoted 4 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +4 -0
++#endif
+                 to_wait_node(n)->my_is_in_list.store(false,
+ std::memory_order_relaxed);
++#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 140000 )

&&

Quoted 13 lines
meta-oe/recipes-support/tbb/tbb/0001-Fix-suppress-new-GCC-12-13- new file +7 -0
++!__clang__ && !__INTEL_COMPILER #pragma GCC diagnostic pop #endif
+             }
+         }
+
+--
+2.43.0
+
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +0 -0
index f834726bd6..318cd87643 100644

meta-oe/recipes-support/tbb/tbb_2021.11.0.bb BRANCH = "onetbb_2021" · line 17

Quoted 2 lines
meta-oe/recipes-support/tbb/tbb_2021.11.0.bb +0 -0
@@ -16,6 +16,7 @@ BRANCH = "onetbb_2021"
 SRCREV = "8b829acc65569019edb896c5150d427f288e8aba"
 SRC_URI = "git://github.com/oneapi-

src/oneTBB.git;protocol=https;branch=${BRANCH} \

Quoted 22 lines

file://0001-hwloc_detection.cmake-remove-cross-compiation-check.patch \
+
+ file://0001-Fix-suppress-new-GCC-12-13-warnings-1192.patch \
"
S = "${WORKDIR}/git"

--
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#112495):
https://lists.openembedded.org/g/openembedded-devel/message/112495
Mute This Topic: https://lists.openembedded.org/mt/108644971/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-