From 42b59db319b9deb56ad6b4660430a7e7807dadf9 Mon Sep 17 00:00:00 2001 From: laokz Date: Fri, 6 Oct 2023 11:51:44 +0800 Subject: [PATCH] riscv64: Workaround -Wstringop-truncation error On riscv64, the compiler complained: In file included from /usr/include/string.h:548, from omxregister.c:42: In function 'strncpy', inlined from 'showComponentsList' at omxregister.c:110:3, inlined from 'main' at omxregister.c:463:9: /usr/include/bits/string_fortified.h:95:10: error: '__builtin_strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] 95 | return __builtin___strncpy_chk (__dest, __src, __len, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 | __glibc_objsize (__dest)); | ~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors It seems that the -O optimization to generate arch assemblies leads to different behavior between riscv and arm, x86. Add -Wno-stringop-truncation CFLAGS to workaround the problem. --- libomxil-bellagio.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libomxil-bellagio.spec b/libomxil-bellagio.spec index 7cbff4a..a6b1587 100644 --- a/libomxil-bellagio.spec +++ b/libomxil-bellagio.spec @@ -1,6 +1,6 @@ Name: libomxil-bellagio Version: 0.9.3 -Release: 23 +Release: 24 Summary: OpenMAX Integration Layer License: LGPLv2+ URL: http://omxil.sourceforge.net @@ -50,6 +50,9 @@ autoreconf -vif %build +%ifarch riscv64 +export CFLAGS="$CFLAGS -Wno-stringop-truncation" +%endif %configure --disable-static sed -i.rpath 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool @@ -101,6 +104,9 @@ install -pm 0755 test/components/resource_manager/.libs/{omxprioritytest,omxrmte %changelog +* Sat Oct 07 2023 laokz - 0.9.3-24 +- Workaround -Wstringop-truncation error for riscv64 + * Sat Jul 15 2023 yaoxin - 0.9.3-23 - Fix build failure caused by gcc upgrade to 12.3.1