[PATCH] OS X - BugpointPasses and LLVMHello have extension ".so" when using CMake

For a while now I have noticed that when I build LLVM using CMake on my OS X machine there are two dynamically linked libraries, BugpointPasses and LLVMHello, that are built with the extension “.so” instead of the extension “.dylib”. This has been causing four test cases to fail when running “make check”.

The attached patch modifies add_llvm_loadable_module in the CMake build system with a piece of logic found in add_clang_library in Clang’s build system. I’m not quite sure what the logic is doing, but it did cause the two preview libraries to be emitted with the correct “.dylib” extension and allowed “make check” to run successfully.

I’ve tested this with the two systems that I regularly build LLVM on:

  1. Console build, 64-bit OS X but emitting 32-bit libraries
  2. Console build, 64-bit Linux

The patch has not been tested using XCode or any other build target.

llvm_shared_library.patch (583 Bytes)

Wesley Peck <peckw@wesleypeck.com> writes:

For a while now I have noticed that when I build LLVM using CMake on
my OS X machine there are two dynamically linked
libraries, BugpointPasses and LLVMHello, that are built with the
extension ".so" instead of the extension ".dylib". This has been
causing four test cases to fail when running "make check".

The attached patch modifies add_llvm_loadable_module in the CMake

[snip]

Applied on r122395. Thanks!