[cfe-dev] Linking a plugin against clang/LLVM libraries

Ehsan Akhgari ehsan.akhgari at gmail.com
Wed Jan 28 08:42:11 PST 2015


On Tue, Jan 27, 2015 at 5:44 PM, Nico Weber <thakis at chromium.org> wrote:

> On Tue, Jan 27, 2015 at 2:34 PM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
> wrote:
>
>> On Tue, Jan 20, 2015 at 4:32 PM, Nico Weber <thakis at chromium.org> wrote:
>>
>>> On Tue, Jan 20, 2015 at 11:07 AM, Reid Kleckner <rnk at google.com> wrote:
>>>
>>>> I think Nico tweaked the dead strip settings last?
>>>>
>>>
>>> I tested things in a static library build. Since you say something about
>>> libLLVMSupport.dylib, you're probably doing a shared build. From how I
>>> remember things looking, I don't think shared builds supported plugins ever
>>> in the make build – it's probably you'll have to tweak the build
>>> description to get this configuration to work. (Chromium only uses compiler
>>> plugins in static builds too.)
>>>
>>
>> How should I get a non-shared build?  That may be the source of this
>> problem...
>>
>
> Don't says -DBUILD_SHARED_LIBS=YES when running cmake, I think. It's off
> by default. What does CMakeCache.txt in your build directory store for that
> setting?
>
>
It's set to OFF.  I usually build with `cmake -GNinja
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_TARGETS_TO_BUILD=X86
/path/to/llvm`.  I just did a clean rebuild and verified that I am still
getting the following dylibs in objdir/lib:

lib/BugpointPasses.dylib lib/libLTO.dylib         lib/libc++.1.dylib
lib/libclang.3.7.dylib
lib/LLVMHello.dylib      lib/libc++.1.0.dylib     lib/libc++.dylib
lib/libclang.dylib

-- 
Ehsan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150128/97a60b8c/attachment.html>


More information about the cfe-dev mailing list