Skip to content

[LLVM] Set SOVERSION on shared libraries on macOS#188982

Closed
vadorovsky wants to merge 1 commit intollvm:mainfrom
vadorovsky:macos-version-suffix
Closed

[LLVM] Set SOVERSION on shared libraries on macOS#188982
vadorovsky wants to merge 1 commit intollvm:mainfrom
vadorovsky:macos-version-suffix

Conversation

@vadorovsky
Copy link
Copy Markdown
Contributor

@vadorovsky vadorovsky commented Mar 27, 2026

LLVM_VERSION_SUFFIX currently behaves inconsistently on macOS and other Unix-like systems.

On macOS, libLLVM is emitted as an unversioned library with a compatibility symlink:

libLLVM-22-[suffix].dylib -> libLLVM.dylib
libLLVM.dylib

On Linux, the library filename itself carries the version suffix, and both the compatibility symlink and the unversioned linker name point to it:

libLLVM-22[suffix].so -> libLLVM.so.22.1[suffix]
libLLVM.so -> libLLVM.so.22.1[suffix]
libLLVM.so.22.1[suffix]

The macOS layout makes it harder to install multiple LLVM builds side by side without library name collisions.

Make macOS follow the same versioned shared-library naming scheme as other Unix-like systems by setting SOVERSION for shared libraries there as well.

Fixes #188963

`LLVM_VERSION_SUFFIX` currently behaves inconsistently on macOS and other
Unix-like systems.

On macOS, libLLVM is emitted as an unversioned library with a compatibility
symlink:

  libLLVM-22-[suffix].dylib -> libLLVM.dylib
  libLLVM.dylib

On Linux, the library filename itself carries the version suffix, and
both the compatibility symlink and the unversioned linker name point to
it:

  libLLVM-22[suffix].so -> libLLVM.so.22.1[suffix]
  libLLVM.so -> libLLVM.so.22.1[suffix]
  libLLVM.so.22.1[suffix]

The macOS layout makes it harder to install multiple LLVM builds side by
side without library name collisions.

Make macOS follow the same versioned shared-library naming scheme as
other Unix-like systems by setting `SOVERSION` for shared libraries
there as well.

Fixes llvm#188963
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Mar 27, 2026
@vadorovsky
Copy link
Copy Markdown
Contributor Author

Superseded by #189004

@vadorovsky vadorovsky closed this Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake Build system in general and CMake in particular

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[LLVM] -DLLVM_VERSION_SUFFIX behaves differently on macOS than on other Unix-like systems

2 participants