[macOS] Wrong link path in executable for dependency libexpat
❯ /Applications/RawTherapee.app/Contents/MacOS/rawtherapee
dyld: Library not loaded: /usr/lib/libexpat.1.dylib
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Reason: Incompatible library version: ImageIO requires version 7.0.0 or later, but libexpat.1.dylib provides version 1.0.0
[1] 648 abort /Applications/RawTherapee.app/Contents/MacOS/rawtherapee
Short description
It looks like system's dynamic linker finds the wrong version of the library. Instead of using the one in /Applications/RawTherapee.app/Contents/Frameworks/ it finds the one in /usr/lib/.
Additional information
- RawTherapee: 5.8 (official DMG from website)
- OS: macOS Catalina 10.15.7
Suggestion
rawtherapee-bin uses @rpath/libexpat.1.dylib.
I wager that switching that to @executable_path/../Frameworks/libexpat.1.dylib may fix this. And while at it, fix this for all shipped dependencies in Frameworks.
Good overview: https://blog.krzyzanowskim.com/2018/12/05/rpath-what/
Ping @Benitoite
@Thanatomanic Not reproduced on my fresh Catalina vm with website release, which was built two years ago...
Also, hard-coded paths are used in dev since a few weeks after the 5.8 tag, as part of the so-called "hardened runtime", a prerequisite of Apple's notary service.
- Always report issues here based on your test of the dev branch, even if you noticed the issue in a release.
BTW linking to non-system expat might not even be required; experimenting with letting it link to sys.
New macOS builds with updated libomp 16+
- [ ] dev
- [ ] metadata-exiv2
now available in my iCloud shared drive:
- https://www.icloud.com/iclouddrive/06aKa-Dws-D7mQiNV6819YvgA#rt59
If you can test, please let us know if it works for you. If you are seeking help on your own build system, please include the complete AboutThisBuild.txt.
My working systems:
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.5.0
Thread model: posix
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix