From 656a62a8968d58bd25f999845053724879f3547b5538ffafc5e97dac58b6f860 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 6 Jun 2024 08:30:34 +0000 Subject: [PATCH] Accepting request 1178479 from home:jamborm:gcc14fixes - GCC 14 started to advertise c_atomic extension, older versions didn't do that. Add check for __clang__, so GCC doesn't include headers designed for Clang (openvswitch-2.17.8-gcc14-build-fix.patch) [boo#1225906] OBS-URL: https://build.opensuse.org/request/show/1178479 OBS-URL: https://build.opensuse.org/package/show/network/openvswitch?expand=0&rev=259 --- openvswitch-2.17.8-gcc14-build-fix.patch | 38 ++++++++++++++++++++++++ openvswitch.changes | 8 +++++ openvswitch.spec | 7 +++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 openvswitch-2.17.8-gcc14-build-fix.patch diff --git a/openvswitch-2.17.8-gcc14-build-fix.patch b/openvswitch-2.17.8-gcc14-build-fix.patch new file mode 100644 index 0000000..e496389 --- /dev/null +++ b/openvswitch-2.17.8-gcc14-build-fix.patch @@ -0,0 +1,38 @@ +From 335a5deac3ff91448ca14651e92f39dfdd512fcf Mon Sep 17 00:00:00 2001 +From: Ilya Maximets +Date: Thu, 18 Jan 2024 15:59:05 +0100 +Subject: [PATCH] ovs-atomic: Fix inclusion of Clang header by GCC 14. + +GCC 14 started to advertise c_atomic extension, older versions didn't +do that. Add check for __clang__, so GCC doesn't include headers +designed for Clang. + +Another option would be to prefer stdatomic implementation instead, +but some older versions of Clang are not able to use stdatomic.h +supplied by GCC as described in commit: + 07ece367fb5f ("ovs-atomic: Prefer Clang intrinsics over .") + +This change fixes OVS build with GCC on Fedora Rawhide (40). + +Reported-by: Jakob Meng +Acked-by: Jakob Meng +Acked-by: Eelco Chaudron +Acked-by: Simon Horman +Signed-off-by: Ilya Maximets +--- + lib/ovs-atomic.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h +index ab9ce6b2e0f..f140d25feba 100644 +--- a/lib/ovs-atomic.h ++++ b/lib/ovs-atomic.h +@@ -328,7 +328,7 @@ + #if __CHECKER__ + /* sparse doesn't understand some GCC extensions we use. */ + #include "ovs-atomic-pthreads.h" +- #elif __has_extension(c_atomic) ++ #elif __clang__ && __has_extension(c_atomic) + #include "ovs-atomic-clang.h" + #elif HAVE_ATOMIC && __cplusplus >= 201103L + #include "ovs-atomic-c++.h" diff --git a/openvswitch.changes b/openvswitch.changes index 14c8f1a..696428c 100644 --- a/openvswitch.changes +++ b/openvswitch.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Jun 4 09:48:39 UTC 2024 - Martin Jambor + +- GCC 14 started to advertise c_atomic extension, older versions + didn't do that. Add check for __clang__, so GCC doesn't include + headers designed for Clang + (openvswitch-2.17.8-gcc14-build-fix.patch) [boo#1225906] + ------------------------------------------------------------------- Mon Feb 26 12:38:17 UTC 2024 - Dominique Leuenberger diff --git a/openvswitch.spec b/openvswitch.spec index b580a14..23bd158 100644 --- a/openvswitch.spec +++ b/openvswitch.spec @@ -83,6 +83,8 @@ Patch5: CVE-2023-1668.patch Patch6: CVE-2023-5366.patch # Fix CVE-2023-3966 [bsc#1219465] -- Invalid memory access in Geneve with HW offload Patch7: openvswitch-CVE-2023-3966.patch +# boo#1225906: Restore build with gcc14 +Patch8: openvswitch-2.17.8-gcc14-build-fix.patch #OVN patches # PATCH-FIX-OPENSUSE: 0001-Run-ovn-as-openvswitch-openvswitch.patch Patch20: 0001-Run-ovn-as-openvswitch-openvswitch.patch @@ -133,9 +135,9 @@ BuildRequires: openssl-devel BuildRequires: python3-rpm-macros BuildRequires: systemd-units Requires(post): systemd-units -Requires(postun):systemd-units +Requires(postun): systemd-units Requires(pre): shadow-utils -Requires(preun):systemd-units +Requires(preun): systemd-units %endif # Needed by the testsuite %if %{with check} @@ -425,6 +427,7 @@ Devel libraries and headers for Open Virtual Network. %patch -P 5 -p1 %patch -P 6 -p1 %patch -P 7 -p1 +%patch -P 8 -p1 # remove python/ovs/dirs.py - this is generated from template to have proper paths rm python/ovs/dirs.py cd %{ovn_dir}