Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No option to build shared libLLVM-version.so in CMake #15865

Closed
llvmbot opened this issue Mar 12, 2013 · 16 comments
Closed

No option to build shared libLLVM-version.so in CMake #15865

llvmbot opened this issue Mar 12, 2013 · 16 comments
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 12, 2013

Bugzilla Link 15493
Resolution FIXED
Resolved on Mar 02, 2015 11:50
Version trunk
OS Linux
Blocks llvm/llvm-bugzilla-archive#15732
Reporter LLVM Bugzilla Contributor
CC @llvm-beanz,@foutrelis,@ismail,@steveire

Extended Description

The ./configure system has the option --enable-shared, which creates a libLLVM-version.so file, e.g. libLLVM-3.3.so.

There is a similarly named option available from CMake. This option builds .so files instead of .a files, but doesn't create the libLLVM-version.so file, which is required for certain programs, e.g. the OpenShadingLanguage project. I request that either this existing CMake option or a new option would allow the creation of libLLVM-version.so with CMake.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 26, 2013

To be honest, I'd rather work on getting rid of this file completely. There's no sane way of getting the name of this file, and llvm-config only focuses on the split libraries.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Dec 31, 2013

I'm no cmake expert, but the cmake+shared build produces a libclang-3.x.{so,dylib} that links all of the constituent libclang* libs. Couldn't that be done with the libLLVM* set?

@steveire
Copy link
Collaborator

steveire commented Feb 2, 2014

Is this out of scope or not, as suggested by Michał Górny?

If not, it can be done.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 14, 2014

Speaking from working with the Haskell bindings (and echoing Michał's point) and in other situations: it sucks having libLLVM-$version.so and then the split static libraries, and there's no way to figure any of it out from llvm-config (and I wouldn't suggest llvm-config to deal with it).

Also, it makes it much easier if one wants to support either the dynamic or static compilation in a client of the LLVM libraries. If they have the same names, then the -static flag should work as one would expect (I believe).

In short: libLLVM-$version.so seems to invite hacks in consumers of the library.

@steveire
Copy link
Collaborator

Scott,

At least from a point of view of cmake consuming the library, the file name on disk is not relevant. Whether shared or static, a symbolic name will be used in cmake code, so not explicit handling of static/shared for the file name will be needed.

Your comment might be deserving of a separate bug report to reach the right people.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Feb 15, 2014

At least from a point of view of cmake consuming the library, the file name
on disk is not relevant. Whether shared or static, a symbolic name will be
used in cmake code, so not explicit handling of static/shared for the file
name will be needed.

Perhaps I misunderstood the suggestion: would you want to provide an option to generate libLLVM-$version.so to replace the more granular *.so's, or to generate both?

@steveire
Copy link
Collaborator

Ah, sorry, I think I misunderstood.

Actually I can't imagine why OpenShadingLanguage thinks they need the -$version.so file. That might just be a misunderstanding too?

Perhaps I misunderstood the suggestion: would you want to provide an
option to generate libLLVM-$version.so to replace the more
granular *.so's, or to generate both?

I'll leave that up to the llvm developers to decide.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Mar 5, 2014

I am working for this.
http://llvm-reviews.chandlerc.com/D2942

@llvmbot
Copy link
Collaborator Author

llvmbot commented Mar 5, 2014

I am working for this.
http://llvm-reviews.chandlerc.com/D2942

Is the proposal to completely replace the granular lib*.so's with libLLVM-version.so and remove the ability to generate the granular lib*.so's ? Because that would re-break llvm-config, it's already broken for the autotools build (unless this has recently changed).

See Bug #​6823.

@llvmbot
Copy link
Collaborator Author

llvmbot commented Mar 5, 2014

I don't have a plan to deprecate BUILD_SHARED_LIBS.

@llvm-beanz
Copy link
Collaborator

I've submitted patches for review:
http://reviews.llvm.org/D6157

@llvm-beanz
Copy link
Collaborator

Fixed by:
r229720: Enable standard so versioning for libLLVM.

@foutrelis
Copy link
Mannequin

foutrelis mannequin commented Feb 28, 2015

Fixed by:
r229720: Enable standard so versioning for libLLVM.

Looking at the diff, shouldn't SOVERSION be set to "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}" instead of just "${LLVM_VERSION_MAJOR}" since ABI changes with each minor LLVM release (e.g. 3.5 -> 3.6)?

@llvm-beanz
Copy link
Collaborator

Yes, that's a really good catch. I'll fix that today.

@llvm-beanz
Copy link
Collaborator

Fixed r230981.

@sylvestre
Copy link
Collaborator

mentioned in issue llvm/llvm-bugzilla-archive#15732

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 4, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla cmake Build system in general and CMake in particular
Projects
None yet
Development

No branches or pull requests

4 participants