Skip to contentSkip to conversation

Add ONNX Runtime

PATCH In review Andrew Davis 4 participants 16 messages Jan 17, 2025 – Jan 24, 2025

lore
Share & tools
lore
#0 lore raw

cover Add ONNX Runtime

Hello all,

[2/6] is a v2 with a fixup so it only builds for ARMv7+. [3/6] is already in -next but this is a small update, it can either
replace the one in -next or I can resend as an update patch.
[4/6] is only needed for scarthgap, master should not need this one.

This all adds some initial support for ONNX Runtime for all devices not just ones with DSP. For now, DSP support will still come from meta-edgeai layer.

Thanks,
Andrew

Andrew Davis (6):
flatbuffers: Remove this recipe
meta-arago-extras: Add recipe for arm-compute-library
meta-arago-extras: Add recipe for Arm NN
meta-arago-extras: Backport abseil-cpp from meta-oe master
meta-arago-extras: Add recipe for ONNX
meta-arago-extras: Add recipe for ONNX Runtime

 .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 ++++
 ...e-maes-option-from-cross-compilation.patch |  38 ++++
 ...e-neon-option-from-cross-compilation.patch |  49 +++++
 .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 +++++++++
 ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++
 .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++
 ...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
 ...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
 ...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
 ...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
 ...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
 ...SVE2-support-to-be-disabled-in-CMake.patch |  91 ++++++++
 .../0007-Allow-ARMv7-builds-using-CMake.patch |  86 ++++++++
 ...ymbol-error-when-building-TensorInfo.patch |  46 ++++
 .../arm-compute-library_24.12.bb              |  89 ++++++++
 ...01-Fix-type-casting-for-32bit-builds.patch |  40 ++++
 .../recipes-devtools/armnn/armnn_24.11.bb     |  85 ++++++++
 .../flatbuffers/flatbuffers_1.11.0.bb         |  34 ---
 ...age-Protobuf-before-checking-if-it-w.patch |  25 +++
 .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++
 ...ble-permission-bit-from-source-files.patch |  72 +++++++
 ...-in-option-text-s-buildings-bindings.patch |  25 +++
 ...D_LIBRARY_PATH-to-search-path-when-n.patch |  32 +++
 ...MAKE_CXX_FLAGS-in-build-information-.patch |  31 +++
 ...ake-Print-out-result-of-find_package.patch |  37 ++++
 .../onnxruntime/onnxruntime_1.20.1.bb         | 155 ++++++++++++++
 26 files changed, 1953 insertions(+), 34 deletions(-)
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
 create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
 create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
 delete mode 100644 meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb
 create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
Signature · 1 line
2.39.2
#1 lore raw

PATCH 1/6 flatbuffers: Remove this recipe

This was used for TFlite and ARMNN before it was included in meta-oe. A newer better maintained version of this is in meta-oe now.

---
 .../flatbuffers/flatbuffers_1.11.0.bb         | 34 -------------------
 1 file changed, 34 deletions(-)
 delete mode 100644 meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb
meta-arago-extras/recipes-devtools/flatbuffers/flatbuffers_1.11.0.bb deleted +0 -34
deleted file mode 100644
index 7f7b8b99..00000000
@@ -1,34 +0,0 @@
-SUMMARY = "Memory Efficient Serialization Library"
-HOMEPAGE = "https://github.com/google/flatbuffers"
-SECTION = "console/tools"
-LICENSE = "Apache-2.0"
-
-PACKAGE_BEFORE_PN = "${PN}-compiler"
-
-RDEPENDS:${PN}-compiler = "${PN}"
-RDEPENDS:${PN}-dev += "${PN}-compiler"
-
-LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=a873c5645c184d51e0f9b34e1d7cf559"
-
-SRCREV = "bf9eb67ab9371755c6bcece13cadc7693bcbf264"
-
-SRC_URI = "git://github.com/google/flatbuffers.git;protocol=https;branch=master"
-
-# Make sure C++11 is used, required for example for GCC 4.9
-CXXFLAGS += "-std=c++11"
-BUILD_CXXFLAGS += "-std=c++11"
-
-# BUILD_TYPE=Release is required, otherwise flatc is not installed
-EXTRA_OECMAKE += "\
-    -DCMAKE_BUILD_TYPE=Release \
-    -DFLATBUFFERS_BUILD_TESTS=OFF \    
-    -DFLATBUFFERS_BUILD_SHAREDLIB=ON \
-"
-
-inherit cmake
-
-S = "${WORKDIR}/git"
-
-FILES:${PN}-compiler = "${bindir}"
-
-BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.2
#2 lore raw

PATCH 2/6 meta-arago-extras: Add recipe for arm-compute-library

In reply to Andrew Davis

The Compute Library is a collection of low-level machine learning functions optimized for Arm. This will be used for ARMNN and other machine learning applications and frameworks.

---
 ...-indention-in-cmake-generator-script.patch | 130 ++++++++++++
 ...ENABLE_NEON-in-code-for-checking-NEO.patch | 114 ++++++++++
 ...ENABLE_SVE-in-code-for-checking-SVE-.patch | 197 ++++++++++++++++++
 ...rce-files-at-library-definition-time.patch | 167 +++++++++++++++
 ...ptions-for-SVE-SVE2-and-BF16-support.patch | 112 ++++++++++
 ...SVE2-support-to-be-disabled-in-CMake.patch |  91 ++++++++
 .../0007-Allow-ARMv7-builds-using-CMake.patch |  86 ++++++++
 ...ymbol-error-when-building-TensorInfo.patch |  46 ++++
 .../arm-compute-library_24.12.bb              |  89 ++++++++
 9 files changed, 1032 insertions(+)
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch
 create mode 100644 meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb
meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0001-fix-Fix-indention-in-cmake-generator-script.patch new file +130 -0
new file mode 100644
index 00000000..9e36d254
@@ -0,0 +1,130 @@
+From 1e4c3016547b5f75e515d4b9a7202733c47f5a18 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Wed, 4 Dec 2024 14:46:17 -0600
+Subject: [PATCH] fix: Fix indention in cmake generator script
+
+All other items in these lists use tabs, the first couple
+lines should match. Switch them to tabs then regenerate
+the CMakeLists.txt file.
+
+While here fix the missing ending newline.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+Change-Id: Icab852fc43ae08e7858857881c996d233c835289
+---
+ scripts/generate_build_files.py | 27 ++++++++++++++-------------
+ src/CMakeLists.txt              | 26 +++++++++++++-------------
+ 2 files changed, 27 insertions(+), 26 deletions(-)
+
+diff --git a/scripts/generate_build_files.py b/scripts/generate_build_files.py
+index f88cf1af44..52a8cc14da 100644
+--- a/scripts/generate_build_files.py
++++ b/scripts/generate_build_files.py
+@@ -168,28 +168,29 @@ def build_from_template_cmake(srcs_graph, srcs_sve, srcs_sve2, srcs_core):
+     template = f"""{get_template_header()}
+ 
+ target_sources(
+-    arm_compute_graph
+-    PRIVATE
+-    {line_separator.join(srcs_graph)}
++	arm_compute_graph
++	PRIVATE
++	{line_separator.join(srcs_graph)}
+ )
+ 
+ target_sources(
+-    arm_compute_sve
+-    PRIVATE
+-    {line_separator.join(srcs_sve)}
++	arm_compute_sve
++	PRIVATE
++	{line_separator.join(srcs_sve)}
+ )
+ 
+ target_sources(
+-    arm_compute_sve2
+-    PRIVATE
+-    {line_separator.join(srcs_sve2)}
++	arm_compute_sve2
++	PRIVATE
++	{line_separator.join(srcs_sve2)}
+ )
+ 
+ target_sources(
+-    arm_compute
+-    PRIVATE
+-    {line_separator.join(srcs_core)}
+-)"""
++	arm_compute
++	PRIVATE
++	{line_separator.join(srcs_core)}
++)
++"""
+     return template
+ 
+ 
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index ff3bed96df..f1b275532a 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -21,9 +21,9 @@
+ # SOFTWARE.
+ 
+ target_sources(
+-    arm_compute_graph
+-    PRIVATE
+-    graph/DataLayerVisitor.cpp
++	arm_compute_graph
++	PRIVATE
++	graph/DataLayerVisitor.cpp
+ 	graph/Graph.cpp
+ 	graph/GraphBuilder.cpp
+ 	graph/GraphContext.cpp
+@@ -101,9 +101,9 @@ target_sources(
+ )
+ 
+ target_sources(
+-    arm_compute_sve
+-    PRIVATE
+-    core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp
++	arm_compute_sve
++	PRIVATE
++	core/NEON/kernels/arm_conv/depthwise/interleaves/sve_s8q_3x3_dot.cpp
+ 	core/NEON/kernels/arm_conv/depthwise/interleaves/sve_u8q_3x3_dot.cpp
+ 	core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_direct.cpp
+ 	core/NEON/kernels/arm_conv/depthwise/kernels/sme2_fp16_nhwc_3x3_s1_output2x2_mla_depthfirst/generic_indirect.cpp
+@@ -332,9 +332,9 @@ target_sources(
+ )
+ 
+ target_sources(
+-    arm_compute_sve2
+-    PRIVATE
+-    cpu/kernels/activation/generic/sve2/lut.cpp
++	arm_compute_sve2
++	PRIVATE
++	cpu/kernels/activation/generic/sve2/lut.cpp
+ 	cpu/kernels/activation/generic/sve2/qasymm8.cpp
+ 	cpu/kernels/activation/generic/sve2/qasymm8_signed.cpp
+ 	cpu/kernels/activation/generic/sve2/qsymm16.cpp
+@@ -357,9 +357,9 @@ target_sources(
+ )
+ 
+ target_sources(
+-    arm_compute
+-    PRIVATE
+-    c/AclContext.cpp
++	arm_compute
++	PRIVATE
++	c/AclContext.cpp
+ 	c/AclOperator.cpp
+ 	c/AclQueue.cpp
+ 	c/AclTensor.cpp
+@@ -1049,4 +1049,4 @@ target_sources(
+ 	runtime/experimental/operators/CpuSub.cpp
+ 	runtime/experimental/operators/CpuTranspose.cpp
+ 	runtime/experimental/operators/CpuWinogradConv2d.cpp
+-)
+\ No newline at end of file
++)
meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0002-Use-ARM_COMPUTE_ENABLE_NEON-in-code-for-checking-NEO.patch new file +114 -0

114 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0003-Use-ARM_COMPUTE_ENABLE_SVE-in-code-for-checking-SVE-.patch new file +197 -0

197 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0004-Add-source-files-at-library-definition-time.patch new file +167 -0

167 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0005-Add-CMake-options-for-SVE-SVE2-and-BF16-support.patch new file +112 -0

112 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0006-Allow-SVE-and-SVE2-support-to-be-disabled-in-CMake.patch new file +91 -0

91 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0007-Allow-ARMv7-builds-using-CMake.patch new file +86 -0

86 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library/0008-Fix-undefined-symbol-error-when-building-TensorInfo.patch new file +46 -0

46 lines not on this page · raw message

meta-arago-extras/recipes-devtools/arm-compute-library/arm-compute-library_24.12.bb new file +89 -0

89 lines not on this page · raw message

Signature · 1 line
2.39.2
#3 lore raw

PATCH 3/6 meta-arago-extras: Add recipe for Arm NN

In reply to Andrew Davis

Arm NN is a performant machine learning inference engine for Linux, accelerating ML on Arm Cortex-A CPUs.

---
 ...01-Fix-type-casting-for-32bit-builds.patch | 40 +++++++++
 .../recipes-devtools/armnn/armnn_24.11.bb     | 85 +++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch
 create mode 100644 meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb
meta-arago-extras/recipes-devtools/armnn/armnn/0001-Fix-type-casting-for-32bit-builds.patch new file +40 -0
new file mode 100644
index 00000000..8e3cf34d
@@ -0,0 +1,40 @@
+From 10953c25a77989709bcbd065489700314fe0c8c6 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:11:28 -0600
+Subject: [PATCH] Fix type casting for 32bit builds
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+Change-Id: Id68274e68e7832b827050a2e417053e88e7a6728
+---
+ include/armnn/Numpy.hpp                         | 2 +-
+ tests/ExecuteNetwork/FileComparisonExecutor.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/armnn/Numpy.hpp b/include/armnn/Numpy.hpp
+index a4154b434..f77b065ca 100644
+--- a/include/armnn/Numpy.hpp
++++ b/include/armnn/Numpy.hpp
+@@ -209,7 +209,7 @@ namespace armnnNumpy
+     template<typename T>
+     inline void ReadData(std::ifstream& ifStream, T* tensor, const unsigned int& numElements)
+     {
+-        ifStream.read(reinterpret_cast<char *>(tensor), sizeof(T) * numElements);
++        ifStream.read(reinterpret_cast<char *>(tensor), static_cast<std::streamsize>(sizeof(T) * numElements));
+     }
+ 
+ 
+diff --git a/tests/ExecuteNetwork/FileComparisonExecutor.cpp b/tests/ExecuteNetwork/FileComparisonExecutor.cpp
+index 903ed0362..4617ebe4a 100644
+--- a/tests/ExecuteNetwork/FileComparisonExecutor.cpp
++++ b/tests/ExecuteNetwork/FileComparisonExecutor.cpp
+@@ -187,7 +187,7 @@ Tensor ReadTensorFromFile(const std::string fileName)
+ 
+     // We'll read the entire file into one buffer.
+     std::ifstream file(fileName, std::ios::binary);
+-    std::vector<char> buffer(fileSize);
++    std::vector<char> buffer(static_cast<std::size_t>(fileSize));
+     if (file.read(buffer.data(), static_cast<std::streamsize>(fileSize)))
+     {
+         std::string tensorName;
meta-arago-extras/recipes-devtools/armnn/armnn_24.11.bb new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.39.2
#4 lore raw

PATCH 4/6 meta-arago-extras: Backport abseil-cpp from meta-oe master

In reply to Andrew Davis

ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap.

This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way.

---
 .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 +++++++
 ...e-maes-option-from-cross-compilation.patch |  38 +++++++
 ...e-neon-option-from-cross-compilation.patch |  49 +++++++++
 .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 ++++++++++++++++++
 ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++++
 .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++++++
 6 files changed, 312 insertions(+)
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +38 -0
new file mode 100644
index 00000000..6fecf256
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+ 
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>
+-#else
+-#include <sgidefs.h>
+-#endif  // __BIONIC__ || !__GLIBC__
+ #endif  // __mips__
+ 
+ // SYS_mmap and SYS_munmap are not defined in Android.
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +38 -0
new file mode 100644
index 00000000..d49e860f
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+ 
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+ 
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +49 -0

49 lines not on this page · raw message

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +103 -0

103 lines not on this page · raw message

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +30 -0
new file mode 100644
index 00000000..9a4fc0b4
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
+---
+ CMake/AbseilHelpers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+         # specified platform. Filter both of them out before the successor
+         # reaches the "^-m" filter.
+         set(skip_next_cflag ON)
+-      elseif(${cflag} MATCHES "^(-Wno|/wd)")
++      elseif(${cflag} MATCHES "^(-Wno-|/wd)")
+         # These flags are needed to suppress warnings that might fire in our headers.
+         set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+       elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.39.2
#5 lore raw

Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master

Quoted 8 lines · Andrew Davis via lists.yoctoproject.org

ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap.

This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way.

Just a note here - there's an effort to improve meta-arago-* layers quality and eventually seek a Yocto Project Compatible status for them. Adding a version of a recipe that exists upstream is possible, but requires some extra attention, especially when it's a newer version and gets preferred by BitBake automatically. One way to do it is to lower its default preference with DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in the distro conf...

Quoted 366 lines
---
 .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 +++++++
 ...e-maes-option-from-cross-compilation.patch |  38 +++++++
 ...e-neon-option-from-cross-compilation.patch |  49 +++++++++
 .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 ++++++++++++++++++
 ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++++
 .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++++++
 6 files changed, 312 insertions(+)
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch
 create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +38 -0
new file mode 100644
index 00000000..6fecf256
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+ 
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>
+-#else
+-#include <sgidefs.h>
+-#endif  // __BIONIC__ || !__GLIBC__
+ #endif  // __mips__
+ 
+ // SYS_mmap and SYS_munmap are not defined in Android.
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +38 -0
new file mode 100644
index 00000000..d49e860f
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+ 
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+ 
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +49 -0
new file mode 100644
index 00000000..c82b9e1b
@@ -0,0 +1,49 @@
+From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <[email protected]>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jonas Gorski <[email protected]>
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 5e0e8dfd..57cfc4d3 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+     "/DNOMINMAX"
+ )
+ 
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+-    "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+     "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 0072008c..72840fda 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
+     "/DNOMINMAX",
+ ]
+ 
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+-    "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+     "-march=armv8-a+crypto",
+ ]
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +103 -0
new file mode 100644
index 00000000..ba0cd669
@@ -0,0 +1,103 @@
+From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 21 Sep 2024 20:53:06 +0800
+Subject: [PATCH] abseil: ppc fixes
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
+4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
+
+Sourced from void linux
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/unscaledcycleclock.cc       | 4 ++--
+ absl/base/internal/unscaledcycleclock_config.h | 3 ++-
+ absl/debugging/internal/examine_stack.cc       | 8 +++++++-
+ absl/debugging/internal/stacktrace_config.h    | 2 +-
+ 4 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
+index a0bf3a65..103b4f6a 100644
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+ 
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+   return base_internal::NominalCPUFrequency();
+ }
+ 
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ 
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
+index 43a3dabe..196a8535 100644
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+ 
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+-    defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) ||     \
++    ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
++    defined(_M_IX86) ||     \
+     (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
+index 3dd6ba1a..f923b055 100644
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -36,6 +36,10 @@
+ #include <csignal>
+ #include <cstdio>
+ 
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
+     return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+     return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+     return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
++#elif defined(__powerpc__)
++    return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+     return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
+index 3929b1b7..23d5e504 100644
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)
+-- 
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +30 -0
new file mode 100644
index 00000000..9a4fc0b4
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
+---
+ CMake/AbseilHelpers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+         # specified platform. Filter both of them out before the successor
+         # reaches the "^-m" filter.
+         set(skip_next_cflag ON)
+-      elseif(${cflag} MATCHES "^(-Wno|/wd)")
++      elseif(${cflag} MATCHES "^(-Wno-|/wd)")
+         # These flags are needed to suppress warnings that might fire in our headers.
+         set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+       elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +54 -0
new file mode 100644
index 00000000..4bfc2100
@@ -0,0 +1,54 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \
+meta, numeric, strings, synchronization, time, types and utility."
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
+
+SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
+BRANCH = "lts_2024_07_22"
+SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
+           file://0001-absl-always-use-asm-sgidefs.h.patch             \
+           file://0002-Remove-maes-option-from-cross-compilation.patch \
+           file://0003-Remove-neon-option-from-cross-compilation.patch \
+           file://0004-abseil-ppc-fixes.patch \
+           file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+                 -DBUILD_TESTING=OFF    \
+                 -DABSL_ENABLE_INSTALL=ON \
+                "
+
+SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
+
+PACKAGES_DYNAMIC += "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+    libdir = d.getVar('libdir')
+
+    libpackages = do_split_packages(
+        d,
+        root=libdir,
+        file_regex=r'^libabsl_(.*)\.so\..*$',
+        output_pattern='libabsl-%s',
+        description="abseil shared library %s",
+        prepend=True,
+        extra_depends='',
+    )
+    if libpackages:
+        d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.2
#6 lore raw

Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master

Quoted 10 lines · Denys Dmytriyenko
Quoted 8 lines · Andrew Davis via lists.yoctoproject.org

ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap.

This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way.

Quoted 8 lines

Just a note here - there's an effort to improve meta-arago-* layers quality and eventually seek a Yocto Project Compatible status for them. Adding a version of a recipe that exists upstream is possible, but requires some extra attention, especially when it's a newer version and gets preferred by BitBake automatically. One way to do it is to lower its default preference with DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in the distro conf...

Good info, thanks, if I need to make a change like this going forward I'll do it like that. (I'm assuming our scarthgap branch isn't going to be a candidate for this Yocto Compat status, and this patch is only for scarthgap so no fix needed for this patch?)

Andrew

Quoted 367 lines
Quoted 367 lines
---
  .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 +++++++
  ...e-maes-option-from-cross-compilation.patch |  38 +++++++
  ...e-neon-option-from-cross-compilation.patch |  49 +++++++++
  .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 ++++++++++++++++++
  ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++++
  .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++++++
  6 files changed, 312 insertions(+)

create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +38 -0
new file mode 100644
index 00000000..6fecf256
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>
+-#else
+-#include <sgidefs.h>
+-#endif  // __BIONIC__ || !__GLIBC__
+ #endif  // __mips__
+
+ // SYS_mmap and SYS_munmap are not defined in Android.
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +38 -0
new file mode 100644
index 00000000..d49e860f
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +49 -0
new file mode 100644
index 00000000..c82b9e1b
@@ -0,0 +1,49 @@
+From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <[email protected]>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jonas Gorski <[email protected]>
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 5e0e8dfd..57cfc4d3 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+     "/DNOMINMAX"
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+-    "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+     "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 0072008c..72840fda 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
+     "/DNOMINMAX",
+ ]
+
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+-    "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+     "-march=armv8-a+crypto",
+ ]
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +103 -0
new file mode 100644
index 00000000..ba0cd669
@@ -0,0 +1,103 @@
+From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 21 Sep 2024 20:53:06 +0800
+Subject: [PATCH] abseil: ppc fixes
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
+4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
+
+Sourced from void linux
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/unscaledcycleclock.cc       | 4 ++--
+ absl/base/internal/unscaledcycleclock_config.h | 3 ++-
+ absl/debugging/internal/examine_stack.cc       | 8 +++++++-
+ absl/debugging/internal/stacktrace_config.h    | 2 +-
+ 4 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
+index a0bf3a65..103b4f6a 100644
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+   return base_internal::NominalCPUFrequency();
+ }
+
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
+index 43a3dabe..196a8535 100644
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+-    defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) ||     \
++    ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
++    defined(_M_IX86) ||     \
+     (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
+index 3dd6ba1a..f923b055 100644
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -36,6 +36,10 @@
+ #include <csignal>
+ #include <cstdio>
+
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
+     return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+     return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+     return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
++#elif defined(__powerpc__)
++    return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+     return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
+index 3929b1b7..23d5e504 100644
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +30 -0
new file mode 100644
index 00000000..9a4fc0b4
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
+---
+ CMake/AbseilHelpers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+         # specified platform. Filter both of them out before the successor
+         # reaches the "^-m" filter.
+         set(skip_next_cflag ON)
+-      elseif(${cflag} MATCHES "^(-Wno|/wd)")
++      elseif(${cflag} MATCHES "^(-Wno-|/wd)")
+         # These flags are needed to suppress warnings that might fire in our headers.
+         set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+       elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +54 -0
new file mode 100644
index 00000000..4bfc2100
@@ -0,0 +1,54 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \
+meta, numeric, strings, synchronization, time, types and utility."
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
+
+SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
+BRANCH = "lts_2024_07_22"
+SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
+           file://0001-absl-always-use-asm-sgidefs.h.patch             \
+           file://0002-Remove-maes-option-from-cross-compilation.patch \
+           file://0003-Remove-neon-option-from-cross-compilation.patch \
+           file://0004-abseil-ppc-fixes.patch \
+           file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+                 -DBUILD_TESTING=OFF    \
+                 -DABSL_ENABLE_INSTALL=ON \
+                "
+
+SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
+
+PACKAGES_DYNAMIC += "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+    libdir = d.getVar('libdir')
+
+    libpackages = do_split_packages(
+        d,
+        root=libdir,
+        file_regex=r'^libabsl_(.*)\.so\..*$',
+        output_pattern='libabsl-%s',
+        description="abseil shared library %s",
+        prepend=True,
+        extra_depends='',
+    )
+    if libpackages:
+        d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.2
#7 lore raw

Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master

Quoted 20 lines · Andrew Davis
Quoted 10 lines · Denys Dmytriyenko
Quoted 8 lines · Andrew Davis via lists.yoctoproject.org

ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap.

This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way.

Quoted 8 lines

Just a note here - there's an effort to improve meta-arago-* layers quality and eventually seek a Yocto Project Compatible status for them. Adding a version of a recipe that exists upstream is possible, but requires some extra attention, especially when it's a newer version and gets preferred by BitBake automatically. One way to do it is to lower its default preference with DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in the distro conf...

Quoted 4 lines

Good info, thanks, if I need to make a change like this going forward I'll do it like that. (I'm assuming our scarthgap branch isn't going to be a candidate for this Yocto Compat status, and this patch is only for scarthgap so no fix needed for this patch?)

The patch is labelled as being for master as well... Can we not mix the scarthgap/master patches in a single series unless they truly should be applied to both. It's really annoying to manually pick and choose which patches to apply where.

Quoted 411 lines

Andrew

Quoted 409 lines
Quoted 409 lines

---
  .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 +++++++ ...e-maes-option-from-cross-compilation.patch |  38 +++++++ ...e-neon-option-from-cross-compilation.patch |  49 +++++++++ .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 ++++++++++++++++++ ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++++ .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++++++

  6 files changed, 312 insertions(+)

  create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
  create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb

(quoted diff) +0 -0
new file mode 100644
index 00000000..6fecf256

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +6 -0
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C 

libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +10 -0
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h 

b/absl/base/internal/direct_mmap.h

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +9 -0
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, 

which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>

+-#else
+-#include <sgidefs.h>
+-#endif  // __BIONIC__ || !__GLIBC__

+ #endif  // __mips__

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +5 -0
+
+ // SYS_mmap and SYS_munmap are not defined in Android.
+--
+2.25.1
+
(quoted diff) +0 -0
new file mode 100644
index 00000000..d49e860f

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +12 -0
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake 

b/absl/copts/GENERATED_AbseilCopts.cmake

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +12 -0
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl 

b/absl/copts/GENERATED_copts.bzl

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +14 -0
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+--
+2.25.1
+
(quoted diff) +0 -0
new file mode 100644
index 00000000..c82b9e1b

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +17 -0
@@ -0,0 +1,49 @@
+From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <[email protected]>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jonas Gorski <[email protected]>
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake 

b/absl/copts/GENERATED_AbseilCopts.cmake

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +15 -0
+index 5e0e8dfd..57cfc4d3 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+     "/DNOMINMAX"
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+-    "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+     "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl 

b/absl/copts/GENERATED_copts.bzl

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +17 -0
+index 0072008c..72840fda 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
+     "/DNOMINMAX",
+ ]
+
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+-    "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+     "-march=armv8-a+crypto",
+ ]
+--
+2.25.1
+
(quoted diff) +0 -0
new file mode 100644
index 00000000..ba0cd669

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +8 -0
@@ -0,0 +1,103 @@
+From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 21 Sep 2024 20:53:06 +0800
+Subject: [PATCH] abseil: ppc fixes
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled 

on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed) +4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +14 -0
+
+Sourced from void linux
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/unscaledcycleclock.cc       | 4 ++--
+ absl/base/internal/unscaledcycleclock_config.h | 3 ++-
+ absl/debugging/internal/examine_stack.cc       | 8 +++++++-
+ absl/debugging/internal/stacktrace_config.h    | 2 +-
+ 4 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/unscaledcycleclock.cc 

b/absl/base/internal/unscaledcycleclock.cc

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +22 -0
+index a0bf3a65..103b4f6a 100644
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+   return base_internal::NominalCPUFrequency();
+ }
+
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+diff --git a/absl/base/internal/unscaledcycleclock_config.h 

b/absl/base/internal/unscaledcycleclock_config.h

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +6 -0
+index 43a3dabe..196a8535 100644
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+
+ // The following platforms have an implementation of a hardware 

counter.
+ #if defined(__i386__) || defined(__x86_64__) ||
defined(__aarch64__) || \

+-    defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) 
||     \
++    ((defined(__powerpc__) || defined(__ppc__)) && 
defined(__GLIBC__)) || \
++    defined(_M_IX86) ||     \

+     (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +21 -0
+index 3dd6ba1a..f923b055 100644
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -36,6 +36,10 @@
+ #include <csignal>
+ #include <cstdio>
+
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
+     return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+     return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+     return 

reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]); ++#elif defined(__powerpc__)
++    return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+     return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +15 -0
+index 3929b1b7..23d5e504 100644
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)
+--
+2.25.1
+
(quoted diff) +0 -0
new file mode 100644
index 00000000..9a4fc0b4

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +4 -0
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are 

needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +6 -0
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport 

[https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]

+---
+ CMake/AbseilHelpers.cmake | 2 +-

+ 1 file changed, 1 insertion(+), 1 deletion(-)

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +7 -0
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+         # specified platform. Filter both of them out before the 

successor
+         # reaches the "^-m" filter.
+         set(skip_next_cflag ON)

+-      elseif(${cflag} MATCHES "^(-Wno|/wd)")
++      elseif(${cflag} MATCHES "^(-Wno-|/wd)")

+         # These flags are needed to suppress warnings that might fire in our headers.
+         set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+       elseif(${cflag} MATCHES "^(-W|/w[1234eo])")

(quoted diff) +0 -0
new file mode 100644
index 00000000..4bfc2100

b/meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb

(quoted diff) +2 -0
@@ -0,0 +1,54 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. 

Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +5 -0
+meta, numeric, strings, synchronization, time, types and utility."
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = 

"file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +4 -0
+
+SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
+BRANCH = "lts_2024_07_22"
+SRC_URI = 

"git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
+
file://0001-absl-always-use-asm-sgidefs.h.patch             \
+ file://0002-Remove-maes-option-from-cross-compilation.patch \
+ file://0003-Remove-neon-option-from-cross-compilation.patch \
+           file://0004-abseil-ppc-fixes.patch \
+ file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
+          "

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +31 -0
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+                 -DBUILD_TESTING=OFF    \
+                 -DABSL_ENABLE_INSTALL=ON \
+                "
+
+SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
+
+PACKAGES_DYNAMIC += "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+    libdir = d.getVar('libdir')
+
+    libpackages = do_split_packages(
+        d,
+        root=libdir,
+        file_regex=r'^libabsl_(.*)\.so\..*$',
+        output_pattern='libabsl-%s',
+        description="abseil shared library %s",
+        prepend=True,
+        extra_depends='',
+    )
+    if libpackages:
+        d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' 

'.join(libpackages))

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +5 -0
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.2
Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
#8 lore raw

Re: [meta-arago][scarthgap/master][PATCH 4/6] meta-arago-extras: Backport abseil-cpp from meta-oe master

Quoted 23 lines · Ryan Eatmon
Quoted 20 lines · Andrew Davis
Quoted 18 lines · Denys Dmytriyenko
Quoted 8 lines · Andrew Davis via lists.yoctoproject.org

ONNX and ONNX Runtime depend on a very specific version of Abseil that is not the version included with meta-oe scarthgap. But it just so happens to be the version provided in current meta-oe master. Backport this version for our use in scarthgap.

This patch is not needed for meta-arago master branch. If meta-oe master at some point moves to a newer incompatible version of Abseil we will deal with this dependency in a different way.

Just a note here - there's an effort to improve meta-arago-* layers quality and eventually seek a Yocto Project Compatible status for them. Adding a version of a recipe that exists upstream is possible, but requires some extra attention, especially when it's a newer version and gets preferred by BitBake automatically. One way to do it is to lower its default preference with DEFAULT_PREFERENCE = "-1" and then set a corresponding PREFERRED_VERSION in the distro conf...

Quoted 7 lines
Quoted 4 lines

Good info, thanks, if I need to make a change like this going forward I'll do it like that. (I'm assuming our scarthgap branch isn't going to be a candidate for this Yocto Compat status, and this patch is only for scarthgap so no fix needed for this patch?)

The patch is labelled as being for master as well...  Can we not mix the scarthgap/master patches in a single series unless they truly should be applied to both.  It's really annoying to manually pick and choose which patches to apply where.

Sorry about that, I'll split this one out from this series and send it by itself for just scarthgap.

Andrew

Quoted 371 lines
Quoted 370 lines

Andrew

Quoted 367 lines
Quoted 367 lines

---
  .../0001-absl-always-use-asm-sgidefs.h.patch  |  38 +++++++ ...e-maes-option-from-cross-compilation.patch |  38 +++++++ ...e-neon-option-from-cross-compilation.patch |  49 +++++++++ .../abseil-cpp/0004-abseil-ppc-fixes.patch    | 103 ++++++++++++++++++ ...-virtual-dtor-in-the-flags-are-neede.patch |  30 +++++ .../abseil-cpp/abseil-cpp_20240722.0.bb       |  54 +++++++++

  6 files changed, 312 insertions(+)

  create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch
  create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch create mode 100644 meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb

meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0001-absl-always-use-asm-sgidefs.h.patch new file +38 -0
new file mode 100644
index 00000000..6fecf256
@@ -0,0 +1,38 @@
+From 11faa06436fdeb0c9948080a11f9a99d3b5ba16c Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 9 Apr 2020 13:06:27 -0700
+Subject: [PATCH] absl: always use <asm/sgidefs.h>
+
+Fixes mips/musl build, since sgidefs.h is not present on all C libraries
+but on linux asm/sgidefs.h is there and contains same definitions, using
+that makes it portable.
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/direct_mmap.h | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/direct_mmap.h b/absl/base/internal/direct_mmap.h
+index 1beb2ee4..140b0697 100644
+--- a/absl/base/internal/direct_mmap.h
++++ b/absl/base/internal/direct_mmap.h
+@@ -41,13 +41,9 @@
+
+ #ifdef __mips__
+ // Include definitions of the ABI currently in use.
+-#if defined(__BIONIC__) || !defined(__GLIBC__)
+-// Android doesn't have sgidefs.h, but does have asm/sgidefs.h, which has the
++// bionic/musl C libs don't have sgidefs.h, but do have asm/sgidefs.h, which has the
+ // definitions we need.
+ #include <asm/sgidefs.h>
+-#else
+-#include <sgidefs.h>
+-#endif  // __BIONIC__ || !__GLIBC__
+ #endif  // __mips__
+
+ // SYS_mmap and SYS_munmap are not defined in Android.
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0002-Remove-maes-option-from-cross-compilation.patch new file +38 -0
new file mode 100644
index 00000000..d49e860f
@@ -0,0 +1,38 @@
+From a573ccd57e713486e7d8e782d6b3b34fde01ff9e Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <[email protected]>
+Date: Mon, 3 Feb 2020 03:25:57 +0000
+Subject: [PATCH] Remove maes option from cross-compilation
+
+Upstream-Status: Pending
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index da2282fe..5e0e8dfd 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -229,7 +229,3 @@ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+ list(APPEND ABSL_RANDOM_HWAES_MSVC_X64_FLAGS
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_X64_FLAGS
+-    "-maes"
+-    "-msse4.1"
+-)
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index b9e0071e..0072008c 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -230,7 +230,3 @@ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+ ABSL_RANDOM_HWAES_MSVC_X64_FLAGS = [
+ ]
+
+-ABSL_RANDOM_HWAES_X64_FLAGS = [
+-    "-maes",
+-    "-msse4.1",
+-]
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0003-Remove-neon-option-from-cross-compilation.patch new file +49 -0
new file mode 100644
index 00000000..c82b9e1b
@@ -0,0 +1,49 @@
+From 632632508daf8bb3a5800dac937ffc33c6d85973 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <[email protected]>
+Date: Thu, 16 Jun 2022 11:46:31 +0000
+Subject: [PATCH] Remove neon option from cross compilation
+
+Not every arm platform supports neon instructions, so do not enforce
+them.
+
+Upstream-Status: Pending
+
+Signed-off-by: Jonas Gorski <[email protected]>
+---
+ absl/copts/GENERATED_AbseilCopts.cmake | 4 ----
+ absl/copts/GENERATED_copts.bzl         | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/absl/copts/GENERATED_AbseilCopts.cmake b/absl/copts/GENERATED_AbseilCopts.cmake
+index 5e0e8dfd..57cfc4d3 100644
+--- a/absl/copts/GENERATED_AbseilCopts.cmake
++++ b/absl/copts/GENERATED_AbseilCopts.cmake
+@@ -218,10 +218,6 @@ list(APPEND ABSL_MSVC_TEST_FLAGS
+     "/DNOMINMAX"
+ )
+
+-list(APPEND ABSL_RANDOM_HWAES_ARM32_FLAGS
+-    "-mfpu=neon"
+-)
+-
+ list(APPEND ABSL_RANDOM_HWAES_ARM64_FLAGS
+     "-march=armv8-a+crypto"
+ )
+diff --git a/absl/copts/GENERATED_copts.bzl b/absl/copts/GENERATED_copts.bzl
+index 0072008c..72840fda 100644
+--- a/absl/copts/GENERATED_copts.bzl
++++ b/absl/copts/GENERATED_copts.bzl
+@@ -219,10 +219,6 @@ ABSL_MSVC_TEST_FLAGS = [
+     "/DNOMINMAX",
+ ]
+
+-ABSL_RANDOM_HWAES_ARM32_FLAGS = [
+-    "-mfpu=neon",
+-]
+-
+ ABSL_RANDOM_HWAES_ARM64_FLAGS = [
+     "-march=armv8-a+crypto",
+ ]
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0004-abseil-ppc-fixes.patch new file +103 -0
new file mode 100644
index 00000000..ba0cd669
@@ -0,0 +1,103 @@
+From f9607924225ca59fb6c60222e6424b84e6f70029 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 21 Sep 2024 20:53:06 +0800
+Subject: [PATCH] abseil: ppc fixes
+
+An all-in-one patch that fixes several issues:
+
+1) UnscaledCycleClock not fully implemented for ppc*-musl (disabled on musl)
+2) powerpc stacktrace implementation only works on glibc (disabled on musl)
+3) powerpc stacktrace implementation has ppc64 assumptions (fixed)
+4) examine_stack.cpp makes glibc assumptions on powerpc (fixed)
+
+Sourced from void linux
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ absl/base/internal/unscaledcycleclock.cc       | 4 ++--
+ absl/base/internal/unscaledcycleclock_config.h | 3 ++-
+ absl/debugging/internal/examine_stack.cc       | 8 +++++++-
+ absl/debugging/internal/stacktrace_config.h    | 2 +-
+ 4 files changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/absl/base/internal/unscaledcycleclock.cc b/absl/base/internal/unscaledcycleclock.cc
+index a0bf3a65..103b4f6a 100644
+--- a/absl/base/internal/unscaledcycleclock.cc
++++ b/absl/base/internal/unscaledcycleclock.cc
+@@ -20,7 +20,7 @@
+ #include <intrin.h>
+ #endif
+
+-#if defined(__powerpc__) || defined(__ppc__)
++#if (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+ #ifdef __GLIBC__
+ #include <sys/platform/ppc.h>
+ #elif defined(__FreeBSD__)
+@@ -58,7 +58,7 @@ double UnscaledCycleClock::Frequency() {
+   return base_internal::NominalCPUFrequency();
+ }
+
+-#elif defined(__powerpc__) || defined(__ppc__)
++#elif (defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)
+
+ int64_t UnscaledCycleClock::Now() {
+ #ifdef __GLIBC__
+diff --git a/absl/base/internal/unscaledcycleclock_config.h b/absl/base/internal/unscaledcycleclock_config.h
+index 43a3dabe..196a8535 100644
+--- a/absl/base/internal/unscaledcycleclock_config.h
++++ b/absl/base/internal/unscaledcycleclock_config.h
+@@ -21,7 +21,8 @@
+
+ // The following platforms have an implementation of a hardware counter.
+ #if defined(__i386__) || defined(__x86_64__) || defined(__aarch64__) || \
+-    defined(__powerpc__) || defined(__ppc__) || defined(_M_IX86) ||     \
++    ((defined(__powerpc__) || defined(__ppc__)) && defined(__GLIBC__)) || \
++    defined(_M_IX86) ||     \
+     (defined(_M_X64) && !defined(_M_ARM64EC))
+ #define ABSL_HAVE_UNSCALED_CYCLECLOCK_IMPLEMENTATION 1
+ #else
+diff --git a/absl/debugging/internal/examine_stack.cc b/absl/debugging/internal/examine_stack.cc
+index 3dd6ba1a..f923b055 100644
+--- a/absl/debugging/internal/examine_stack.cc
++++ b/absl/debugging/internal/examine_stack.cc
+@@ -36,6 +36,10 @@
+ #include <csignal>
+ #include <cstdio>
+
++#if defined(__powerpc__)
++#include <asm/ptrace.h>
++#endif
++
+ #include "absl/base/attributes.h"
+ #include "absl/base/internal/raw_logging.h"
+ #include "absl/base/macros.h"
+@@ -177,8 +181,10 @@ void* GetProgramCounter(void* const vuc) {
+     return reinterpret_cast<void*>(context->uc_mcontext.pc);
+ #elif defined(__powerpc64__)
+     return reinterpret_cast<void*>(context->uc_mcontext.gp_regs[32]);
+-#elif defined(__powerpc__)
++#elif defined(__powerpc__) && defined(__GLIBC__)
+     return reinterpret_cast<void*>(context->uc_mcontext.uc_regs->gregs[32]);
++#elif defined(__powerpc__)
++    return reinterpret_cast<void*>((context->uc_regs)->gregs[32]);
+ #elif defined(__riscv)
+     return reinterpret_cast<void*>(context->uc_mcontext.__gregs[REG_PC]);
+ #elif defined(__s390__) && !defined(__s390x__)
+diff --git a/absl/debugging/internal/stacktrace_config.h b/absl/debugging/internal/stacktrace_config.h
+index 3929b1b7..23d5e504 100644
+--- a/absl/debugging/internal/stacktrace_config.h
++++ b/absl/debugging/internal/stacktrace_config.h
+@@ -60,7 +60,7 @@
+ #elif defined(__i386__) || defined(__x86_64__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_x86-inl.inc"
+-#elif defined(__ppc__) || defined(__PPC__)
++#elif (defined(__ppc__) || defined(__PPC__)) && defined(__GLIBC__)
+ #define ABSL_STACKTRACE_INL_HEADER \
+   "absl/debugging/internal/stacktrace_powerpc-inl.inc"
+ #elif defined(__aarch64__)
+--
+2.25.1
+
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp/0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch new file +30 -0
new file mode 100644
index 00000000..9a4fc0b4
@@ -0,0 +1,30 @@
+From 9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5 Mon Sep 17 00:00:00 2001
+From: Derek Mauro <[email protected]>
+Date: Mon, 5 Aug 2024 07:35:05 -0700
+Subject: [PATCH] Don't match -Wnon-virtual-dtor in the "flags are needed to
+ suppress warnings in headers". It should fall through to the "don't impose
+ our warnings on others" case. Do this by matching on "-Wno-*" instead of
+ "-Wno*".
+
+Fixes #1737
+
+PiperOrigin-RevId: 659548798
+Change-Id: I49d7ba7ddcd7be30f946fca90ba9be467181e854
+Upstream-Status: Backport [https://github.com/abseil/abseil-cpp/commit/9cb5e5d15c142e5cc43a2c1db87c8e4e5b6d38a5]
+---
+ CMake/AbseilHelpers.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index b177e590..3c4c92fe 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -195,7 +195,7 @@ function(absl_cc_library)
+         # specified platform. Filter both of them out before the successor
+         # reaches the "^-m" filter.
+         set(skip_next_cflag ON)
+-      elseif(${cflag} MATCHES "^(-Wno|/wd)")
++      elseif(${cflag} MATCHES "^(-Wno-|/wd)")
+         # These flags are needed to suppress warnings that might fire in our headers.
+         set(PC_CFLAGS "${PC_CFLAGS} ${cflag}")
+       elseif(${cflag} MATCHES "^(-W|/w[1234eo])")
meta-arago-extras/recipes-devtools/abseil-cpp/abseil-cpp_20240722.0.bb new file +54 -0
new file mode 100644
index 00000000..4bfc2100
@@ -0,0 +1,54 @@
+SUMMARY = "Abseil is a cpp library like STL"
+DESCRIPTION = "Abseil provides pieces missing from the C++ standard. Contains \
+additional useful libraries like algorithm, container, debugging, hash, memory, \
+meta, numeric, strings, synchronization, time, types and utility."
+HOMEPAGE = "https://abseil.io/"
+SECTION = "libs"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=df52c6edb7adc22e533b2bacc3bd3915"
+
+SRCREV = "4447c7562e3bc702ade25105912dce503f0c4010"
+BRANCH = "lts_2024_07_22"
+SRC_URI = "git://github.com/abseil/abseil-cpp;branch=${BRANCH};protocol=https \
+ file://0001-absl-always-use-asm-sgidefs.h.patch             \
+ file://0002-Remove-maes-option-from-cross-compilation.patch \
+ file://0003-Remove-neon-option-from-cross-compilation.patch \
+           file://0004-abseil-ppc-fixes.patch \
+ file://0005-Don-t-match-Wnon-virtual-dtor-in-the-flags-are-neede.patch \
+          "
+
+S = "${WORKDIR}/git"
+
+inherit cmake
+
+EXTRA_OECMAKE = "-DBUILD_SHARED_LIBS=ON \
+                 -DBUILD_TESTING=OFF    \
+                 -DABSL_ENABLE_INSTALL=ON \
+                "
+
+SYSROOT_DIRS:append:class-nativesdk:mingw32 = " ${bindir}"
+
+PACKAGES_DYNAMIC += "^libabsl-*"
+PACKAGES_DYNAMIC:class-native = ""
+
+PACKAGESPLITFUNCS =+ "split_dynamic_packages"
+
+python split_dynamic_packages() {
+    libdir = d.getVar('libdir')
+
+    libpackages = do_split_packages(
+        d,
+        root=libdir,
+        file_regex=r'^libabsl_(.*)\.so\..*$',
+        output_pattern='libabsl-%s',
+        description="abseil shared library %s",
+        prepend=True,
+        extra_depends='',
+    )
+    if libpackages:
+        d.appendVar('RDEPENDS:' + d.getVar('PN'), ' ' + ' '.join(libpackages))
+}
+
+ALLOW_EMPTY:${PN} = "1"
+
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.39.2
#9 lore raw

PATCH 5/6 meta-arago-extras: Add recipe for ONNX

In reply to Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
 ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++
 .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++
 2 files changed, 132 insertions(+)
 create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb
meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +25 -0
new file mode 100644
index 00000000..dceac1f4
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+ 
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See https://github.com/caffe2/caffe
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +107 -0

107 lines not on this page · raw message

Signature · 1 line
2.39.2
#10 lore raw

Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX

Hi Andrew,

Quoted 63 lines · Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
  ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++
  .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++
  2 files changed, 132 insertions(+)

create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +25 -0
new file mode 100644
index 00000000..dceac1f4
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See https://github.com/caffe2/caffe
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +14 -0
new file mode 100644
index 00000000..9624d061
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1"
+SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch"
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb line 24

Quoted 10 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +10 -0
+DEPENDS += "\
+	abseil-cpp \
+	protobuf \
+	protobuf-native \
+	python3-protobuf \
+	python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+	python3 \

Nitpick,

To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN) OR keep it static as python3 for all references

--
Chirag

Quoted 83 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +83 -0
+	python3-numpy \
+	python3-numpy-native \
+	python3-pybind11 \
+	python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+	python3 \
+	python3-numpy \
+	python3-protobuf \
+	python3-coloredlogs \
+	python3-flatbuffers \
+	python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+	-DBUILD_ONNX_PYTHON=ON \
+	-DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+	-DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+	-DBUILD_ONNX_PYTHON=OFF, \
+	${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+	-DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+	-DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+	-DONNX_DISABLE_STATIC_REGISTRATION=ON \
+	-DONNX_ML=1 \
+	-DCMAKE_VERBOSE_MAKEFILE=ON \
+	--log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+    import os
+    import textwrap
+
+    version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py")
+    os.makedirs(os.path.dirname(version_file_path), exist_ok=True)
+    with open(version_file_path, "w", encoding="utf-8") as f:
+        f.write(
+            textwrap.dedent(
+                f"""\
+                # This file is generated. DO NOT EDIT!
+
+
+                version = "{d.getVar('PV')}"
+                git_version = "{d.getVar('SRCREV')}"
+                """
+            )
+        )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+	CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+	# Install the Python package.
+	if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+		install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+		(cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+		cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR}
+		cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+	fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"
#11 lore raw

Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX

Quoted 81 lines · Chirag Shilwant

Hi Andrew,

Quoted 63 lines · Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
  ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++ .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++

  2 files changed, 132 insertions(+)

  create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +25 -0
new file mode 100644
index 00000000..dceac1f4
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See https://github.com/caffe2/caffe
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +14 -0
new file mode 100644
index 00000000..9624d061
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1"
+SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch"
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb line 24

Quoted 10 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +10 -0
+DEPENDS += "\
+    abseil-cpp \
+    protobuf \
+    protobuf-native \
+    python3-protobuf \
+    python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+    python3 \

Nitpick,

Quoted 4 lines

To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN) OR keep it static as python3 for all references

Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll switch to that. Better to be explicit on which python we need. (I just hope we never have to deal with a python4 someday :D)

Andrew

Quoted 89 lines
Signature · 2 lines
-- 
Chirag
Quoted 83 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +83 -0
+    python3-numpy \
+    python3-numpy-native \
+    python3-pybind11 \
+    python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+    python3 \
+    python3-numpy \
+    python3-protobuf \
+    python3-coloredlogs \
+    python3-flatbuffers \
+    python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+    -DBUILD_ONNX_PYTHON=ON \
+    -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+    -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+    -DBUILD_ONNX_PYTHON=OFF, \
+    ${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+    -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+    -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+    -DONNX_DISABLE_STATIC_REGISTRATION=ON \
+    -DONNX_ML=1 \
+    -DCMAKE_VERBOSE_MAKEFILE=ON \
+    --log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+    import os
+    import textwrap
+
+    version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py")
+    os.makedirs(os.path.dirname(version_file_path), exist_ok=True)
+    with open(version_file_path, "w", encoding="utf-8") as f:
+        f.write(
+            textwrap.dedent(
+                f"""\
+                # This file is generated. DO NOT EDIT!
+
+
+                version = "{d.getVar('PV')}"
+                git_version = "{d.getVar('SRCREV')}"
+                """
+            )
+        )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+    CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+    # Install the Python package.
+    if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+        (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+        cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR}
+        cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+    fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"
#12 lore raw

Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX

Quoted 82 lines · Andrew Davis via lists.yoctoproject.org
Quoted 81 lines · Chirag Shilwant

Hi Andrew,

Quoted 63 lines · Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
  ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++ .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++

  2 files changed, 132 insertions(+)

  create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +25 -0
new file mode 100644
index 00000000..dceac1f4
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See https://github.com/caffe2/caffe
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +14 -0
new file mode 100644
index 00000000..9624d061
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1"
+SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch"
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb line 24

Quoted 10 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +10 -0
+DEPENDS += "\
+    abseil-cpp \
+    protobuf \
+    protobuf-native \
+    python3-protobuf \
+    python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+    python3 \

Nitpick,

Quoted 8 lines
Quoted 4 lines

To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN) OR keep it static as python3 for all references

Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll switch to that. Better to be explicit on which python we need. (I just hope we never have to deal with a python4 someday :D)

Heh, you never know. We've dealt with python2/python3 and needing to support both, as well as Qt3/Qt4/Qt5 (and Qt6 now), and gstreamer 0.10 vs. 1.0...

Quoted 84 lines
Quoted 84 lines
Quoted 84 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +83 -0
+    python3-numpy \
+    python3-numpy-native \
+    python3-pybind11 \
+    python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+    python3 \
+    python3-numpy \
+    python3-protobuf \
+    python3-coloredlogs \
+    python3-flatbuffers \
+    python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+    -DBUILD_ONNX_PYTHON=ON \
+    -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+    -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+    -DBUILD_ONNX_PYTHON=OFF, \
+    ${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+    -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+    -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+    -DONNX_DISABLE_STATIC_REGISTRATION=ON \
+    -DONNX_ML=1 \
+    -DCMAKE_VERBOSE_MAKEFILE=ON \
+    --log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+    import os
+    import textwrap
+
+    version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py")
+    os.makedirs(os.path.dirname(version_file_path), exist_ok=True)
+    with open(version_file_path, "w", encoding="utf-8") as f:
+        f.write(
+            textwrap.dedent(
+                f"""\
+                # This file is generated. DO NOT EDIT!
+
+
+                version = "{d.getVar('PV')}"
+                git_version = "{d.getVar('SRCREV')}"
+                """
+            )
+        )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+    CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+    # Install the Python package.
+    if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+        (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+        cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR}
+        cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+    fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"
#13 lore raw

Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX

In reply to Andrew Davis
Quoted 95 lines · Andrew Davis
Quoted 89 lines · Chirag Shilwant

Hi Andrew,

Quoted 71 lines · Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
  ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++ .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++

  2 files changed, 132 insertions(+)

  create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb

(quoted diff) +0 -0
new file mode 100644
index 00000000..dceac1f4

b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +4 -0
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it 

was found

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +19 -0
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR 

((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf)) +   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See
https://github.com/caffe2/caffe

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +5 -0
new file mode 100644
index 00000000..9624d061
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = 

"file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +4 -0
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = 

"git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1" +SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch"

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +4 -0
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb line 24

Quoted 10 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +10 -0
+DEPENDS += "\
+    abseil-cpp \
+    protobuf \
+    protobuf-native \
+    python3-protobuf \
+    python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+    python3 \

Nitpick,

Quoted 4 lines

To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN) OR keep it static as python3 for all references

Quoted 5 lines

Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll switch to that. Better to be explicit on which python we need. (I just hope we never have to deal with a python4 someday :D)

Andrew

Does this mean a v2 is coming for this series? I'm getting a little lost since you keep sending some of the same patches under new series names... I'll wait to process all of these until we get the v2.

Quoted 96 lines
Quoted 96 lines
Signature · 2 lines
-- 
Chirag
Quoted 90 lines

+    python3-numpy \
+    python3-numpy-native \
+    python3-pybind11 \
+    python3-pybind11-native \
+"

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +39 -2
+
+PYTHON_RDEPENDS = "\
+    python3 \
+    python3-numpy \
+    python3-protobuf \
+    python3-coloredlogs \
+    python3-flatbuffers \
+    python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+    -DBUILD_ONNX_PYTHON=ON \
+    -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+    -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+    -DBUILD_ONNX_PYTHON=OFF, \
+    ${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, 
-D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, 
-DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+    -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+    -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+    -DONNX_DISABLE_STATIC_REGISTRATION=ON \
+    -DONNX_ML=1 \
+    -DCMAKE_VERBOSE_MAKEFILE=ON \
+    --log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+    import os
+    import textwrap
+
+    version_file_path = os.path.join(d.getVar('B'), "onnx", 

"version.py")
+    os.makedirs(os.path.dirname(version_file_path), exist_ok=True) +    with open(version_file_path, "w", encoding="utf-8") as f:
+        f.write(
+            textwrap.dedent(
+                f"""\
+                # This file is generated. DO NOT EDIT!

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +15 -0
+
+
+                version = "{d.getVar('PV')}"
+                git_version = "{d.getVar('SRCREV')}"
+                """
+            )
+        )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+    CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+    # Install the Python package.
+    if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 

'false', d)}; then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx +        (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+        cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR} +        cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+    fi

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +12 -0
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to 

TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"

Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS
#14 lore raw

Re: [meta-arago][scarthgap/master][PATCH 5/6] meta-arago-extras: Add recipe for ONNX

Quoted 90 lines · Ryan Eatmon
Quoted 87 lines · Andrew Davis
Quoted 85 lines · Chirag Shilwant

Hi Andrew,

Quoted 63 lines · Andrew Davis

ONNX provides an open source format for AI models, both deep learning and traditional ML. It defines an extensible computation graph model, as well as definitions of built-in operators and standard data types.

---
  ...age-Protobuf-before-checking-if-it-w.patch |  25 ++++ .../recipes-framework/onnx/onnx_1.16.1.bb     | 107 ++++++++++++++++++

  2 files changed, 132 insertions(+)

  create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb

meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch new file +25 -0
new file mode 100644
index 00000000..dceac1f4
@@ -0,0 +1,25 @@
+From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 11:44:56 -0600
+Subject: [PATCH] Try to find package Protobuf before checking if it was found
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ CMakeLists.txt | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b666eec4..f6fbf159 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS)
+   set(googletest_STATIC_LIBRARIES GTest::gtest)
+ endif()
+
++find_package(Protobuf)
++
+ if((ONNX_USE_LITE_PROTO AND TARGET protobuf::libprotobuf-lite) OR ((NOT ONNX_USE_LITE_PROTO) AND TARGET protobuf::libprotobuf))
+   # Sometimes we need to use protoc compiled for host architecture while linking
+   # libprotobuf against target architecture. See https://github.com/caffe2/caffe
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +14 -0
new file mode 100644
index 00000000..9624d061
@@ -0,0 +1,107 @@
+DESCRIPTION = "Open standard for machine learning interoperability"
+SUMMARY = "ONNX Python package & C++ library"
+HOMEPAGE = "https://www.onnx.ai/"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1"
+SRC_URI += "file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch"
+SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad"
+
+S = "${WORKDIR}/git"
+

meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb line 24

Quoted 10 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +10 -0
+DEPENDS += "\
+    abseil-cpp \
+    protobuf \
+    protobuf-native \
+    python3-protobuf \
+    python3-protobuf-native \
+"
+
+PYTHON_DEPENDS = "\
+    python3 \

Nitpick,

To have a consistency across the entire recipe,
I think it would be better to use PYTHON_PN (as done at PACKAGE_BEFORE_PN) OR keep it static as python3 for all references

Quoted 8 lines
Quoted 5 lines

Good idea, seems most recipes just use "python3" and not PYTHON_PN, so I'll switch to that. Better to be explicit on which python we need. (I just hope we never have to deal with a python4 someday :D)

Andrew

Does this mean a v2 is coming for this series?  I'm getting a little lost since you keep sending some of the same patches under new series names...  I'll wait to process all of these until we get the v2.

Yes, I'll send a v2 once things settle down in -next/-wip. I see my ArmNN package got dropped (which is fine, I have a newer version anyway), but it also means until something goes into master I can't consider it done and drop from my queue. Which means I'll end up resending it if I send against scarthgap/master.

I could base my series against your -next/-wip branches, but as above they are not stable branches and things can get lost..

Scarthgap/master have not moved in ~7 weeks now, so my patch backlog is getting a bit out of hand now. Maybe we should look into a manual promotion if LTS migration/testing is going to hold us up this long :/

Andrew

Quoted 92 lines
Quoted 91 lines
Quoted 91 lines
Signature · 2 lines
-- 
Chirag
Quoted 83 lines
meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb new file +83 -0
+    python3-numpy \
+    python3-numpy-native \
+    python3-pybind11 \
+    python3-pybind11-native \
+"
+
+PYTHON_RDEPENDS = "\
+    python3 \
+    python3-numpy \
+    python3-protobuf \
+    python3-coloredlogs \
+    python3-flatbuffers \
+    python3-sympy \
+"
+
+PACKAGECONFIG ??= "python sharedlib unittests"
+
+PACKAGECONFIG[python] = "\
+    -DBUILD_ONNX_PYTHON=ON \
+    -DPYTHON_LIBRARY=${PYTHON_LIBRARY} \
+    -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIR}, \
+    -DBUILD_ONNX_PYTHON=OFF, \
+    ${PYTHON_DEPENDS} \
+"
+
+PACKAGECONFIG[sharedlib] = "-DBUILD_SHARED_LIBS=ON, -D-DBUILD_SHARED_LIBS=OFF"
+PACKAGECONFIG[unittests] = "-DONNX_BUILD_TESTS=ON, -DONNX_BUILD_TESTS=OFF, googletest"
+
+EXTRA_OECMAKE:append = " \
+    -DONNX_CUSTOM_PROTOC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/protoc \
+    -DONNX_USE_PROTOBUF_SHARED_LIBS=ON \
+    -DONNX_DISABLE_STATIC_REGISTRATION=ON \
+    -DONNX_ML=1 \
+    -DCMAKE_VERBOSE_MAKEFILE=ON \
+    --log-level=VERBOSE \
+"
+
+inherit python3native cmake
+
+python do_build_version_file() {
+    import os
+    import textwrap
+
+    version_file_path = os.path.join(d.getVar('B'), "onnx", "version.py")
+    os.makedirs(os.path.dirname(version_file_path), exist_ok=True)
+    with open(version_file_path, "w", encoding="utf-8") as f:
+        f.write(
+            textwrap.dedent(
+                f"""\
+                # This file is generated. DO NOT EDIT!
+
+
+                version = "{d.getVar('PV')}"
+                git_version = "{d.getVar('SRCREV')}"
+                """
+            )
+        )
+}
+addtask build_version_file before do_install after do_compile
+
+do_install:append() {
+    CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
+
+    # Install the Python package.
+    if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
+        install -d ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+        (cd ${S}/onnx; cp --parents $(find . -name "*.py*") ${D}${PYTHON_SITEPACKAGES_DIR}/onnx)
+        cp $CP_ARGS ${B}/onnx ${D}${PYTHON_SITEPACKAGES_DIR}
+        cp $CP_ARGS ${B}/onnx_cpp2py_export.so ${D}${PYTHON_SITEPACKAGES_DIR}/onnx
+    fi
+}
+
+# Add Python package
+PACKAGE_BEFORE_PN += "${PYTHON_PN}-${PN}"
+FILES:${PYTHON_PN}-${PN} += "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS:${PYTHON_PN}-${PN} += "${PYTHON_RDEPENDS} onnx"
+
+# Output library is unversioned
+SOLIBS = ".so"
+FILES_SOLIBSDEV = ""
+
+# TODO: ONNXConfig.cmake in package onnx-dev contains reference to TMPDIR
+INSANE_SKIP:${PN}-dev = "buildpaths"
#15 lore raw

PATCH 6/6 meta-arago-extras: Add recipe for ONNX Runtime

In reply to Andrew Davis

ONNX Runtime is a cross-platform inference and training machine-learning accelerator. ONNX Runtime is compatible with different hardware, drivers, and operating systems, and provides optimal performance by leveraging hardware accelerators where applicable alongside graph optimizations and transforms.

---
 ...ble-permission-bit-from-source-files.patch |  72 ++++++++
 ...-in-option-text-s-buildings-bindings.patch |  25 +++
 ...D_LIBRARY_PATH-to-search-path-when-n.patch |  32 ++++
 ...MAKE_CXX_FLAGS-in-build-information-.patch |  31 ++++
 ...ake-Print-out-result-of-find_package.patch |  37 +++++
 .../onnxruntime/onnxruntime_1.20.1.bb         | 155 ++++++++++++++++++
 6 files changed, 352 insertions(+)
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch
 create mode 100644 meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0001-Remove-executable-permission-bit-from-source-files.patch new file +72 -0
new file mode 100644
index 00000000..c890f0bd
@@ -0,0 +1,72 @@
+From 626066499c34c524924302342fc071f32442caae Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Sun, 12 Jan 2025 12:48:49 -0600
+Subject: [PATCH] Remove executable permission bit from source files
+
+These are source files, not executables, do not set the executable
+permission bit on these files.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ onnxruntime/contrib_ops/cpu/utils/console_dumper.h           | 1 +
+ onnxruntime/core/optimizer/bias_softmax_fusion.cc            | 0
+ onnxruntime/core/providers/acl/acl_execution_provider.h      | 0
+ onnxruntime/core/providers/acl/acl_fwd.h                     | 0
+ onnxruntime/core/providers/acl/acl_provider_factory.cc       | 0
+ onnxruntime/core/providers/acl/math/gemm.cc                  | 0
+ onnxruntime/core/providers/acl/nn/batch_norm.cc              | 0
+ onnxruntime/core/providers/acl/nn/batch_norm.h               | 0
+ onnxruntime/test/optimizer/graph_transform_test.cc           | 0
+ onnxruntime/test/optimizer/graph_transform_test_layernorm.cc | 0
+ 10 files changed, 1 insertion(+)
+ mode change 100755 => 100644 onnxruntime/core/optimizer/bias_softmax_fusion.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_execution_provider.h
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_fwd.h
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/acl_provider_factory.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/math/gemm.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.cc
+ mode change 100755 => 100644 onnxruntime/core/providers/acl/nn/batch_norm.h
+ mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test.cc
+ mode change 100755 => 100644 onnxruntime/test/optimizer/graph_transform_test_layernorm.cc
+
+diff --git a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
+index 9ebc44f441..64bd2b7b18 100644
+--- a/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
++++ b/onnxruntime/contrib_ops/cpu/utils/console_dumper.h
+@@ -3,6 +3,7 @@
+ 
+ #pragma once
+ #include <string>
++#include <iostream>
+ #include "core/framework/ort_value.h"
+ #include "core/framework/float16.h"
+ #include "contrib_ops/cpu/utils/debug_macros.h"
+diff --git a/onnxruntime/core/optimizer/bias_softmax_fusion.cc b/onnxruntime/core/optimizer/bias_softmax_fusion.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_execution_provider.h b/onnxruntime/core/providers/acl/acl_execution_provider.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_fwd.h b/onnxruntime/core/providers/acl/acl_fwd.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/acl_provider_factory.cc b/onnxruntime/core/providers/acl/acl_provider_factory.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/math/gemm.cc b/onnxruntime/core/providers/acl/math/gemm.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.cc b/onnxruntime/core/providers/acl/nn/batch_norm.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/core/providers/acl/nn/batch_norm.h b/onnxruntime/core/providers/acl/nn/batch_norm.h
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/test/optimizer/graph_transform_test.cc b/onnxruntime/test/optimizer/graph_transform_test.cc
+old mode 100755
+new mode 100644
+diff --git a/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc b/onnxruntime/test/optimizer/graph_transform_test_layernorm.cc
+old mode 100755
+new mode 100644
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0002-cmake-Fix-typo-in-option-text-s-buildings-bindings.patch new file +25 -0
new file mode 100644
index 00000000..88423190
@@ -0,0 +1,25 @@
+From be67663e9a44d146033aeb97804145a60b4032db Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 12:35:03 -0600
+Subject: [PATCH] [cmake] Fix typo in option text s/buildings/bindings
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ cmake/CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
+index d90a2a3550..e0cde678db 100644
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -77,7 +77,7 @@ option(onnxruntime_GENERATE_TEST_REPORTS "Enable test report generation" OFF)
+ option(onnxruntime_ENABLE_STATIC_ANALYSIS "Enable static analysis" OFF)
+ option(onnxruntime_USE_CUSTOM_STATIC_ANALYSIS_RULES "Use a custom SDL Rule. It is mainly for our CI build" OFF)
+ option(onnxruntime_REDIRECT_STATIC_ANALYSIS_OUTPUTS_TO_FILE "Use a custom SDL Rule. It is mainly for our CI build" OFF)
+-option(onnxruntime_ENABLE_PYTHON "Enable python buildings" OFF)
++option(onnxruntime_ENABLE_PYTHON "Enable python bindings" OFF)
+ # Enable it may cause LNK1169 error
+ option(onnxruntime_ENABLE_MEMLEAK_CHECKER "Experimental: Enable memory leak checker in Windows debug build" OFF)
+ option(onnxruntime_USE_CUDA "Build with CUDA support" OFF)
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0003-ACL-Do-not-add-LD_LIBRARY_PATH-to-search-path-when-n.patch new file +32 -0
new file mode 100644
index 00000000..cd979b76
@@ -0,0 +1,32 @@
+From b1689f3f963f4c07d3329a838569ac4c2fa2bd5f Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 12:38:13 -0600
+Subject: [PATCH] [ACL] Do not add LD_LIBRARY_PATH to search path when not
+ defined
+
+If LD_LIBRARY_PATH is not defined a blank "-L" is added to the
+link command. This causes the next object to be linked to get
+treated as if it was a search path and causes link failure.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ cmake/onnxruntime_providers_acl.cmake | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/onnxruntime_providers_acl.cmake b/cmake/onnxruntime_providers_acl.cmake
+index e23d289271..19d41dc73f 100644
+--- a/cmake/onnxruntime_providers_acl.cmake
++++ b/cmake/onnxruntime_providers_acl.cmake
+@@ -13,7 +13,9 @@
+     onnxruntime_common onnxruntime_framework onnx onnx_proto ${PROTOBUF_LIB} flatbuffers::flatbuffers Boost::mp11 safeint_interface
+   )
+ 
+-  target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})
++  if (DEFINED ENV{LD_LIBRARY_PATH})
++    target_link_libraries(onnxruntime_providers_acl -L$ENV{LD_LIBRARY_PATH})
++  endif()
+   add_dependencies(onnxruntime_providers_acl ${onnxruntime_EXTERNAL_DEPENDENCIES})
+   set_target_properties(onnxruntime_providers_acl PROPERTIES FOLDER "ONNXRuntime")
+   target_include_directories(onnxruntime_providers_acl
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0004-Do-not-include-CMAKE_CXX_FLAGS-in-build-information-.patch new file +31 -0
new file mode 100644
index 00000000..46fc2fc5
@@ -0,0 +1,31 @@
+From 7ea6e35d3630f8c19080a0cb5a4a4c55c242a36b Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 12:40:57 -0600
+Subject: [PATCH] Do not include CMAKE_CXX_FLAGS in build information string
+
+While this information can be useful, it often includes information
+that may be specific to the build machine (like include paths with
+usernames, e.g. -I /home/myname/externalproject/fakeroot/inlcude).
+
+This causes issues for reproducible builds (resulting binaries will
+be different between different build machines).
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ cmake/CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
+index e0cde678db..e0d8fd0a17 100644
+--- a/cmake/CMakeLists.txt
++++ b/cmake/CMakeLists.txt
+@@ -1439,7 +1439,6 @@ if (Git_FOUND)
+   string(APPEND ORT_BUILD_INFO "git-branch=${ORT_GIT_BRANCH}, git-commit-id=${ORT_GIT_COMMIT}, ")
+ endif()
+ string(APPEND ORT_BUILD_INFO "build type=${CMAKE_BUILD_TYPE}")
+-string(APPEND ORT_BUILD_INFO ", cmake cxx flags: ${CMAKE_CXX_FLAGS}")
+ configure_file(onnxruntime_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/onnxruntime_config.h)
+ get_property(onnxruntime_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ 
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime/0005-cmake-Print-out-result-of-find_package.patch new file +37 -0
new file mode 100644
index 00000000..9bbe920b
@@ -0,0 +1,37 @@
+From a73d9b9f4dba6d164e128d6c768d1b0a04e969ab Mon Sep 17 00:00:00 2001
+From: Andrew Davis <[email protected]>
+Date: Thu, 16 Jan 2025 12:47:27 -0600
+Subject: [PATCH] [cmake] Print out result of find_package
+
+A verbose only message is already printed that states the CMake will
+attempt to find a package using find_package():
+
+> Trying find_package(...) before FetchContent
+
+But it never prints if the package was found this way or not.
+Add this result message.
+
+Upstream-Status: Pending
+
+Signed-off-by: Andrew Davis <[email protected]>
+---
+ cmake/external/helper_functions.cmake | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/cmake/external/helper_functions.cmake b/cmake/external/helper_functions.cmake
+index e3f2211f96..9ca6a967da 100644
+--- a/cmake/external/helper_functions.cmake
++++ b/cmake/external/helper_functions.cmake
+@@ -138,9 +138,12 @@ macro(onnxruntime_fetchcontent_makeavailable)
+         unset(__cmake_fpArgs)
+ 
+         if(${__cmake_contentName}_FOUND)
++          message(VERBOSE "Found ${__cmake_contentName} with find_package()")
+           FetchContent_SetPopulated(${__cmake_contentName})
+           FetchContent_GetProperties(${__cmake_contentName})
+           continue()
++        else()
++          message(VERBOSE "Could not find ${__cmake_contentName} with find_package()")
+         endif()
+       endif()
+     else()
meta-arago-extras/recipes-framework/onnxruntime/onnxruntime_1.20.1.bb new file +155 -0

155 lines not on this page · raw message

Signature · 1 line
2.39.2