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

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


On Wed, Jan 28, 2015 at 4:36 AM, Laszlo Nagy <rizsotto.mailinglist at gmail.com
> wrote:

> hi Ehsan,
>
> Clang plugin linking problem is a popular topic on this list. (here is a
> thread which discussed similar problem
> http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-September/031737.html )
> hope it fits to your problem as well
>

Thanks for the link!  This seems somewhat similar to my problem, so I
removed all -lclangFoo arguments and used -undefined dynamic_lookup
instead, and the linker did not complain, but now when I try to run clang
with my newly built plugin, the compiler returns a 1 error code with no
error messages, and doesn't seem to be doing anything.


> regards,
> Laszlo
>
> On Tue, Jan 27, 2015 at 11: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?
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>


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


More information about the cfe-dev mailing list