Mac OSX Ventura & Golang dylibAnswered

I have an app I wrote in golang that uses turboactivate.   All has worked well for several years.  I just updated my primary dev machine (ARM) to Ventura (mac os 13.6) and this has broken the app.   When I run the program, the error is: 

dyld[27803]: Symbol not found: _TA_Activate

If I take the compiled binary made on Ventura and run it on an older Mac (say Monterey) it works fine.   I keep libTurboActivate.dylib in /usr/local/lib.  If I remove this file on the Ventura machine, I don't get the library not found error I would expect.

Thoughts on how to fix the library issue?

Spent a bit more time on this, and it seems that for security Apple has made it so that the prior method of finding a library doesn't work.  It does work if it is hardcoded into the binary.

Here's what made it work for me, but it's a bit of a kludge:

install_name_tool -add_rpath /usr/local/lib mygobinary

It also worked to change the library to use @executable_path vs @rpath.   I think this rpath is hardcoded in the libTuroactivate.dylib?   If so, a rebuild of that might fix this.

While the help files on turboactivate with mac were useful, they still didn't get me to success.

External libraries with go use a #cgo LDFLAGS: line to add linker options.  One would have thought you could add -Wl,-rpath,@executable_path/. to the linking options but that didn't work.

It seems that the library path at execution is taken from the static path set in the libTurboActivate.dylib.   I don't know that I've found a way to see how it is set as distributed, but I found that if I modify it as follows, my builds work:

install_name_tool -id @loader_path/libTurboActivate.dylib libTurboActivate.dylib

This makes it look for the dylib file in the same folder as my binary, which is a reasonable solution for me.