[PATCH] D15033: tools/llvm-config: improve shared library support

Andrew Wilkins via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 14 17:23:09 PST 2015


axw added a comment.

In http://reviews.llvm.org/D15033#310485, @DiamondLovesYou wrote:

> In http://reviews.llvm.org/D15033#302259, @axw wrote:
>
> > In http://reviews.llvm.org/D15033#297984, @DiamondLovesYou wrote:
> >
> > > It looks like if LLVM is built with LLVM_LINK_LLVM_DYLIB=ON and `--link-static` is provided and the static archives are removed, `llvm-config` doesn't error and still prints the shared lib with `--libs`.
> >
> >
> > I've updated it to cater for this. It's a bit more complicated in order to keep current behaviour.
> >
> > I'd prefer if we didn't do this "if static exists use, otherwise use shared", and rather just use whatever the installation is supposed to as according to LLVM_LINK_LLVM_DYLIB. Richard, if you have no objections, I'll change it to do that.
>
>
> I disagree. Such complexity is easier to maintain upstream, and avoids multiple downstream solutions for this problem.


My contention is that the complexity is unnecessary in the first place; I don't see why anything should work around broken installations, regardless of whether that be in llvm-config or its users. The solution should be to fix the installation, not make everything more complicated. Anyway, I don't want to block the primary change with side debate, so forget this for now please.

> The problem can still happen if LLVM_LINK_LLVM_DYLIB=OFF, and it would be Nice to automatically delegate to the dylib (if it exists) for external tools so things will Just Work (absent of `--link-static`).


Oops, I need to make a change to how ComputeLibsForComponents is called. Will do that later, fix up formatting and ping again. Thanks.


http://reviews.llvm.org/D15033





More information about the llvm-commits mailing list