[spec] Update CFLAGS to fix the buildbreak issue on GCC v13 13/294213/1
authorSangjung Woo <sangjung.woo@samsung.com>
Wed, 14 Jun 2023 08:29:15 +0000 (17:29 +0900)
committerSangjung Woo <sangjung.woo@samsung.com>
Wed, 14 Jun 2023 08:29:15 +0000 (17:29 +0900)
To fix the buildbreak issue on gcc 11 or higher, this patch adds
'-Wno-error=stringop-overflow' option to CFLAGS and CXXFLAGS.

Change-Id: I16cec441e37e4ac070ed49666bb7dcb09f87c1a2
Signed-off-by: Sangjung Woo <sangjung.woo@samsung.com>
packaging/add-stdint.h-for-int-types-in-internal.patch [new file with mode: 0644]
packaging/tensorflow.spec

diff --git a/packaging/add-stdint.h-for-int-types-in-internal.patch b/packaging/add-stdint.h-for-int-types-in-internal.patch
new file mode 100644 (file)
index 0000000..bf4768b
--- /dev/null
@@ -0,0 +1,24 @@
+From 9dbee4329ffd0474b939927f6d337959fb72318a Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Fri, 31 Mar 2023 16:01:44 +0000
+Subject: [PATCH] tflite: add stdint.h for int types in internal::Spectrogram
+
+---
+ tensorflow/lite/kernels/internal/spectrogram.cc | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tensorflow/lite/kernels/internal/spectrogram.cc b/tensorflow/lite/kernels/internal/spectrogram.cc
+index a832962a38d..919eebeb3e7 100644
+--- a/tensorflow/lite/kernels/internal/spectrogram.cc
++++ b/tensorflow/lite/kernels/internal/spectrogram.cc
+@@ -17,6 +17,7 @@ limitations under the License.
+ #include <assert.h>
+ #include <math.h>
++#include <stdint.h>
+ #include "third_party/fft2d/fft.h"
+-- 
+2.25.1
+
index 2658d8f9a537058c267c3fe9a9518274ee261fc8..a1a89c3a0e3d864d1fd4f5a7f0c36d81babd7c3a 100644 (file)
@@ -13,6 +13,7 @@ Source10050:    fft2d.tar.gz
 Source10060:    gemmlowp.tar.gz
 
 # Security vulnerability patch
+Patch1000:      add-stdint.h-for-int-types-in-internal.patch
 Patch1001:      CVE-2020-15266.patch
 Patch1002:      CVE-2020-15265.patch
 Patch1003:      CVE-2020-26267.patch
@@ -63,6 +64,7 @@ Tensorflow-Lite Flatbuffer schema file
 
 cp %{SOURCE1001} .
 
+%patch1000 -p1
 %patch1001 -p1
 %patch1002 -p1
 %patch1003 -p1
@@ -130,6 +132,10 @@ CFLAGS="${CFLAGS} -fno-lto"
 CXXFLAGS="${CXXFLAGS} -fno-lto"
 %endif
 
+# To fix the buildbreak issue on gcc 11 or higher, '-Wno-error=stringop-overflow' option is added to CFLAGS and CXXFLAGS.
+CFLAGS="${CFLAGS} -Wno-error=stringop-overflow"
+CXXFLAGS="${CXXFLAGS} -Wno-error=stringop-overflow"
+
 cp %{SOURCE1002} .
 gcc gcc_version_check.c -Wno-error=class-memaccess && export CFLAGS="$CFLAGS -Wno-error=class-memaccess" && export CXXFLAGS="$CXXFLAGS -Wno-error=class-memaccess" && echo "Applying Wno-error=class-memaccess"|| echo "OLD GCC. Don't Add Wno-error=class-memaccess"