darlinghq / darling

Darwin/macOS emulation layer for Linux
http://www.darlinghq.org
GNU General Public License v3.0
11.44k stars 444 forks source link

Missing AVFoundation symbols from OpenCV libraries #1256

Open donlk opened 1 year ago

donlk commented 1 year ago

Expected Result Binary runs without issues.

Actual Result Missing symbols thrown by the dynamic loader .

Steps To Reproduce Build a simple application reading a video using OpenCV.

System Information OS: Debian 11 CPU: Ryzen 3700x Toolchain: osxcross at this commit.

Software Version
OpenCV 4.7.0
Linux Kernel 5.10.0-18-amd64
Darling 8ab210cbde44d5531005eec2c86c1780224d0e4d

I made a simple program that reads a video file and displays it. Compiled the program and it's dependency (OpenCV) for OSX x86_64 using a self compiled toolchain with osxcross.

As soon as a tried to run the binary I received undefined symbol errors:

dyld: dyld cache load error: shared cache file open() failed
dyld: Symbol not found: _AVVideoCodecTypeHEVC
  Referenced from: /Volumes/SystemRoot/<project_dir>/../opencv/install/lib/libopencv_videoio.407.dylib
  Expected in: /System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation
 in /Volumes/SystemRoot/<project_dir>/../opencv/install/lib/libopencv_videoio.407.dylib
abort_with_payload: reason: dyld cache load error: shared cache file open() failed

I also received similar errors for symbols _AVMediaTypeMuxed, _AVFileTypeAppleM4V, and I'm sure there's many more that didn't show up.

I tried osxcross toolchains compiled against different MacOS SDK's as well:

I also tried using the darling master branch (as well as the update_sources_11.5 branch), to no avail.

Is darling usable for multimedia purposes at all? Is the AVFoundation module port complete?

CuriousTommy commented 1 year ago

Is darling usable for multimedia purposes at all? Is the AVFoundation module port complete?

As far as I am aware, no. A lot of frameworks in Darling are just stubs (AVFoundation being one of them).

donlk commented 1 year ago

As far as I am aware, no. A lot of frameworks in Darling are just stubs (AVFoundation being one of them).

So there is no actual AVFoundation implementation library that is ready to be loaded? Only a skeleton one?

CuriousTommy commented 1 year ago

Only a skeleton one?

Pretty much

donlk commented 1 year ago

Allright, thanks for the clarification. As I think this will not get resolved in the near future, I'm closing the issue.

CuriousTommy commented 1 year ago

I'm going to leave this issue as opened, since those symbols will need to be added at some point.