[cfe-dev] Difficulties preparing libtooling based workshop

Hans Wennborg hans at chromium.org
Mon Feb 3 11:01:53 PST 2014


Hi Richard,

I think the truth of the matter is that not many people have worked on
the tooling stuff in a Windows environment, and that's why it's such a
rough experience.

On Sun, Feb 2, 2014 at 4:30 PM, Richard <legalize at xmission.com> wrote:
> I'm trying to do a presentation next Wednesday (yes, in 3 days) for
> the Utah Software Craftsmen group on building a C++ refactoring tool
> using libtooling.  This is a dry-run for the presentation I proposed
> to C++ Now 2014 (proposal decisions will be announced Feb. 15th).
> The tool is based on llvm/tools/clang/tools/extra/remove-cstr-calls.
> I'm running into roadblocks that seem unnecessary.
>
> 1) I must build from source because the prebuilt binaries don't include
> libtooling headers or libraries, only libclang.  Why?

The Windows binaries (both the 3.4 release and the weekly snapshots)
focus on shipping an LLVM-based toolchain, not headers and libraries.
It would be great to have the latter but it hasn't been first
priority.

> This is a live coding workshop and my participants will chew up 30-45
> minutes of time just to download source and build the base libraries to
> start coding.
>
> 2) following the "Getting Started" instructions fails the build
> under Debug on Windows.  The asan runtime has a line of code in it like
> this in asan_win.cc:
>
> #if defined(_DEBUG)
> #error Please build the runtime with a non-debug CRT: /MD or /MT
> #endif
>
> ...which means the whole solution fails to build in debug and this
> contingency isn't handled in CMakefiles.txt

This sounds like a bug that we should fix. In the meantime, as you've
noticed, you don't need compiler-rt for tooling.

> 3) there are a bunch of tests that fail on Windows along the lines of:
>
> 'echo': command not found
>
> ...which in turn fails the build for the projects that run these
> tests, and in turn causes the whole solution to fail.

I run the test suite in cygwin. I don't know how well it works when
run in cmd.exe or from Visual Studio.

> What's really more of a problem for me is the lack of prebuilt
> binaries for libtooling.  Is there enough packaging infrastructure in
> place that I can get the necessary headers and libraries packaged up
> with a simple command?

I don't know if the cmakefiles for tooling is set up to do this, but
what I would try is to build the "install" target (you might want to
set CMAKE_INSTALL_PREFIX first) and see if that includes everything
necessary for tooling. If it does, just zip that up. If not, the
cmakefiles need work.

Thanks,
Hans



More information about the cfe-dev mailing list