From 7e7e73f680fd69a1492df948f4bca966bca3632a9c98014a9bba99b10983a424 Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Wed, 22 Mar 2023 08:09:38 +0000 Subject: [PATCH 1/3] Accepting request 1073702 from home:Guillaume_G:branches:science:machinelearning - Add patch to fix build with GCC13: * armnn-fix-gcc13.patch OBS-URL: https://build.opensuse.org/request/show/1073702 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/armnn?expand=0&rev=70 --- armnn-fix-gcc13.patch | 50 +++++++++++++++++++++++++++++++++++++++++++ armnn.changes | 6 ++++++ armnn.spec | 3 +++ 3 files changed, 59 insertions(+) create mode 100644 armnn-fix-gcc13.patch diff --git a/armnn-fix-gcc13.patch b/armnn-fix-gcc13.patch new file mode 100644 index 0000000..f98d986 --- /dev/null +++ b/armnn-fix-gcc13.patch @@ -0,0 +1,50 @@ +--- armnn-23.02/src/armnnUtils/VerificationHelpers.hpp.orig 2023-03-21 11:42:43.586421589 +0100 ++++ armnn-23.02/src/armnnUtils/VerificationHelpers.hpp 2023-03-21 11:42:58.738601283 +0100 +@@ -7,6 +7,7 @@ + #include + + #include ++#include + + namespace armnnUtils + { +--- armnn-23.02/profiling/client/include/CounterIdMap.hpp.orig 2023-03-21 12:03:05.672831589 +0100 ++++ armnn-23.02/profiling/client/include/CounterIdMap.hpp 2023-03-21 12:03:18.292980107 +0100 +@@ -6,6 +6,7 @@ + + #include + #include ++#include + + namespace arm + { +--- armnn-23.02/profiling/common/include/Counter.hpp.orig 2023-03-21 13:14:21.926470002 +0100 ++++ armnn-23.02/profiling/common/include/Counter.hpp 2023-03-21 13:14:32.046586851 +0100 +@@ -6,6 +6,7 @@ + #pragma once + + #include ++#include + + namespace arm + { +--- armnn-23.02/profiling/client/src/Holder.cpp.orig 2023-03-21 13:28:41.724376732 +0100 ++++ armnn-23.02/profiling/client/src/Holder.cpp 2023-03-21 13:28:55.772538587 +0100 +@@ -4,6 +4,7 @@ + // + + #include ++#include + + namespace arm + { +--- armnn-23.02/profiling/client/include/Holder.hpp.orig 2023-03-21 14:36:13.377591628 +0100 ++++ armnn-23.02/profiling/client/include/Holder.hpp 2023-03-21 14:36:31.325798921 +0100 +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + namespace arm + { diff --git a/armnn.changes b/armnn.changes index 83b2de8..7e0c5f3 100644 --- a/armnn.changes +++ b/armnn.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Mar 21 10:45:26 UTC 2023 - Guillaume GARDET + +- Add patch to fix build with GCC13: + * armnn-fix-gcc13.patch + ------------------------------------------------------------------- Wed Mar 15 09:03:42 UTC 2023 - Guillaume GARDET diff --git a/armnn.spec b/armnn.spec index 1b76208..2c427a9 100644 --- a/armnn.spec +++ b/armnn.spec @@ -79,6 +79,8 @@ Group: Development/Libraries/Other URL: https://developer.arm.com/products/processors/machine-learning/arm-nn Source0: https://github.com/ARM-software/armnn/archive/v%{version}.tar.gz#/armnn-%{version}.tar.gz Source1: armnn-rpmlintrc +# PATCH-FIX-UPSTREAM - https://github.com/ARM-software/armnn/issues/723 +Patch1: armnn-fix-gcc13.patch # PATCHES to add downstream ArmnnExamples binary - https://layers.openembedded.org/layerindex/recipe/87610/ Patch200: 0003-add-more-test-command-line-arguments.patch Patch201: 0005-add-armnn-mobilenet-test-example.patch @@ -372,6 +374,7 @@ This package contains the libarmnnOnnxParser library from armnn. %prep %setup -q -n armnn-%{version} +%patch1 -p1 %if %{with armnn_extra_tests} %patch200 -p1 %patch201 -p1 From 0b06e7426e587d99a179bd17fb2c094b94d3c8e4eca43a8c241b99d3b58755e5 Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Wed, 5 Apr 2023 06:30:22 +0000 Subject: [PATCH 2/3] Accepting request 1077421 from home:Guillaume_G:branches:science:machinelearning - Update armnn-fix-gcc13.patch with upstream patch OBS-URL: https://build.opensuse.org/request/show/1077421 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/armnn?expand=0&rev=71 --- armnn-fix-gcc13.patch | 124 +++++++++++++++++++++++++++++------------- armnn.changes | 5 ++ 2 files changed, 91 insertions(+), 38 deletions(-) diff --git a/armnn-fix-gcc13.patch b/armnn-fix-gcc13.patch index f98d986..0359647 100644 --- a/armnn-fix-gcc13.patch +++ b/armnn-fix-gcc13.patch @@ -1,50 +1,98 @@ ---- armnn-23.02/src/armnnUtils/VerificationHelpers.hpp.orig 2023-03-21 11:42:43.586421589 +0100 -+++ armnn-23.02/src/armnnUtils/VerificationHelpers.hpp 2023-03-21 11:42:58.738601283 +0100 -@@ -7,6 +7,7 @@ - #include - - #include -+#include - - namespace armnnUtils +From 4746ab11be5a8558a54c21142800abaa30efc3a6 Mon Sep 17 00:00:00 2001 +From: Pablo Marquez Tello +Date: Fri, 31 Mar 2023 15:57:43 +0100 +Subject: [PATCH] Fix gcc 13 compiler errors + +* Resolves MLCE-1040 + +Change-Id: I32878ed70af356832403e83dcb63b0b89a8a84e3 +Signed-off-by: Pablo Marquez Tello +--- + +diff --git a/include/armnn/utility/TransformIterator.hpp b/include/armnn/utility/TransformIterator.hpp +index f65ac79..b038447 100644 +--- a/include/armnn/utility/TransformIterator.hpp ++++ b/include/armnn/utility/TransformIterator.hpp +@@ -1,5 +1,5 @@ + // +-// Copyright © 2020 Arm Ltd and Contributors. All rights reserved. ++// Copyright © 2020,2023 Arm Ltd and Contributors. All rights reserved. + // SPDX-License-Identifier: MIT + // + #pragma once +@@ -18,10 +18,15 @@ + typename Reference = + typename std::result_of::reference)>::type + > +-class TransformIterator : public std::iterator ++class TransformIterator { ---- armnn-23.02/profiling/client/include/CounterIdMap.hpp.orig 2023-03-21 12:03:05.672831589 +0100 -+++ armnn-23.02/profiling/client/include/CounterIdMap.hpp 2023-03-21 12:03:18.292980107 +0100 -@@ -6,6 +6,7 @@ +- + public: ++ using iterator_category = Category; ++ using value_type = T; ++ using difference_type = Distance; ++ using pointer = Pointer; ++ using reference = Reference; ++ - #include - #include -+#include + TransformIterator() = default; + TransformIterator(TransformIterator const& transformIterator) = default; +@@ -83,4 +88,4 @@ + return TransformIterator(i, f); + } - namespace arm - { ---- armnn-23.02/profiling/common/include/Counter.hpp.orig 2023-03-21 13:14:21.926470002 +0100 -+++ armnn-23.02/profiling/common/include/Counter.hpp 2023-03-21 13:14:32.046586851 +0100 -@@ -6,6 +6,7 @@ +-} +\ No newline at end of file ++} +diff --git a/profiling/client/include/CounterIdMap.hpp b/profiling/client/include/CounterIdMap.hpp +index cce7184..45cad7b 100644 +--- a/profiling/client/include/CounterIdMap.hpp ++++ b/profiling/client/include/CounterIdMap.hpp +@@ -1,9 +1,10 @@ + // +-// Copyright © 2020 Arm Ltd. All rights reserved. ++// Copyright © 2020,2023 Arm Ltd and Contributors. All rights reserved. + // SPDX-License-Identifier: MIT + // #pragma once - #include +#include + #include + #include - namespace arm - { ---- armnn-23.02/profiling/client/src/Holder.cpp.orig 2023-03-21 13:28:41.724376732 +0100 -+++ armnn-23.02/profiling/client/src/Holder.cpp 2023-03-21 13:28:55.772538587 +0100 -@@ -4,6 +4,7 @@ +diff --git a/profiling/common/include/Counter.hpp b/profiling/common/include/Counter.hpp +index ff96d25..4ddc89b 100644 +--- a/profiling/common/include/Counter.hpp ++++ b/profiling/common/include/Counter.hpp +@@ -1,10 +1,11 @@ + // +-// Copyright © 2022 Arm Ltd. All rights reserved. ++// Copyright © 2022,2023 Arm Ltd and Contributors. All rights reserved. + // SPDX-License-Identifier: MIT // - #include -+#include + #pragma once + ++#include + #include namespace arm - { ---- armnn-23.02/profiling/client/include/Holder.hpp.orig 2023-03-21 14:36:13.377591628 +0100 -+++ armnn-23.02/profiling/client/include/Holder.hpp 2023-03-21 14:36:31.325798921 +0100 -@@ -8,6 +8,7 @@ - #include - #include - #include -+#include +diff --git a/src/armnnUtils/VerificationHelpers.hpp b/src/armnnUtils/VerificationHelpers.hpp +index be09ba9..508cdc0 100644 +--- a/src/armnnUtils/VerificationHelpers.hpp ++++ b/src/armnnUtils/VerificationHelpers.hpp +@@ -1,11 +1,11 @@ + // +-// Copyright © 2017 Arm Ltd. All rights reserved. ++// Copyright © 2017,2023 Arm Ltd and Contributors. All rights reserved. + // SPDX-License-Identifier: MIT + // - namespace arm - { + #include + #include +- ++#include + #include + + namespace armnnUtils diff --git a/armnn.changes b/armnn.changes index 7e0c5f3..ff35eec 100644 --- a/armnn.changes +++ b/armnn.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Apr 5 06:06:27 UTC 2023 - Guillaume GARDET + +- Update armnn-fix-gcc13.patch with upstream patch + ------------------------------------------------------------------- Tue Mar 21 10:45:26 UTC 2023 - Guillaume GARDET From fd0141bad3858544cf18b4f43e8f8b6ee01ef5c83080ccb1ae2869f1fdcf0b50 Mon Sep 17 00:00:00 2001 From: Guillaume GARDET Date: Thu, 20 Apr 2023 13:15:14 +0000 Subject: [PATCH 3/3] Accepting request 1080887 from home:Guillaume_G:branches:science:machinelearning - Add additionnal gcc13 fixes: * 4cf40d7.diff * armnn-fix-gcc13-2.patch OBS-URL: https://build.opensuse.org/request/show/1080887 OBS-URL: https://build.opensuse.org/package/show/science:machinelearning/armnn?expand=0&rev=72 --- 4cf40d7.diff | 30 ++++++++++++++++++++++++++++++ armnn-fix-gcc13-2.patch | 10 ++++++++++ armnn.changes | 7 +++++++ armnn.spec | 5 +++++ 4 files changed, 52 insertions(+) create mode 100644 4cf40d7.diff create mode 100644 armnn-fix-gcc13-2.patch diff --git a/4cf40d7.diff b/4cf40d7.diff new file mode 100644 index 0000000..dfb1f0d --- /dev/null +++ b/4cf40d7.diff @@ -0,0 +1,30 @@ +From 4cf40d70f8e9da3184bb4c9b604db6a3b23d6533 Mon Sep 17 00:00:00 2001 +From: Teresa Charlin +Date: Thu, 20 Apr 2023 11:55:48 +0100 +Subject: [PATCH] GitHub #723 Fix Maybe uninitialized variable + + +Signed-off-by: Teresa Charlin +Change-Id: I70d3673bbb2dc113ac5eb6d63029a4a4a684e831 +--- + +diff --git a/include/armnn/backends/Workload.hpp b/include/armnn/backends/Workload.hpp +index be6fbd9..9f7aad0 100644 +--- a/include/armnn/backends/Workload.hpp ++++ b/include/armnn/backends/Workload.hpp +@@ -1,5 +1,5 @@ + // +-// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. ++// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. + // SPDX-License-Identifier: MIT + // + #pragma once +@@ -124,6 +124,8 @@ + + if (!info.m_InputTensorInfos.empty()) + { ++ expectedInputType = info.m_InputTensorInfos.front().GetDataType(); ++ + if (expectedOutputType != expectedInputType) + { + ARMNN_ASSERT_MSG(false, "Trying to create workload with incorrect type"); diff --git a/armnn-fix-gcc13-2.patch b/armnn-fix-gcc13-2.patch new file mode 100644 index 0000000..7817a2e --- /dev/null +++ b/armnn-fix-gcc13-2.patch @@ -0,0 +1,10 @@ +--- ./profiling/client/include/Holder.hpp.orig 2023-03-21 14:36:13.377591628 +0100 ++++ ./profiling/client/include/Holder.hpp 2023-03-21 14:36:31.325798921 +0100 +@@ -8,6 +8,7 @@ + #include + #include + #include ++#include + + namespace arm + { diff --git a/armnn.changes b/armnn.changes index ff35eec..d23c60d 100644 --- a/armnn.changes +++ b/armnn.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Apr 20 12:48:18 UTC 2023 - Guillaume GARDET + +- Add additionnal gcc13 fixes: + * 4cf40d7.diff + * armnn-fix-gcc13-2.patch + ------------------------------------------------------------------- Wed Apr 5 06:06:27 UTC 2023 - Guillaume GARDET diff --git a/armnn.spec b/armnn.spec index 2c427a9..48c733e 100644 --- a/armnn.spec +++ b/armnn.spec @@ -81,6 +81,9 @@ Source0: https://github.com/ARM-software/armnn/archive/v%{version}.tar.gz Source1: armnn-rpmlintrc # PATCH-FIX-UPSTREAM - https://github.com/ARM-software/armnn/issues/723 Patch1: armnn-fix-gcc13.patch +Patch2: armnn-fix-gcc13-2.patch +# PATCH-FIX-UPSTREAM - https://review.mlplatform.org/c/ml/armnn/+/9460 +Patch3: 4cf40d7.diff # PATCHES to add downstream ArmnnExamples binary - https://layers.openembedded.org/layerindex/recipe/87610/ Patch200: 0003-add-more-test-command-line-arguments.patch Patch201: 0005-add-armnn-mobilenet-test-example.patch @@ -375,6 +378,8 @@ This package contains the libarmnnOnnxParser library from armnn. %prep %setup -q -n armnn-%{version} %patch1 -p1 +%patch2 -p1 +%patch3 -p1 %if %{with armnn_extra_tests} %patch200 -p1 %patch201 -p1