[Lldb-commits] [PATCH] D26190: [RFC] Solve linking inconsistency, proposal two

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 1 11:52:52 PDT 2016


labath added a comment.

In https://reviews.llvm.org/D26190#585016, @mehdi_amini wrote:

> > Does that make sense?
>
> This makes sense (assuming static linking reduces some possibility though)


I am not sure we are on the same page here. What is the scenario you have in mind here? I am not forbidding anyone from building liblldb linking to libllvm (in fact, I think it should work). I am assuming static linking just because that is the use case most developers use.

> , but LLVM is not robust to mix and match build settings: building half of the source with -DNDEBUG and not the other is likely to cause weird runtime failures. That can be an issue because now you need libLLDB built in two modes and the client app to link the right one.

I don't see how this applies. This is true when you build liblldb, and it's true that lldb's assertion settings need to match llvm's, but since liblldb's api is stable wrt. N/_DEBUG, it's user should not need to care about that.

> Also, exporting more than the minimum prevent an efficient LTO build of libLLDB.so

This proposal is about exporting the bare minimum (i.e. lldb namespace).

> 
> 
>> Everything should work fine as long as you don't actually *depend* on having a separate copy of llvm (which is pretty pointless as it does not have global state (apart from the crazy cl globals)).
> 
> Is it pointless? Users have dependencies they don't control. I have seen mentioned in the past issues with "symbol pollution" from external library that was affecting LLVM users (a quick search yields https://root.cern.ch/phpBB3/viewtopic.php?f=3&t=22462&sid=dfd0c149390349defea19eb9ce0073c5 )

Again I think we are misunderstanding each other, the "pointless" was referring to the "relying on global state of libllvm" part of the statement. It seems the problem you quote was caused by a library exporting interfaces it should have kept private, which is what we are doing here (but in your first sentence you seem to indicate you prefer dynamic linking, in which case you cannot hide the symbols (or can you?)).

I think you'll have to repeat your point, as now I am totally confused about what you are trying to say. :)


https://reviews.llvm.org/D26190





More information about the lldb-commits mailing list