diff --git a/fix-build-error.patch b/fix-build-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..5198d2d7997a857f97e70cd15eec5383f95016b6 --- /dev/null +++ b/fix-build-error.patch @@ -0,0 +1,45 @@ +From 75ea0b31477d6ba9e990e296bbbd8ca4e7eebadf Mon Sep 17 00:00:00 2001 +From: Christian Sigg +Date: Fri, 26 Jun 2020 05:08:10 -0700 +Subject: [PATCH] Provide overload to cope with const-ness change of NumPy's + PyUFuncGenericFunction. + +See https://github.com/tensorflow/tensorflow/issues/40688, https://github.com/tensorflow/tensorflow/pull/40654. + +PiperOrigin-RevId: 318452381 +Change-Id: Icc5152f2b020ef19882a49e3c86ac80bbe048d64 +--- + tensorflow/python/lib/core/bfloat16.cc | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/tensorflow/python/lib/core/bfloat16.cc b/tensorflow/python/lib/core/bfloat16.cc +index feb01f11a1af2..bb6b720febe59 100644 +--- a/tensorflow/python/lib/core/bfloat16.cc ++++ b/tensorflow/python/lib/core/bfloat16.cc +@@ -517,7 +517,7 @@ bool RegisterBfloat16Cast(int numpy_type, bool cast_is_safe) { + } + + template +-void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps, ++void BinaryUFunc(char** args, const npy_intp* dimensions, const npy_intp* steps, + void* data) { + const char* i0 = args[0]; + const char* i1 = args[1]; +@@ -532,11 +532,17 @@ void BinaryUFunc(char** args, npy_intp* dimensions, npy_intp* steps, + } + } + ++// Numpy changed const-ness of PyUFuncGenericFunction, provide overload. + template + void CompareUFunc(char** args, npy_intp* dimensions, npy_intp* steps, + void* data) { + BinaryUFunc(args, dimensions, steps, data); + } ++template ++void CompareUFunc(char** args, const npy_intp* dimensions, ++ const npy_intp* steps, void* data) { ++ BinaryUFunc(args, dimensions, steps, data); ++} + + struct Bfloat16EqFunctor { + npy_bool operator()(bfloat16 a, bfloat16 b) { return a == b; } diff --git a/tensorflow.spec b/tensorflow.spec index 49af647ddde8852ff24b149afa3c8592426d0163..2b3e133b129416458c80e80694c7dc33988b264e 100644 --- a/tensorflow.spec +++ b/tensorflow.spec @@ -1,7 +1,7 @@ %global _empty_manifest_terminate_build 0 Name: tensorflow Version: 2.3.1 -Release: 12 +Release: 13 Summary: An Open Source Machine Learning Framework for Everyone License: Apache License 2.0 URL: https://www.tensorflow.org/ @@ -191,6 +191,7 @@ Patch0179: CVE-2021-37690-3.patch Patch0180: CVE-2021-41210.patch Patch0181: CVE-2021-41219.patch Patch0182: CVE-2021-41223.patch +Patch0183: fix-build-error.patch Requires: python3-future Requires: python3-numpy @@ -231,17 +232,17 @@ bazel --output_user_root=`pwd`/../output_user_root build --host_copt=-Wno-string %install %py3_install_wheel * -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/libtensorflow_framework.so.2 -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/core/kernels/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/python/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/python/autograph/impl/testing/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/python/profiler/internal/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/python/data/experimental/service/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/compiler/tf2xla/ops/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/compiler/tf2tensorrt/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/lite/python/optimize/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/lite/python/interpreter_wrapper/*.so -chrpath -d %{buildroot}%{_libdir}/python3.8/site-packages/tensorflow/lite/experimental//microfrontend/python/ops/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/libtensorflow_framework.so.2 +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/core/kernels/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/python/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/python/autograph/impl/testing/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/python/profiler/internal/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/python/data/experimental/service/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/compiler/tf2xla/ops/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/compiler/tf2tensorrt/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/lite/python/optimize/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/lite/python/interpreter_wrapper/*.so +chrpath -d %{buildroot}%{_libdir}/python3.9/site-packages/tensorflow/lite/experimental//microfrontend/python/ops/*.so mkdir -p %{buildroot}/etc/ld.so.conf.d echo "%{_libdir}/openmpi/lib" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.conf @@ -259,6 +260,9 @@ echo "%{_libdir}/openmpi/lib" > %{buildroot}/etc/ld.so.conf.d/%{name}-%{_arch}.c %changelog +* Mon Feb 14 2022 wangkai - 2.3.1-13 +- fix build error + * Wed Nov 10 2021 houyingchao - 2.3.1-12 - Fix CVE-2021-41210 CVE-2021-41219 CVE-2021-41223