From: Sangjung Woo Date: Wed, 14 Jun 2023 08:29:15 +0000 (+0900) Subject: [spec] Update CFLAGS to fix the buildbreak issue on GCC v13 X-Git-Tag: accepted/tizen/unified/dev/20230726.115413~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6ea7c27e452ff5976df203032754ac754d5380b;p=platform%2Fupstream%2Ftensorflow.git [spec] Update CFLAGS to fix the buildbreak issue on GCC v13 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 --- 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 index 0000000000..bf4768bad6 --- /dev/null +++ b/packaging/add-stdint.h-for-int-types-in-internal.patch @@ -0,0 +1,24 @@ +From 9dbee4329ffd0474b939927f6d337959fb72318a Mon Sep 17 00:00:00 2001 +From: Stephan Hartmann +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 + #include ++#include + + #include "third_party/fft2d/fft.h" + +-- +2.25.1 + diff --git a/packaging/tensorflow.spec b/packaging/tensorflow.spec index 2658d8f9a5..a1a89c3a0e 100644 --- a/packaging/tensorflow.spec +++ b/packaging/tensorflow.spec @@ -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"