It turns out that what I describe above doesn't work (and I can't seem to edit or delete my answer?), at least not on recent macOS with SIP enabled. Regardless of how you try to do it (setenv/putenv followed by exec, or via LSEnvironment), all environment variables starting with DYLD_ are ignored (scrubbed out of the environment, in fact). I haven't tested it, because then I also found that it was working for me even without setting DYLD_LIBRARY_PATH (perhaps I was missing a library that needed to be patched to use @executable_path? unclear), but I believe the entitlement mentioned by Quinn (@eskimo) above will fix that.
Topic:
Code Signing
SubTopic:
General
Tags: