Skip to content

POWER : Fix build failure due to unsupported cpuinfo on ppc64le#27120

Merged
hariharans29 merged 1 commit intomicrosoft:mainfrom
BODAPATIMAHESH:main_ppc64le_cpuinfo_linking_error
Jan 29, 2026
Merged

POWER : Fix build failure due to unsupported cpuinfo on ppc64le#27120
hariharans29 merged 1 commit intomicrosoft:mainfrom
BODAPATIMAHESH:main_ppc64le_cpuinfo_linking_error

Conversation

@BODAPATIMAHESH
Copy link
Copy Markdown
Contributor

@BODAPATIMAHESH BODAPATIMAHESH commented Jan 23, 2026

Description
Conditionally disable linking of cpuinfo for
onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported.

Motivation and Context
Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo).

Solution
Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a build failure on ppc64le (PowerPC 64-bit Little Endian) architecture by conditionally excluding the cpuinfo library from linking when building the onnxruntime_runtime_path_test_shared_library test target. The cpuinfo library does not support ppc64le, leading to linker errors.

Changes:

  • Added ppc64le architecture detection in CMake to skip linking cpuinfo on this platform
  • Preserved existing behavior for other architectures where cpuinfo is supported
  • Follows similar pattern already established for AIX platform

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread cmake/onnxruntime_unittests.cmake Outdated
Description
Conditionally disable linking of cpuinfo for
onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo is not supported.

Motivation and Context
Recent changes enabling onnxruntime_autoep_test and related shared library tests on non-Windows platforms exposed a transitive dependency issue. cpuinfo was being linked unconditionally on Linux, leading to linker failures on ppc64le (cannot find -lcpuinfo).

Solution
Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while preserving existing behavior.
@BODAPATIMAHESH BODAPATIMAHESH force-pushed the main_ppc64le_cpuinfo_linking_error branch from 1cd9909 to 7219df3 Compare January 27, 2026 04:58
@BODAPATIMAHESH
Copy link
Copy Markdown
Contributor Author

I have addressed the copilot's review comments.

@BODAPATIMAHESH
Copy link
Copy Markdown
Contributor Author

can you review this patch @hariharans29

@hariharans29
Copy link
Copy Markdown
Member

/azp run Linux QNN CI Pipeline,Win_TRT_Minimal_CUDA_Test_CI,Windows ARM64 QNN CI Pipeline,Windows GPU Doc Gen CI Pipeline

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 4 pipeline(s).

@hariharans29 hariharans29 enabled auto-merge (squash) January 28, 2026 04:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

else()
target_link_libraries(onnxruntime_runtime_path_test_shared_library PRIVATE
onnxruntime_common cpuinfo ${CMAKE_DL_LIBS})
if (CPUINFO_SUPPORTED)
Copy link

Copilot AI Jan 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cpuinfo guard should include an Emscripten exclusion to be consistent with similar patterns elsewhere in this file. Most other cpuinfo linking checks use the pattern if (CPUINFO_SUPPORTED AND NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten") (see lines 1359, 1567, 1699, 1892). This is necessary because CPUINFO_SUPPORTED can be TRUE on Emscripten when XNNPACK is enabled, but cpuinfo should not be linked in ORT code for that configuration (see cmake/external/onnxruntime_external_deps.cmake lines 351-356).

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any comment about this ? @BODAPATIMAHESH ?

@BODAPATIMAHESH
Copy link
Copy Markdown
Contributor Author

Merge didn't happen because the Required checks are failing @hariharans29

@hariharans29
Copy link
Copy Markdown
Member

Please wait for this and rebase: #27206

@hariharans29 hariharans29 merged commit d5aa986 into microsoft:main Jan 29, 2026
94 of 96 checks passed
@BODAPATIMAHESH
Copy link
Copy Markdown
Contributor Author

Please wait for this and rebase: #27206

Thanks

tianleiwu pushed a commit that referenced this pull request Feb 4, 2026
Description
Conditionally disable linking of cpuinfo for
onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo
is not supported.

Motivation and Context
Recent changes enabling onnxruntime_autoep_test and related shared
library tests on non-Windows platforms exposed a transitive dependency
issue. cpuinfo was being linked unconditionally on Linux, leading to
linker failures on ppc64le (cannot find -lcpuinfo).

Solution
Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while
preserving existing behavior.
tianleiwu added a commit that referenced this pull request Feb 4, 2026
#27021: [Disable matmul 1d
tests on
DML](1afc8bc)


#27206: [[CUDA] Run
FlashAttention regression test only when FlashAttention
is…](4d95d97)

#27120: [POWER : Fix build
failure due to unsupported cpuinfo on
ppc64le](2843ec0)

---------

Co-authored-by: Ti-Tai Wang <titaiwang@microsoft.com>
Co-authored-by: Hariharan Seshadri <shariharan91@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: BODAPATIMAHESH <148746454+BODAPATIMAHESH@users.noreply.github.com>
milpuz01 pushed a commit to milpuz01/onnxruntime that referenced this pull request Feb 4, 2026
…osoft#27120)

Description
Conditionally disable linking of cpuinfo for
onnxruntime_runtime_path_test_shared_library on targets, where cpuinfo
is not supported.

Motivation and Context
Recent changes enabling onnxruntime_autoep_test and related shared
library tests on non-Windows platforms exposed a transitive dependency
issue. cpuinfo was being linked unconditionally on Linux, leading to
linker failures on ppc64le (cannot find -lcpuinfo).

Solution
Add CPUINFO_SUPPORTED guards to exclude cpuinfo from the link list while
preserving existing behavior.
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.

3 participants