Skip to content

Apple xcframeworks: merge archives built for only one arch (KleidiCV arm64) into the universal archive - #709

Merged
danoli3 merged 1 commit into
openframeworks:bleedingfrom
danoli3:apple-merge-pair-only-archives
Nov 1, 2026
Merged

danoli3 merged 1 commit into
openframeworks:bleedingfrom
danoli3:apple-merge-pair-only-archives

Conversation

@danoli3

@danoli3 danoli3 commented Nov 1, 2026

Copy link
Copy Markdown
Member

Since #706 the macOS opencv.xcframework references KleidiCV but doesn't contain it: opencv.a has 48 undefined kleidicv::hal::* symbols and defines none, so anything linking ofxOpenCv on arm64 fails (Undefined symbols for architecture arm64: kleidicv::hal::bgr_to_bgr ...): allAddonsExample in openframeworks/projectGenerator#696 CI and openFrameworks CI build-macos (makefiles) / build-cmake (macos), with the latest osx packages from 2026-11-01.

The libs are in the package (opencv/lib/osx/MAC_ARM64/libkleidicv{,_hal,_thread}.a), but the Apple merge in frameworkFormula / xframeworkFormula walks the MAC (x86_64) folder and lipos each archive with its MAC_ARM64 pair. KleidiCV is arm64 only (x86_64 builds with WITH_KLEIDICV=OFF), so those three archives are never visited and MERGE_MAC_MAC_ARM64/opencv.a is made from the 4 shared ones (see the osx opencv log of run 41305652529).

Archives that exist only in the pair arch's folder are now copied into the merge folder too; libtool -static puts a thin arm64 archive into the arm64 slice of the universal opencv.a (x86_64 unchanged).

Tested on macOS by running xframeworkFormula opencv from bleeding and from this branch on a fake out/opencv/lib/osx/{MAC,MAC_ARM64} (2 shared archives, 3 arm64-only libkleidicv*.a):

  • bleeding: opencv.xcframework/macos-arm64_x86_64/opencv.a arm64 symbols 2, kleidicv 0 (same as the published package)
  • this PR: arm64 symbols 5, kleidicv 3; x86_64 still 2

Other libraries are unchanged unless they have archives in only one arch folder.

@danoli3
danoli3 merged commit 0ca98f2 into openframeworks:bleeding Nov 1, 2026
67 checks passed
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.

1 participant