summaryrefslogtreecommitdiff
path: root/net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch')
-rw-r--r--net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch b/net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch
new file mode 100644
index 000000000000..6a439dc0544a
--- /dev/null
+++ b/net-misc/openvswitch/files/openvswitch-2.17.8-gcc14-build-fix.patch
@@ -0,0 +1,32 @@
+https://github.com/openvswitch/ovs/commit/335a5deac3ff91448ca14651e92f39dfdd512fcf.patch
+From: Ilya Maximets <i.maximets@ovn.org>
+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 <stdatomic.h>.")
+
+This change fixes OVS build with GCC on Fedora Rawhide (40).
+
+Reported-by: Jakob Meng <code@jakobmeng.de>
+Acked-by: Jakob Meng <jmeng@redhat.com>
+Acked-by: Eelco Chaudron <echaudro@redhat.com>
+Acked-by: Simon Horman <horms@ovn.org>
+Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
+--- 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"