darlinghq / darling

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

need to add CoreTelephony framework stubs. #1174

Closed yjqg6666 closed 2 years ago

yjqg6666 commented 2 years ago

Framework What framework is required? What does Apple's developer documentation say about it? Is it open-source? /System/Library/Frameworks/CoreTelephony.framework is required. Documentation: apple doc

Test Application WeChat WeCom Steps To Reproduce

  1. If possible, what steps can you take to reproduce the issue? Download WeCom from tencent website or direct download and extract to /Applications directory.
  2. Run /Applications/WeCom.app/Contents/MacOS/WeCom will get the following error message:
dyld: dyld cache load error: shared cache file open() failed
dyld: Library not loaded: /System/Library/Frameworks/CoreTelephony.framework/Versions/A/CoreTelephony
  Referenced from: /Applications/WeCom.app/Contents/Frameworks/ilink_network.framework/Versions/A/ilink_network
  Reason: image not found
abort_with_payload: reason: dyld cache load error: shared cache file open() failed
Library not loaded: /System/Library/Frameworks/CoreTelephony.framework/Versions/A/CoreTelephony
  Referenced from: /Applications/WeCom.app/Contents/Frameworks/ilink_network.framework/Versions/A/ilink_network
  Reason: image not found; code: 1
Abort trap: 6 (core dumped)

System Information What system are you running?

ProductName: Mac OS X ProductVersion: 10.15 BuildVersion: Darling

Software Version
Host OS Debian testing/Bookworm
WeCom by Tencent 4.0.6.90539
Darling e8234e5f44cf8077f343172eb607080a98b70f6a @ darlingserver branch

Related to #1049 .

From the doc: generating stubs, we could generate the stubs from an existing Macos sys. What version of the Macos should be used? From the PRs, most of the PRs are made by @mrolappe and generated using Catalina (10.15) . @mrolappe How about making a PR for the CoreTelephone framework? I do not have Catalina available.

CuriousTommy commented 2 years ago

For context on generating stubs, the current stub generator doesn't work on the latest version of MacOS because the recent versions use a dyld_shared_cache. The current tool is not able to handle parsing the dyld_shared_cache. I'm actually working on a rewrite of the stub generation, but it is currently incomplete.

mrolappe commented 2 years ago

hej @yjqg6666, fortunately, I had the stubs already generated. PR #1175 will add them to the darlingserver branch. unfortunately (but expected) this is not sufficient to get the app to try to run. There are undefined symbols at least from CoreMedia FW.

yjqg6666 commented 2 years ago

Update: I copied /System/Library/Frameworks/CoreTelephony.framework and /System/Library/PrivateFrameworks/CommonUtilities.framework from the latest avalable Macos Cataline version 10.15.7 (freshly installed).

Run the app /Applications/WeCom.app/Contents/MacOS/WeCom will result the following error:

dyld: dyld cache load error: shared cache file open() failed dyld: Library not loaded: /usr/lib/libTelephonyUtilDynamic.dylib Referenced from: /System/Library/Frameworks/CoreTelephony.framework/Versions/A/CoreTelephony Reason: image not found abort_with_payload: reason: dyld cache load error: shared cache file open() failed Library not loaded: /usr/lib/libTelephonyUtilDynamic.dylib Referenced from: /System/Library/Frameworks/CoreTelephony.framework/Versions/A/CoreTelephony Reason: image not found; code: 1 Abort trap: 6 (core dumped)

It now may be the reason dyld_shared_cache mentioned by @CuriousTommy.

CuriousTommy commented 2 years ago

dyld: dyld cache load error: shared cache file open() failed

Actually, this issue is different from what I was talking about in my previous reply. This might be a side affect of trying to use Apple's official frameworks.

mrolappe commented 2 years ago

@yjqg6666 CoreTelephony framework stubs have been merged. You could try again.

yjqg6666 commented 2 years ago

@mrolappe Thanks a lot. I will try it later.