Skip to content

Onnxruntime: update to 1.26.0#13

Draft
koenkooi wants to merge 3 commits into
qualcomm-linux:mainfrom
koenkooi:koen/onnxruntime-1.26.0
Draft

Onnxruntime: update to 1.26.0#13
koenkooi wants to merge 3 commits into
qualcomm-linux:mainfrom
koenkooi:koen/onnxruntime-1.26.0

Conversation

@koenkooi

Copy link
Copy Markdown
Contributor

This includes PR #12 and updates onnxruntime to the latest release. I've checked with the IMSDK team and the Qualcomm Execution Provider (in https://github.com/qualcomm-linux/meta-qcom) is compatible with this version.

This release needs a slightly different fix for GCC 16.x, which is planned to get pushed upstream. When that happens the patch header will get updated.

ricardosalveti and others added 2 commits June 17, 2026 09:12
Linking the label_image example fails with the newer GCC 16 toolchain
for both the 2.16.1 and 2.20.0 recipes:

  undefined reference to 'tflite::profiling::ProfileBuffer::EndEvent(
    unsigned int, long const*, long const*)'
  collect2: error: ld returned 1 exit status

label_image uses BufferedProfiler, which forwards to
tflite::profiling::ProfileBuffer. ProfileBuffer is defined in
profiling/profile_buffer.cc, which is excluded from
libtensorflow-lite.a, so each tool must compile it - benchmark_model
does, but the label_image example does not. Older compilers inlined
away the out-of-line reference to EndEvent(); GCC 16 keeps it, exposing
the missing source.

Add a patch adding profiling/profile_buffer.cc to the label_image
sources, mirroring the benchmark_model target. No upstream fix exists
yet (tensorflow/tensorflow master still omits it), so carry it locally.

The example's source list is identical across 2.16.x and 2.20.x in the
relevant region, so the patch uses minimal context and is shared from
recipes-ml/tflite/files/tflite/ by both recipes to avoid duplication.

Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
(git-am'ed from qualcomm-linux/meta-qcom-distro#348, dropped 2.16.x portion)
Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
onnxruntime 1.24.1 fails to build with the GCC 16 toolchain. It sets
COMPILE_WARNING_AS_ERROR ON (a bare -Werror), which turns two GCC 16
diagnostics into fatal errors:

1. -Wsfinae-incomplete (new and on by default in GCC 16) fires when a
   class template (onnxruntime::Tensor, Node, GraphViewer, SparseTensor)
   is used in a SFINAE context through std::reference_wrapper /
   _Reference_wrapper_base before it is complete, then later defined.
   libstdc++'s <functional> (pulled in via onnx/defs/schema.h) triggers
   exactly this pattern. The code is well-formed; the warning is purely
   informational.

2. -Wmaybe-uninitialized false-positives on a read from an
   absl::InlinedVector populated through a helper, e.g.
   concat_slice_elimination.cc:223 (axes[0], filled by GetSliceInfo()).
   onnxruntime already suppresses this for GCC 12; GCC 16 reintroduced
   the false positive.

Add a patch that detects -Wsfinae-incomplete and appends
-Wno-sfinae-incomplete to ORT_WARNING_FLAGS (mirroring the existing
-Wno-interference-size handling), and extends the existing
-Wno-maybe-uninitialized guard to also cover GCC >= 16. Both changes
follow patterns already present in cmake/CMakeLists.txt rather than
disabling -Werror wholesale, and are gated so older compilers are
unaffected.

Verified with a from-scratch build for qemuarm64 using GCC 16.1.0:
the recipe now compiles and packages cleanly.

Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@koenkooi koenkooi self-assigned this Jun 19, 2026
@koenkooi koenkooi marked this pull request as draft June 19, 2026 11:28
1.26.0 requires C++20 (cmake aborts otherwise), so set
-DCMAKE_CXX_STANDARD=20.

Carry a dedicated GCC 16 fixup patch with the two suppressions this
build needs, both gated behind check_cxx_compiler_flag:

  - extend the existing -Wno-maybe-uninitialized guard to GCC >= 16
    (false positive in the optimizer, e.g. matmul_nbits_fusion.cc); and
  - add -Wno-free-nonheap-object (GCC 16 false-positives the
    std::vector<graph_utils::EdgeEndToMatch> destructor in
    skip_layer_norm_fusion.cc).

Signed-off-by: Koen Kooi <koen.kooi@oss.qualcomm.com>
Assisted-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@koenkooi koenkooi force-pushed the koen/onnxruntime-1.26.0 branch from 935253b to 96e4cbc Compare June 19, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants