patch 'build: force GCC 15 to initialize padding bits' has been queued to stable release 24.11.2

Kevin Traynor ktraynor at redhat.com
Thu Feb 13 10:58:27 CET 2025


Hi,

FYI, your patch has been queued to stable release 24.11.2

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/17/25. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/f6dc4ee6b4ae3eb4f28e2afb97d6d08cede0558b

Thanks.

Kevin

---
>From f6dc4ee6b4ae3eb4f28e2afb97d6d08cede0558b Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Fri, 24 Jan 2025 10:26:48 -0800
Subject: [PATCH] build: force GCC 15 to initialize padding bits
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

[ upstream commit 3c015da37afecbeaa7c9ebf8cf2adcb20ab0e54d ]

With GCC 15, the compiler has changed the default behavior when
initialization is used for aggregate variables. The new default
is to follow the standard (C23) and not initialize everything by
default. This breaks assumptions in some drivers and can be
lead to other bugs. Use the new zero initialization flag to
force of all fields to zero.

Note: other compilers always initialize to zero in these cases.
Only GCC seems to have decided to start initializing less as
a silly attempt at optimization.

Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Morten Brørup <mb at smartsharesystems.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 config/meson.build | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/config/meson.build b/config/meson.build
index 6aaad6d8a4..b6b3558e11 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -311,5 +311,5 @@ endif
 # -Wall is added by default at warning level 1, and -Wextra
 # at warning level 2 (DPDK default)
-warning_flags = [
+global_cflags = [
         # additional warnings in alphabetical order
         '-Wcast-qual',
@@ -331,17 +331,20 @@ warning_flags = [
         '-Wno-packed-not-aligned',
         '-Wno-missing-field-initializers',
+
+        # guarantee that all non-initialized parts of structure/union are zero
+        '-fzero-init-padding-bits=all',
 ]
 
 if not dpdk_conf.get('RTE_ARCH_64')
 # for 32-bit, don't warn about casting a 32-bit pointer to 64-bit int - it's fine!!
-    warning_flags += '-Wno-pointer-to-int-cast'
+    global_cflags += '-Wno-pointer-to-int-cast'
 endif
 if cc.get_id() == 'intel'
     warning_ids = [181, 188, 2203, 2279, 2557, 3179, 3656]
     foreach i:warning_ids
-        warning_flags += '-diag-disable=@0@'.format(i)
+        global_cflags += '-diag-disable=@0@'.format(i)
     endforeach
 endif
-foreach arg: warning_flags
+foreach arg: global_cflags
     if cc.has_argument(arg)
         add_project_arguments(arg, language: 'c')
-- 
2.48.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2025-02-12 17:29:40.898458398 +0000
+++ 0060-build-force-GCC-15-to-initialize-padding-bits.patch	2025-02-12 17:29:34.383946127 +0000
@@ -1 +1 @@
-From 3c015da37afecbeaa7c9ebf8cf2adcb20ab0e54d Mon Sep 17 00:00:00 2001
+From f6dc4ee6b4ae3eb4f28e2afb97d6d08cede0558b Mon Sep 17 00:00:00 2001
@@ -8,0 +9,2 @@
+[ upstream commit 3c015da37afecbeaa7c9ebf8cf2adcb20ab0e54d ]
+
@@ -20,2 +21,0 @@
-Cc: stable at dpdk.org
-
@@ -30 +30 @@
-index 710206095b..f31fef216c 100644
+index 6aaad6d8a4..b6b3558e11 100644
@@ -40 +40 @@
-@@ -331,14 +331,17 @@ warning_flags = [
+@@ -331,17 +331,20 @@ warning_flags = [
@@ -60,3 +59,0 @@
-@@ -352,5 +355,5 @@ if cc.has_argument('-Wvla')
- endif
- 



More information about the stable mailing list