Skip to content

[opencv4] Fix arm64ec being configured as 32-bit x86 - #55249

Open
qualcommkdi wants to merge 1 commit into
microsoft:masterfrom
qualcommkdi:opencv4-arm64ec
Open

qualcommkdi wants to merge 1 commit into
microsoft:masterfrom
qualcommkdi:opencv4-arm64ec

Conversation

@qualcommkdi

@qualcommkdi qualcommkdi commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

arm64ec is not handled in the TARGET_IS_* selection of ports/opencv4/portfile.cmake, so it falls through to the final else() branch and OpenCV is configured with -DX86=1 (32-bit x86 / SSE baseline), even though arm64ec code is compiled as AArch64 and uses NEON.

This change treats arm64ec the same as arm64:

The _M_ARM64EC source-level changes in OpenCV itself are already upstream as of 4.14.0, so no source patch is needed.

Checklist

  • Changes comply with the maintainer guide.
  • The packaged project shows strong association with the chosen port name.
  • Only one version is in the new port's versions file / the port-version was updated.
  • Version database updated with ./vcpkg x-add-version opencv4.
  • Tested locally: vcpkg install opencv4[core]:arm64ec-windows

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 23, 2026 09:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the ARM64EC update, although validation was limited to the diff without build or consumer-integration testing.

No open issues 🎉

What changed in this PR

Updates the OpenCV port to recognize ARM64EC as AArch64 instead of falling back to the 32-bit x86 configuration.

Changes:

  • Extends the architecture condition to include both arm64 and arm64ec.
  • Bumps OpenCV 4.14.0 to port revision 1 and updates the version database.

Validation was limited to the supplied diff; builds and consumer integration were not tested.

File Description
versions/​o-/​opencv4.json Registers OpenCV 4.14.0 port revision 1.
versions/​baseline.json Advances the OpenCV baseline to revision 1.
ports/​opencv4/​vcpkg.json Sets the port revision to 1.
ports/​opencv4/​portfile.cmake Includes ARM64EC in AArch64 handling and adds a copyright comment.

Review effort: Balanced

@qualcommkdi

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Qualcomm Technologies, Inc."

@Blackhex Radek Bartoň (Blackhex) left a comment

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.

LGTM, thank you.

GPT Sol 6.2 found one pre-existing issue:

F1: Strict direct consumers need the OpenCV-specific include root

Non-blocking; pre-existing. With only <triplet>/include on the include path, even opening the header as <opencv4/opencv2/core.hpp> fails at its nested opencv2/core/cvdef.h include. Debug and Release both returned compiler exit 2 with fatal error C1083: Cannot open include file: 'opencv2/core/cvdef.h': No such file or directory. Every configuration-specific import library was supplied, but compilation stopped before linking. Replacing the sole include directory with <triplet>/include/opencv4 made the same example compile and link in both configurations; matching CMake exports supply that directory automatically.

The base recipe and the reviewed recipe pass the same OPENCV_INCLUDE_INSTALL_PATH=include/opencv4 to the same upstream source and patches. Classification as pre-existing is based on that unchanged layout and header, not a second base install on ARM64EC. A separate packaging change could make strict direct consumption work while preserving OpenCV-version coexistence and CMake consumers. No layout change is required for this PR.

This branch has not been deployed

No deployments
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