Versioned dylibs and llvm-config

Unless I’m mistaken, back under the autoconf system dylibs were shipped versioned (libLLVM-{VERSION}.dylib). Indeed this is what llvm-config looks for.

On the move to CMake however, this is no longer happens on macOS: https://github.com/llvm/llvm-project/blob/ab411801b82783eb7f652701ccfce81b16cf1811/llvm/cmake/modules/AddLLVM.cmake#L562

However, llvm-config still explicitly looks for versioned dylibs: https://github.com/llvm/llvm-project/blob/bec37c3fc766a7b97f8c52c181c325fd47b75259/llvm/tools/llvm-config/llvm-config.cpp#L378

So my question is: which one is correct? Unless I’ve missed something, llvm-config doesn’t function properly on macOS under LLVM_BUILD_LLVM_DYLIB and hasn’t done so for a few years now. This has raised a few bug reports, most recently in Homebrew.

For reference, this issue has been mentioned a couple times:

Any thoughts?

Bo