From 1d6142becf1d0b5c99be399ba49d5358834c47d0 Mon Sep 17 00:00:00 2001 From: Lin Jiaxin Date: Fri, 6 Aug 2021 10:54:43 +0800 Subject: [PATCH] fix compile problem Modify points: 1. add --host_copt=-Wno-stringop-truncation why: Workaround for gcc 10+ warnings related to upb. See https://github.com/tensorflow/tensorflow/issues/39467 2. add fix_compile.patch error message: Execution platform: @local_execution_config_platform//:platform tensorflow/core/kernels/sparse_tensors_map_ops.cc:358:18: error: expected constructor, destructor, or type conversion before '(' token 358 | TF_CALL_ALL_TYPES(REGISTER_KERNELS); | ^ tensorflow/core/kernels/sparse_tensors_map_ops.cc:516:18: error: expected constructor, destructor, or type conversion before '(' token 516 | TF_CALL_ALL_TYPES(REGISTER_KERNELS); | ^ Target //tensorflow/tools/pip_package:build_pip_package failed to build ERROR: /home/abuild/rpmbuild/BUILD/tensorflow-2.3.1/tensorflow/python/tools/BUILD:143:10 C++ compilation of rule '//tensorflow/core/kernels:sparse_tensors_map_ops' failed (Exit 1): gcc failed: error executing command --- fix_compile.patch | 11 +++++++++++ tensorflow.spec | 9 +++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 fix_compile.patch diff --git a/fix_compile.patch b/fix_compile.patch new file mode 100644 index 0000000..1859cb2 --- /dev/null +++ b/fix_compile.patch @@ -0,0 +1,11 @@ +--- a/tensorflow/core/kernels/sparse_tensors_map_ops.cc 2021-08-05 09:54:10.591394528 +0800 ++++ b/tensorflow/core/kernels/sparse_tensors_map_ops.cc 2021-08-05 12:22:51.148694390 +0800 +@@ -21,6 +21,8 @@ + #include + #include + ++#include "tensorflow/core/framework/op_kernel.h" ++#include "tensorflow/core/framework/register_types.h" + #include "tensorflow/core/framework/resource_mgr.h" + #include "tensorflow/core/framework/tensor.h" + #include "tensorflow/core/framework/tensor_util.h" diff --git a/tensorflow.spec b/tensorflow.spec index 2c308c5..8068f99 100644 --- a/tensorflow.spec +++ b/tensorflow.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: tensorflow Version: 2.3.1 -Release: 4 +Release: 5 Summary: An Open Source Machine Learning Framework for Everyone License: Apache License 2.0 URL: https://www.tensorflow.org/ @@ -14,6 +14,7 @@ Patch0002: CVE-2021-29538.patch Patch0003: CVE-2021-29535.patch Patch0004: CVE-2021-29566.patch Patch0005: CVE-2021-29534.patch +Patch0006: fix_compile.patch Requires: python3-future Requires: python3-numpy @@ -49,7 +50,7 @@ ln -sfn $(find ${extdir}/../install -maxdepth 2 -name platforms) ${extdir}/exter rm -rf ${extdir}/external/local_config* %build -bazel --output_user_root=`pwd`/../output_user_root build //tensorflow/tools/pip_package:build_pip_package +bazel --output_user_root=`pwd`/../output_user_root build --host_copt=-Wno-stringop-truncation //tensorflow/tools/pip_package:build_pip_package ./bazel-bin/tensorflow/tools/pip_package/build_pip_package dist %install @@ -60,6 +61,10 @@ bazel --output_user_root=`pwd`/../output_user_root build //tensorflow/tools/pip_ %{_bindir}/* %changelog +* Fri Aug 06 2021 linjiaxin5 - 2.3.1-5 +- Fix failure caused by GCC upgrade to 10 +- add patch fix_compile.patch + * Mon Jun 28 2021 polite2anyone - 2.3.1-4 - Add patch CVE-2021-29534 -- Gitee