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

Laszlo Nagy rizsotto.mailinglist at gmail.com
Thu Jan 29 03:28:10 PST 2015


hi Ehsan,

it's good that you don't have linking problem now. to fix the next problem:
can you show us, how do you call the compiler with your plugin? and also
try to put printouts into the code, to see where it is. or could you share
the plugin source somehow?

regards,
Laszlo

On Wed, Jan 28, 2015 at 5:43 PM, Ehsan Akhgari <ehsan.akhgari at gmail.com>
wrote:

> 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/20150129/500f425a/attachment.html>


More information about the cfe-dev mailing list