4 ms·
As a developer I really dislike this security feature of macOS. We have a whole system for running binaries from the build directory (ie. without installing) w
by rwmj 4y ago
As a developer I really dislike this security feature of macOS. We have a whole system for running binaries from the build directory (ie. without installing) which relies on environment variables including DYLD_*, and it works everywhere except macOS. Unless you do some scary-looking changes to the system at boot time.
(If I used macOS for anything other than ssh-ing in for development, I'd probably appreciate it, especially if running $random stuff).
- miga 4y agoCan you use linker to hardwire build directory for this case?
- jamesfmilne 4y agoYou can work around that by using relative linker paths (rpaths). See 'install_name_tool -add_rpath' (to add an rpath search path to a library or executable for finding other libraries) and 'install_name_tool -id' (to change the ID of the library to be '@rpath/<name of library>', ie: install_name_tool -add_rpath @loader_path/../lib <path-to-library> install_name_tool -id @rpath/<name-of-library> <path-to-library> Works with Frameworks too. Agree it is a PITA to setup though.