[cfe-dev] Using Clang plugins with release version of clang on OS X

Alp Toker alp at nuanti.com
Sun Jun 29 18:04:13 PDT 2014


On 29/06/2014 20:37, Nikita Zhuk wrote:
> Hi,
>
> I’m looking into writing my own Clang plugin which would do some 
> analysis on ObjC code and write out results into an external file 
> during the compilation step. I successfully followed the sample code 
> given here http://clang.llvm.org/docs/ClangPlugins.html and got my 
> plugin working with the trunk clang version which I built on my 
> machine. However, I’m getting a dyld error when trying to load that 
> plugin into default clang version which is shipped with OS X dev tools 
> (Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn). The 
> issue I’m seeing is described here: 
> http://llvm.org/bugs/show_bug.cgi?id=13546
>
> Are Clang plugins being limited to only manual clang builds, or am I 
> missing something here? My goal is to distribute this plugin to other 
> members of my team so they could use it as part of normal Xcode workflow.

The resemblance of your issue to PR13546 is only incidental.

clang plugins will in fact only load and run properly in the exact same 
build configuration and source tree version (SVN revision+patches) of 
LLVM and clang. The compiler used to build either also needs to match, 
so that's unlikely to ever work.

A more effective approach may be to plug into the analyzer support in 
Xcode which I believe is binary pluggable, or to otherwise pipe 
diagnostics from your version of clang into the IDE where they can be 
rendered. In general loading into a foreign clang binary won't work.

Alp.


>
> Best regards,
> Nikita Zhuk
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-dev mailing list