My intention is to let clients of my application to load plugins from
other third-party developers.
Oh, cool, and in that case disabling library validation is absolutely required.
Those are well known plugins but for licensing reasons I can't
distribute or sign them myself.
OK.
You mentioned that on Apple silicon those libraries have to be at
least ad hoc signed.
Yes. Apple silicon will not run unsigned code at all.
However, I'm running it on Intel (macOS Catalina 10.15.7) and yet
those libraries are not being loaded.
That is some other problem. Now that I’ve confirmed your circumstances, we can dig into that. More below.
how can I ad hoc sign libraries?
In Xcode, select Sign to Run Locally. If you’re signing from the command line, pass - to the -s argument in codesign. For example:
% codesign -s - test
You can also tell whether code is ad hoc signed:
% codesign -d -v test
…
CodeDirectory v=20400 size=614 flags=0x2(adhoc) …
…
As to your specific problem, it’s possible that the system is refusing to load the library’s code signature because it doesn’t use a sufficiently modern SDK. What does this print:
% vtool -show-build /path/to/a/problematic/plugin
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"