As an experiment, I thought it would be interesting to try to avoid building openocd from source. By pulling links out of the package_sifive_index.json file - which is intended for use by the Arduino IDE - I was able to download a pre-built Darwin binary. (I’ve written a page about this here.)
However, when I tried to run openocd, it failed. otool -L showed that it had been linked against libusb binaries in /usr/local/opt/, which suggested that the builder had used Homebrew and hadn’t “sanitized” the build environment to prevent these local-to-their-setup dependencies from creeping into the built binary.
I don’t use Homebrew (I prefer Nix and nixpkgs!) and I was able, using some clever symlinking, to get around this. But it would be nice if openocd statically linked to libusb. I don’t think it would bloat the executable too terribly, and would avoid these hurdles for others.
I thought of making these comments in the sifive/openocd/ issue tracker on GitHub, but because the trouble is with a pre-built binary and not the source that didn’t seem totally appropriate.