* [PATCH] test: fix soring build with LTO
@ 2026-11-10 2:04 Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2026-11-10 2:04 UTC (permalink / raw)
To: dev; +Cc: Stephen Hemminger, Eimear Morrissey, Konstantin Ananyev
With LTO, gcc inlines rte_soring_acquirx_bulk() into
test_soring_stages(). The element copy switches on the runtime
r->esize, so the 16-byte copy path stays live and gcc reports
-Wstringop-overflow writing into the 32 x uint32_t stack arrays.
That path is never taken since the ring is created with 4 byte
elements and metadata.
The diagnostic is emitted by lto1 at link time, so it cannot be
silenced from lib/ring. Disable it for the dpdk-test link only when
LTO is enabled with gcc; non-LTO builds are unchanged.
Bugzilla ID: 2101
Fixes: 70581c355d69 ("test/ring: add unit tests for soring API")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
app/test/meson.build | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/app/test/meson.build b/app/test/meson.build
index 2f1cd817cd..d16ca9f287 100644
--- a/app/test/meson.build
+++ b/app/test/meson.build
@@ -277,6 +277,12 @@ extra_flags = [
'-fno-strict-aliasing',
]
+# LTO inlines soring acquire into the test, gcc then flags the
+# unreachable 16-byte element copy path (false positive).
+if get_option('b_lto') and cc.get_id() == 'gcc'
+ ldflags += '-Wno-stringop-overflow'
+endif
+
foreach arg: extra_flags
if cc.has_argument(arg)
cflags += arg
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-10 2:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10 2:04 [PATCH] test: fix soring build with LTO Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox