From patchwork Tue Mar 3 08:11:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pratham Deshmukh X-Patchwork-Id: 82335 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B93F1E67A95 for ; Tue, 3 Mar 2026 08:11:36 +0000 (UTC) Received: from DM1PR04CU001.outbound.protection.outlook.com (DM1PR04CU001.outbound.protection.outlook.com [52.101.61.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13615.1772525490008287094 for ; Tue, 03 Mar 2026 00:11:30 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@ti.com header.s=selector1 header.b=baSs0bPI; spf=permerror, err=parse error for token &{10 18 spf.protection.outlook.com}: limit exceeded (domain: ti.com, ip: 52.101.61.41, mailfrom: p-deshmukh@ti.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GqDr+64tOs3zCYN8keFaKSABlNXAFiGp6lhWb/v23Dr5mGANnv6ujAMLtuXKFau8h+TGAd/Ig0Uk1F7558tsYtgsQiK4MF+7nwBnc3GK8zfihfwPqPeJcHNmtaMONiCEKIDdf+yr7+ooh3QnNUr8wVF6BZWawjOVVlsd1q+DAuFCmtVvVy2gy3Y+ze+xdi3rWJu/YlOpsjhz6+Utm2J9WML9Udma1AKKRbbn09fNWzh6YGzU/WAUePUAgb9S898wjO7U2src2ZV6n5gUujCwsFw4JL5068Y7fS+cJBVy9nCQV1RjgEZsQkqjFwh4CjodD9yR+CGd1I5qJWw47fvzXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/4+tqdqO4UGGNRTr6Y0SbP5F+JS7tcY2TpgQ0Slu+fw=; b=Rs4heZBfTEtBUO5azAQrJyJMM06isgWO+bITcsi70WfzPwpzmuzgaarzUrm0cRBf9QwTBic3M/se9HoHJYiM+3Od43vyAySHE4OW5yd7CBJ0Ws7zwIMlQzOlpUrdzxd7F+ZRDwEnZnVafgrzwDhl40OpLANFzfqN3z0JSBv0OyWAgRcPZe+MCO+y328SUbQiqE2p2VP0G5W7k9G/q1RNnIj/xqZt38O22GvpyHvqYf0WCRlFIPT1vGqWDn3z/xM7FigftTGClgFbbHImunSbu7pSF/a/tSe/LoqaZwPW6M/JlPHFtdBroiDsfAhBal9Ho9vhNBBCSkGRt1h0wSTh/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.195) smtp.rcpttodomain=konsulko.com smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/4+tqdqO4UGGNRTr6Y0SbP5F+JS7tcY2TpgQ0Slu+fw=; b=baSs0bPI6zr1Z3ct+pNGhzp6/MyZF39vWW+a/Djqog3F6+Jn03itIJjeMikmceVEnwgj4Lfar7nTh3MqTeZZ7q/dDN8lWX972EYsQAagmwPowJnMy+VGLTN+8TAIgAfroVjXayr34HM/oFB1wvyk2sbIoxI3tMqk9T6XaVMHDHo= Received: from BN0PR04CA0026.namprd04.prod.outlook.com (2603:10b6:408:ee::31) by DM3PR10MB7946.namprd10.prod.outlook.com (2603:10b6:0:4b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9654.21; Tue, 3 Mar 2026 08:11:26 +0000 Received: from BN2PEPF000044A4.namprd02.prod.outlook.com (2603:10b6:408:ee:cafe::36) by BN0PR04CA0026.outlook.office365.com (2603:10b6:408:ee::31) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9654.22 via Frontend Transport; Tue, 3 Mar 2026 08:11:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 198.47.21.195) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.195 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C Received: from flwvzet201.ext.ti.com (198.47.21.195) by BN2PEPF000044A4.mail.protection.outlook.com (10.167.243.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9654.16 via Frontend Transport; Tue, 3 Mar 2026 08:11:24 +0000 Received: from DFLE211.ent.ti.com (10.64.6.69) by flwvzet201.ext.ti.com (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 3 Mar 2026 02:11:13 -0600 Received: from DFLE210.ent.ti.com (10.64.6.68) by DFLE211.ent.ti.com (10.64.6.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Tue, 3 Mar 2026 02:11:12 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE210.ent.ti.com (10.64.6.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend Transport; Tue, 3 Mar 2026 02:11:12 -0600 Received: from pratham-TI.dhcp.ti.com (pratham-ti.dhcp.ti.com [172.24.233.101]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6238B6GH2262442; Tue, 3 Mar 2026 02:11:10 -0600 From: Pratham Deshmukh To: CC: , , , , , , Pratham Deshmukh Subject: [meta-arago][master][PATCH v2 1/2] onnx:upgrade 1.16.1 to 1.18.0 Date: Tue, 3 Mar 2026 13:41:04 +0530 Message-ID: <20260303081105.2111463-2-p-deshmukh@ti.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260303081105.2111463-1-p-deshmukh@ti.com> References: <20260303081105.2111463-1-p-deshmukh@ti.com> MIME-Version: 1.0 X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN2PEPF000044A4:EE_|DM3PR10MB7946:EE_ X-MS-Office365-Filtering-Correlation-Id: b7dd63d5-2c6f-4dbe-01ac-08de78fc7690 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|34020700016|82310400026|376014; X-Microsoft-Antispam-Message-Info: EzQ9k0x1KDHQjM+bABJ/m52UhjSy21MtZjK8rr/aG3Hp3/NhvI9DdfmVD30gPAIgBLvmLusFovuvqDQ90f4rj3TU+Rg8ThCAcaKz395kefzAUxuuFrzOLYMxm1OPF16LfrIp8TupoVSmjeiDVuiy/5rZCaFSSOWkgwYW5pRsAi+rFr5UgX6Y/ONkJspw0o9465l5UF5WsJ12g0aperdmBqpFv4OrCUD6RaT+XdCZydp6dcZxHcgectvzdJccq/U7NAYkIbwCHR3hY8k0Ax0ZRkuWakTADa61ZLrqs8f29iAh3FwJaxPDlQ0wBofSKYJRvULB2kwjWdYmtOlbFlubsH9p51xWfvIZrGwBn0yl0oDF7wGGd+qYgnkb2gn4Z9FPL8Blo1GO0YnSj0zHrF3ORCpAbs6UhZ48brR1M/k7AQmKceXC1nTgH/eSH3Xdjaib0gBTDKaIuQ2fqhnVXVJNJJVlotswp2MKpknHMkQtBPIDQXYT17mol2GexBkiK11QQY8mm9NADDM4nhemw8RCNf/Q9l7kJR1x5Ev2BaXzdCcyxL5doPa+z7875nNKqFHNMzDAHa5jFvOddE+OfEpT+vCgRIZMVNcVL3aGz0txBVsbxbbT5diV8mk+2uc5KlcL4mkjLZT5sBSWY0/qpmHkr9vAvhjKofl3wFvhKD+JP1CVFqTnSn20fKNWgqafa0g97L5d4lXNU9/wH3Gg3DX+2rmRfDDAhnU/nevOR4C9s3ogKKHl8bYSmveltfjuF2IAVN0N1Rq0y1w8ozn7LEvNvqYDyoPMGoYwLAZfNJEqqV8= X-Forefront-Antispam-Report: CIP:198.47.21.195;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet201.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(34020700016)(82310400026)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eE97/Fdz7rGTNcGkolSva6Ljih3wxbiubVoH+S3mNOiqjNN0uBixbJmEUC2RJ/2V4F6O039B8uPQi0bv6ll+wPR4kocpR10wXoF7lD8i4t8yzElhfMvTuFTbuNN1uHOaY1UeeUmOXcpTOT2NjTZ/RK84rKYlUgXeZ0M7cbc8jp6ilTTb6R6ZAGBSJrwVMVc37PXHymoqbDTNiZuMYQaeTyJcSpeiiSJBOEzKlGrqHuq0R0+5+bGLiu/fDkBxE9T9RL1bUbfi8WK4oQo6ioe3vgCekF2BVki/oN2kGjmMs0tR2yN81TgXOAqzxMaLjqxCvovjVJ4aFvpPf+ecT0kkQDP7uWKZObjj2vp3ec0Kr0P0i9UluBj4mDwtQr0HEV+uQcgCejLN+sqk6NzHI4XFNHoXno649uVs88TE0esqSBGqQ3rm/RIMGc+DOdBkoRRb X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2026 08:11:24.8269 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7dd63d5-2c6f-4dbe-01ac-08de78fc7690 X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.195];Helo=[flwvzet201.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BN2PEPF000044A4.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR10MB7946 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 03 Mar 2026 08:11:36 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/meta-arago/message/17187 We are migrating ONNX from v1.16.1 to the stable release v1.18.0. Removed Patches: • 0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch - Updated with new commit • 0002-Do-not-re-export-internal-targets-directories.patch - Updated with new commit Added Patches (New Requirements): • 0001-Apply-onnx-patch.patch - Applies onnx.patch compatibility patch for separate builds • 0002-cmake-Fix-Protobuf-target-check-by-calling-find_pack.patch - Ensures proper Protobuf target detection before usage • 0003-cmake-Remove-Protobuf-directory-exports-from-config-.patch - Prevents CMake configuration conflicts in dependent packages • 0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch - Fixes linker errors during test executable creation • 0005-Fix-symbol-visibility-when-tests-are-enabled.patch - Resolves symbol visibility issues causing runtime failures. The upgrade is needed to support ONNXRuntime 1.23.2 which requires ONNX 1.18.0 as minimum version. Signed-off-by: Pratham Deshmukh --- .../onnx/onnx/0001-Apply-onnx-patch.patch | 197 ++++++++++++++++++ ...f-target-check-by-calling-find_pack.patch} | 29 ++- ...obuf-directory-exports-from-config-.patch} | 29 ++- ...en-trying-to-create-the-final-onnx_g.patch | 34 +++ ...ol-visibility-when-tests-are-enabled.patch | 36 ++++ .../onnx/{onnx_1.16.1.bb => onnx_1.18.0.bb} | 11 +- 6 files changed, 313 insertions(+), 23 deletions(-) create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0001-Apply-onnx-patch.patch rename meta-arago-extras/recipes-framework/onnx/onnx/{0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch => 0002-cmake-Fix-Protobuf-target-check-by-calling-find_pack.patch} (40%) rename meta-arago-extras/recipes-framework/onnx/onnx/{0002-Do-not-re-export-internal-targets-directories.patch => 0003-cmake-Remove-Protobuf-directory-exports-from-config-.patch} (41%) create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch create mode 100644 meta-arago-extras/recipes-framework/onnx/onnx/0005-Fix-symbol-visibility-when-tests-are-enabled.patch rename meta-arago-extras/recipes-framework/onnx/{onnx_1.16.1.bb => onnx_1.18.0.bb} (87%) diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0001-Apply-onnx-patch.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Apply-onnx-patch.patch new file mode 100644 index 00000000..305736e7 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0001-Apply-onnx-patch.patch @@ -0,0 +1,197 @@ +From 93894db295857ca77cf385a5d39c565ee3e0c2fd Mon Sep 17 00:00:00 2001 +From: Pratham Deshmukh +Date: Thu, 12 Feb 2026 17:22:13 +0530 +Subject: [PATCH 1/5] Apply onnx patch + +ONNXRuntime's CMake uses FetchContent to download ONNX as a dependency. +Our onnxruntime recipe uses FETCHCONTENT_FULLY_DISCONNECTED=ON so instead +of letting ONNXRuntime fetch ONNX, we build ONNX separately using the +onnx_1.18.0.bb recipe.The onnxruntime recipe then references the pre-built +ONNX from the sysroot. Since ONNX was built separately without the patch, +the fixes that ONNXRuntime expects are missing + +We need to apply the patch [0] separately to avoid errors. + +[0] https://github.com/microsoft/onnxruntime/blob/rel-1.23.2/cmake/patches/onnx/onnx.patch + +Upstream-Status: Inappropriate [oe specific integration patch] + +Signed-off-by: Pratham Deshmukh +--- + CMakeLists.txt | 52 +++++++++++++++++++------------------------ + onnx/defs/nn/defs.cc | 6 ++--- + onnx/defs/nn/old.cc | 1 - + onnx/defs/rnn/defs.cc | 2 +- + onnx/defs/schema.h | 6 ++--- + 5 files changed, 30 insertions(+), 37 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 8b5af3038..8593fe4a3 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -40,6 +40,7 @@ option(ONNX_USE_LITE_PROTO "Use lite protobuf instead of full." OFF) + option(ONNX_DISABLE_EXCEPTIONS "Disable exception handling." OFF) + option(ONNX_DISABLE_STATIC_REGISTRATION "Disable static registration for ONNX operator schemas." OFF) + option(ONNX_USE_UNITY_BUILD "Enable Unity (Jumbo) build for" OFF) ++option(ONNX_MINIMAL_BUILD "Build only essential ONNX components" OFF) + if(WIN32) + option(ONNX_USE_MSVC_STATIC_RUNTIME "Build with MSVC static runtime" OFF) + endif() +@@ -461,14 +462,28 @@ relative_protobuf_generate_cpp(gen_onnx_data_proto + list(APPEND ONNX_PROTO_SRCS ${__tmp_srcs}) + list(APPEND ONNX_PROTO_HDRS ${__tmp_hdrs}) + +-file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") +-file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" +- "${ONNX_ROOT}/onnx/test/cpp/*.cc" +- "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc" +- "${ONNX_ROOT}/onnx/backend/test/cpp/*.h") +-list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc") +-list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src}) +-list(APPEND ONNX_SRCS ${__tmp_srcs}) ++if(ONNX_MINIMAL_BUILD) ++ message(STATUS "Configuring ONNX minimal build") ++ set(ONNX_SRCS ++ "${ONNX_ROOT}/onnx/common/common.h" ++ "${ONNX_ROOT}/onnx/defs/data_type_utils.h" ++ "${ONNX_ROOT}/onnx/defs/data_type_utils.cc" ++ ) ++ # Ensure ONNX_ML is treated as ON for minimal build consistency with ORT's file ++ set(ONNX_ML ON CACHE BOOL "Enable traditional ML API." FORCE) ++ # Minimal build doesn't need Python or tests ++ set(ONNX_BUILD_PYTHON OFF CACHE BOOL "Build Python binaries" FORCE) ++ set(ONNX_BUILD_TESTS OFF CACHE BOOL "Build ONNX C++ APIs Tests" FORCE) ++else() ++ file(GLOB_RECURSE __tmp_srcs "${ONNX_ROOT}/onnx/*.h" "${ONNX_ROOT}/onnx/*.cc") ++ file(GLOB_RECURSE onnx_gtests_src "${ONNX_ROOT}/onnx/test/cpp/*.h" ++ "${ONNX_ROOT}/onnx/test/cpp/*.cc" ++ "${ONNX_ROOT}/onnx/backend/test/cpp/*.cc" ++ "${ONNX_ROOT}/onnx/backend/test/cpp/*.h") ++ list(REMOVE_ITEM __tmp_srcs "${ONNX_ROOT}/onnx/cpp2py_export.cc") ++ list(REMOVE_ITEM __tmp_srcs ${onnx_gtests_src}) ++ list(APPEND ONNX_SRCS ${__tmp_srcs}) ++endif() + + add_library(onnx_proto ${ONNX_PROTO_SRCS} ${ONNX_PROTO_HDRS}) + add_dependencies(onnx_proto gen_onnx_operators_proto gen_onnx_data_proto) +@@ -595,13 +610,6 @@ if(ONNX_BUILD_PYTHON) + target_link_libraries(onnx_cpp2py_export PRIVATE ${Python3_LIBRARIES}) + target_compile_options(onnx_cpp2py_export + PRIVATE /MP +- /wd4146 # unary minus operator applied to unsigned type, +- # result still unsigned +- /wd4244 # 'argument': conversion from 'google:: +- # protobuf::uint64' to 'int', possible +- # loss of data +- /wd4267 # Conversion from 'size_t' to 'int', +- # possible loss of data + ${EXTRA_FLAGS}) + add_msvc_runtime_flag(onnx_cpp2py_export) + add_onnx_global_defines(onnx_cpp2py_export) +@@ -618,23 +626,9 @@ endif() + if(MSVC) + target_compile_options(onnx_proto + PRIVATE /MP +- /wd4146 # unary minus operator applied to unsigned type, +- # result still unsigned +- /wd4244 #'argument': conversion from 'google:: +- #protobuf::uint64' to 'int', possible +- # loss of data +- /wd4267 # Conversion from 'size_t' to 'int', +- # possible loss of data + ${EXTRA_FLAGS}) + target_compile_options(onnx + PRIVATE /MP +- /wd4146 # unary minus operator applied to unsigned type, +- # result still unsigned +- /wd4244 # 'argument': conversion from 'google:: +- # protobuf::uint64' to 'int', possible +- # loss of data +- /wd4267 # Conversion from 'size_t' to 'int', +- # possible loss of data + ${EXTRA_FLAGS}) + add_msvc_runtime_flag(onnx_proto) + add_msvc_runtime_flag(onnx) +diff --git a/onnx/defs/nn/defs.cc b/onnx/defs/nn/defs.cc +index 643662708..4aed90278 100644 +--- a/onnx/defs/nn/defs.cc ++++ b/onnx/defs/nn/defs.cc +@@ -36,7 +36,7 @@ static const char* conv_transpose_auto_pad_doc = + "on whether it is even or odd). In case the padding is an odd number, the extra " + "padding is added at the end for SAME_UPPER and at the beginning for SAME_LOWER."; + +-static void convPoolShapeInference( ++void convPoolShapeInference( + InferenceContext& ctx, + bool use_dilation, + bool require_kernel_shape, +@@ -1102,7 +1102,7 @@ ONNX_OPERATOR_SET_SCHEMA( + convPoolShapeInference(ctx, true, false, 0, 1); + })); + +-static void convTransposeShapeInference(InferenceContext& ctx) { ++void convTransposeShapeInference(InferenceContext& ctx) { + propagateElemTypeFromInputToOutput(ctx, 0, 0); + + // we need at least two inputs to have a shape for this inference. +@@ -1462,7 +1462,7 @@ ONNX_OPERATOR_SET_SCHEMA( + })); + + // For GlobalPool operations. +-static void globalPoolTypeShapeInference(InferenceContext& ctx) { ++void globalPoolTypeShapeInference(InferenceContext& ctx) { + propagateElemTypeFromInputToOutput(ctx, 0, 0); + + // needs at least one input with shape. +diff --git a/onnx/defs/nn/old.cc b/onnx/defs/nn/old.cc +index d8ca9a46f..1eda4c70b 100644 +--- a/onnx/defs/nn/old.cc ++++ b/onnx/defs/nn/old.cc +@@ -4023,7 +4023,6 @@ ONNX_OPERATOR_SET_SCHEMA( + GroupNormalization, + 18, + OpSchema() +- .Deprecate() + .SetDoc(GroupNormalization_ver18_doc) + .Attr("epsilon", "The epsilon value to use to avoid division by zero.", AttributeProto::FLOAT, 1e-5f) + .Attr( +diff --git a/onnx/defs/rnn/defs.cc b/onnx/defs/rnn/defs.cc +index c0ed3a393..6c8e29092 100644 +--- a/onnx/defs/rnn/defs.cc ++++ b/onnx/defs/rnn/defs.cc +@@ -5,7 +5,7 @@ + #include "onnx/defs/schema.h" + + namespace ONNX_NAMESPACE { +-static void RNNShapeInference(InferenceContext& ctx) { ++void RNNShapeInference(InferenceContext& ctx) { + TensorShapeProto::Dimension num_directions, seq_length, batch_size, hidden_size; + + auto direction = getAttribute(ctx, "direction", "forward"); +diff --git a/onnx/defs/schema.h b/onnx/defs/schema.h +index acf3aac7e..62c61fd97 100644 +--- a/onnx/defs/schema.h ++++ b/onnx/defs/schema.h +@@ -980,7 +980,7 @@ class OpSchemaRegistry final : public ISchemaRegistry { + class OpSchemaRegisterOnce final { + public: + // Export to cpp custom register macro +- explicit OpSchemaRegisterOnce( ++ OpSchemaRegisterOnce( + OpSchema op_schema, + int opset_version_to_load = 0, + bool fail_duplicate_schema = true) { +@@ -1312,8 +1312,8 @@ size_t ReplaceAll(std::string& s, const char* from, const char* to); + #define ONNX_OPERATOR_SCHEMA(name) ONNX_OPERATOR_SCHEMA_UNIQ_HELPER(__COUNTER__, name) + #define ONNX_OPERATOR_SCHEMA_UNIQ_HELPER(Counter, name) ONNX_OPERATOR_SCHEMA_UNIQ(Counter, name) + #define ONNX_OPERATOR_SCHEMA_UNIQ(Counter, name) \ +- static ONNX_NAMESPACE::OpSchemaRegistry::OpSchemaRegisterOnce(op_schema_register_once##name##Counter) ONNX_UNUSED = \ +- OpSchema(#name, __FILE__, __LINE__) ++ static ONNX_NAMESPACE::OpSchemaRegistry::OpSchemaRegisterOnce op_schema_register_once##name##Counter ONNX_UNUSED = \ ++ ONNX_NAMESPACE::OpSchema(#name, __FILE__, __LINE__) + + // Helper function + size_t ReplaceAll(std::string& s, const char* from, const char* to); +-- +2.34.1 + diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0002-cmake-Fix-Protobuf-target-check-by-calling-find_pack.patch similarity index 40% rename from meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch rename to meta-arago-extras/recipes-framework/onnx/onnx/0002-cmake-Fix-Protobuf-target-check-by-calling-find_pack.patch index e35b27de..8c01a2c7 100644 --- a/meta-arago-extras/recipes-framework/onnx/onnx/0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0002-cmake-Fix-Protobuf-target-check-by-calling-find_pack.patch @@ -1,25 +1,36 @@ -From 7e118775c120ec802d13ac3e0125d726323aee87 Mon Sep 17 00:00:00 2001 -From: Andrew Davis -Date: Thu, 16 Jan 2025 11:44:56 -0600 -Subject: [PATCH] Try to find package Protobuf before checking if it was found +From b6628fa7ee3acd35076d617157342b25c432715b Mon Sep 17 00:00:00 2001 +From: Pratham Deshmukh +Date: Thu, 12 Feb 2026 17:23:40 +0530 +Subject: [PATCH 2/5] cmake: Fix Protobuf target check by calling find_package + first + +Add find_package(Protobuf) before checking if protobuf targets exist +in the ONNX_BUILD_CUSTOM_PROTOBUF conditional. This ensures Protobuf +targets are properly defined before being referenced. + +Without this change, the target existence checks fails even when +Protobuf is available. Upstream-Status: Pending -Signed-off-by: Andrew Davis +Signed-off-by: Pratham Deshmukh --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt -index b666eec4..f6fbf159 100644 +index 8593fe4a3..9fed84add 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -127,6 +127,8 @@ if(ONNX_BUILD_TESTS) +@@ -142,6 +142,8 @@ if(ONNX_BUILD_TESTS) set(googletest_STATIC_LIBRARIES GTest::gtest) endif() - + +find_package(Protobuf) + + if(NOT ONNX_BUILD_CUSTOM_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 +-- +2.34.1 + diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0003-cmake-Remove-Protobuf-directory-exports-from-config-.patch similarity index 41% rename from meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch rename to meta-arago-extras/recipes-framework/onnx/onnx/0003-cmake-Remove-Protobuf-directory-exports-from-config-.patch index d6cc85e7..c6e9c698 100644 --- a/meta-arago-extras/recipes-framework/onnx/onnx/0002-Do-not-re-export-internal-targets-directories.patch +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0003-cmake-Remove-Protobuf-directory-exports-from-config-.patch @@ -1,28 +1,37 @@ -From 0bdd879060cb5022b62d06bff0f21a21c3be18ca Mon Sep 17 00:00:00 2001 -From: Andrew Davis -Date: Mon, 3 Feb 2025 11:28:52 -0600 -Subject: [PATCH] Do not re-export internal targets directories +From 6ce0573c3661424c5723f9bab6773a3f6ede79fd Mon Sep 17 00:00:00 2001 +From: Pratham Deshmukh +Date: Thu, 12 Feb 2026 17:24:56 +0530 +Subject: [PATCH 3/5] cmake: Remove Protobuf directory exports from config + template -These can be specific to a given project build and should not -be automatically inherited to dependent projects. +Remove CMAKE_PREFIX_PATH and Protobuf_INCLUDE_DIR exports from +ONNXConfig.cmake.in as these paths are specific to the ONNX build +environment and should not be propagated to dependent projects. + +Dependent projects should find Protobuf through their own +find_package(Protobuf REQUIRED) call instead of inheriting +build-specific paths. Upstream-Status: Pending -Signed-off-by: Andrew Davis +Signed-off-by: Pratham Deshmukh --- cmake/ONNXConfig.cmake.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmake/ONNXConfig.cmake.in b/cmake/ONNXConfig.cmake.in -index d588f8ae..a61af089 100644 +index d588f8ae1..a61af0894 100644 --- a/cmake/ONNXConfig.cmake.in +++ b/cmake/ONNXConfig.cmake.in @@ -6,8 +6,6 @@ # library version information set(ONNX_VERSION "@ONNX_VERSION@") - + -list(APPEND CMAKE_PREFIX_PATH "@PROTOBUF_DIR@") -set(Protobuf_INCLUDE_DIR "@PROTOBUF_INCLUDE_DIR@") find_package(Protobuf REQUIRED) - + # import targets +-- +2.34.1 + diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch new file mode 100644 index 00000000..8422dcea --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch @@ -0,0 +1,34 @@ +From 8e19cae53e24126cb57e486e0e7da96f02b3cbf7 Mon Sep 17 00:00:00 2001 +From: Pratham Deshmukh +Date: Thu, 12 Feb 2026 17:26:07 +0530 +Subject: [PATCH 4/5] Linker failed when trying to create the final onnx_gtests + executable + +The main onnx library target was missing the ONNX_API compile +definitions that are needed to properly export symbols on Linux +platforms with hidden visibility. This causes undefined reference +errors when linking tests because symbols like OpSchemaRegistry::Schema() +are not visible. + +Upstream-Status: Pending + +Signed-off-by: Pratham Deshmukh +--- + CMakeLists.txt | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9fed84add..89d4fed84 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -547,6 +547,7 @@ target_include_directories(onnx PUBLIC + $) + target_link_libraries(onnx PUBLIC onnx_proto) + add_onnx_global_defines(onnx) ++target_compile_definitions(onnx PRIVATE ${ONNX_API_DEFINE}) + + if(ONNX_BUILD_PYTHON) + Python3_add_library(onnx_cpp2py_export MODULE WITH_SOABI "${ONNX_ROOT}/onnx/cpp2py_export.cc") +-- +2.34.1 + diff --git a/meta-arago-extras/recipes-framework/onnx/onnx/0005-Fix-symbol-visibility-when-tests-are-enabled.patch b/meta-arago-extras/recipes-framework/onnx/onnx/0005-Fix-symbol-visibility-when-tests-are-enabled.patch new file mode 100644 index 00000000..2cbb8444 --- /dev/null +++ b/meta-arago-extras/recipes-framework/onnx/onnx/0005-Fix-symbol-visibility-when-tests-are-enabled.patch @@ -0,0 +1,36 @@ +From b745ae1fed1e0819cac764a07d8f82abc1c438da Mon Sep 17 00:00:00 2001 +From: Pratham Deshmukh +Date: Thu, 12 Feb 2026 17:27:17 +0530 +Subject: [PATCH 5/5] Fix symbol visibility when tests are enabled + +The onnx target uses hidden visibility which hides C++ API symbols +that tests need. Most C++ API symbols (OpSchema methods, OpSchemaRegistry +functions, etc.) are not marked with ONNX_API, so they remain hidden +even with ONNX_API_DEFINE set. + +When tests are enabled, we need access to these internal symbols, +so disable hidden visibility for the main onnx library. + +Upstream-Status: Pending + +Signed-off-by: Pratham Deshmukh +--- + CMakeLists.txt | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 89d4fed84..c4cded129 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -538,8 +538,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "AIX") + else() + add_library(onnx ${ONNX_SRCS}) + endif() +-set_target_properties(onnx PROPERTIES CXX_VISIBILITY_PRESET hidden) +-set_target_properties(onnx PROPERTIES VISIBILITY_INLINES_HIDDEN ON) + + target_include_directories(onnx PUBLIC + $ +-- +2.34.1 + diff --git a/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb b/meta-arago-extras/recipes-framework/onnx/onnx_1.18.0.bb similarity index 87% rename from meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb rename to meta-arago-extras/recipes-framework/onnx/onnx_1.18.0.bb index 3cfb4097..06a84b24 100644 --- a/meta-arago-extras/recipes-framework/onnx/onnx_1.16.1.bb +++ b/meta-arago-extras/recipes-framework/onnx/onnx_1.18.0.bb @@ -4,12 +4,15 @@ HOMEPAGE = "https://www.onnx.ai/" LICENSE = "Apache-2.0" LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" -SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.16.1" +SRC_URI = "git://github.com/onnx/onnx.git;protocol=https;branch=rel-1.18.0" SRC_URI += "\ - file://0001-Try-to-find-package-Protobuf-before-checking-if-it-w.patch \ - file://0002-Do-not-re-export-internal-targets-directories.patch \ + file://0001-Patch-onnx.patch-apply.patch \ + file://0002-Try-to-find-package-Protobuf-before-checking-if-it-w.patch \ + file://0003-Do-not-re-export-internal-targets-directories.patch \ + file://0004-Linker-failed-when-trying-to-create-the-final-onnx_g.patch \ + file://0005-Fix-symbol-visibility-when-tests-are-enabled.patch \ " -SRCREV = "595228d99e3977ac27cb79d5963adda262af99ad" +SRCREV = "e709452ef2bbc1d113faf678c24e6d3467696e83" DEPENDS += "\ abseil-cpp \