The issue here is very likely to be the hardened runtime. Consider this sequence: % cp /usr/bin/true MyTrue % codesign -s - MyTrue MyTrue: is already signed % codesign -s - -f MyTrue MyTrue: replacing existing signature % DYLD_PRINT_LIBRARIES=1 ./MyTrue dyld[32846]: /Users/quinn/Test/MyTrue … lots and lots of output … % codesign -s - -f -o runtime MyTrue MyTrue: replacing existing signature % DYLD_PRINT_LIBRARIES=1 ./MyTrue % I copied the built-in true and re-signed it without the hardened runtime. In that case DYLD_PRINT_LIBRARIES does what you expect. OTOH, if I re-sign it again with the hardened runtime enabled, DYLD_PRINT_LIBRARIES stops work. As to why your new test project behaves differently, I suspect that you might have the Hardened Runtime capability enabled in some custom way in your real project. Regardless, you can test my theory by dumping the program’s code signature: % codesign -d -v MyTrue … CodeDirectory v=20500 size=272 flags=0x10002(adhoc,runtime) … … The presence of the hardened runtime
Topic:
App & System Services
SubTopic:
Core OS
Tags: