patch 'build: force GCC 15 to initialize padding bits' has been queued to stable release 23.11.4
Xueming Li
xuemingl at nvidia.com
Tue Feb 18 13:34:33 CET 2025
Hi,
FYI, your patch has been queued to stable release 23.11.4
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
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://git.dpdk.org/dpdk-stable/log/?h=23.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/commit/?h=23.11-staging&id=9fa42e1aec84ff057805160f38ee1537e74608b0
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 9fa42e1aec84ff057805160f38ee1537e74608b0 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
Cc: Xueming Li <xuemingl at nvidia.com>
[ 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 | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/config/meson.build b/config/meson.build
index 898b719929..394d612924 100644
--- a/config/meson.build
+++ b/config/meson.build
@@ -303,7 +303,7 @@ endif
# enable extra warnings and disable any unwanted warnings
# -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',
'-Wdeprecated',
@@ -324,22 +324,25 @@ warning_flags = [
'-Wno-address-of-packed-member',
'-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 cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
# FIXME: Bugzilla 396
- warning_flags += '-Wno-zero-length-bounds'
+ global_cflags += '-Wno-zero-length-bounds'
endif
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')
endif
--
2.34.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2025-02-18 19:39:02.089365896 +0800
+++ 0038-build-force-GCC-15-to-initialize-padding-bits.patch 2025-02-18 19:39:00.548244061 +0800
@@ -1 +1 @@
-From 3c015da37afecbeaa7c9ebf8cf2adcb20ab0e54d Mon Sep 17 00:00:00 2001
+From 9fa42e1aec84ff057805160f38ee1537e74608b0 Mon Sep 17 00:00:00 2001
@@ -7,0 +8,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 3c015da37afecbeaa7c9ebf8cf2adcb20ab0e54d ]
@@ -20,2 +22,0 @@
-Cc: stable at dpdk.org
-
@@ -26,2 +27,2 @@
- config/meson.build | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
+ config/meson.build | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
@@ -30 +31 @@
-index 710206095b..f31fef216c 100644
+index 898b719929..394d612924 100644
@@ -33 +34 @@
-@@ -310,7 +310,7 @@ endif
+@@ -303,7 +303,7 @@ endif
@@ -42,2 +43,2 @@
-@@ -330,16 +330,19 @@ warning_flags = [
- # globally disabled warnings
+@@ -324,22 +324,25 @@ warning_flags = [
+ '-Wno-address-of-packed-member',
@@ -50 +51,5 @@
-
+ if cc.get_id() == 'gcc' and cc.version().version_compare('>=10.0')
+ # FIXME: Bugzilla 396
+- warning_flags += '-Wno-zero-length-bounds'
++ global_cflags += '-Wno-zero-length-bounds'
+ endif
@@ -63,5 +67,0 @@
-
-@@ -351,7 +354,7 @@ if cc.has_argument('-Wvla')
- endif
- endif
-
More information about the stable
mailing list