Opt -load fails to load built-in pass library due to namespace issue

I’m following along in WritingAnLLVMPass and find the built-in sample pass plugin library lib/LLVMHello.dylib won’t load. The problem relates to namespaces:

chris@goldfish testcases % opt -load ../build/lib/LLVMHello.dylib -hello < hello.bc > /dev/null
Error opening '../build/lib/LLVMHello.dylib': dlopen(../build/lib/LLVMHello.dylib, 0x0009): symbol not found in flat namespace '__ZN4llvm23EnableABIBreakingChecksE'
  -load request ignored.
chris@goldfish testcases % 

Google tells me lot’s of things but nothing helpful. Something about the default on macOS being a flat name-space. Any ideas?

Got a little farther. Found this Symbol not found in opt when using own pass post. Where it was suggested to use the opt from the build directory rather than whatever else you have (in my case, I got opt along with all the llvm tools via home-brew).
Now I have a different problem with the plugin:

chris@goldfish testcases % ../build/bin/opt --load ../build/lib/LLVMHello.dylib -hello < hello.bc > /dev/null
../build/bin/opt: unknown pass name 'hello'
chris@goldfish testcases % 

So no pass named hello, but the following suggests there is:

chris@goldfish testcases % ../build/bin/opt --load ../build/lib/LLVMHello.dylib -help | grep hello
      --hello                                                              - Hello World Pass
      --hello2                                                             - Hello World Pass (with getAnalysisUsage implemented)
chris@goldfish testcases % 

I notice the build-tree opt is LLVM version 15.0.0git while the non-tree version I installed with brew is LLVM version 13.0.1.