[cfe-dev] Compile Compact C Compiler from Clang on Windows 10. For Use with Lua

Russell Haley via cfe-dev cfe-dev at lists.llvm.org
Sat Jan 18 21:35:22 PST 2020


Hi,

I've started investigating the clang source code. I've built LLVM and Clang
from source in Windows 10 using Visual Studio (I'll try again with Ninja at
some point). I'd like to only build the C tools if possible? I found
documentation on cmake options for building clang (e.g. building C++ or
building Objective-c) but I've lost track of it if anyone could point me in
the right direction?

Anyway, my objective is to create a very compact C compiler so I want to
strip out anything unnecessary for building small dlls from existing code.
My use case is this:

A user downloads and installs my package that contains a pre-compiled Lua
interpreter and the Lua package manager called Luarocks, as well as the C
toolchain. They can then drop to the command line and build and install a
lua module known as a "rock". For example, if I wanted to download, build
and install the stopwatch module chronos:

luarocks install chronos

The build system is built into Luarocks (and I may also include gmake). The
user would never debug or analyze the C code, they would only use compiled
the C modules in Lua.

So, I'm wondering if I can remove the static analyzer and other components?
Technically I don't even need debug information.

During my meandering through the documentation I read that I can compile
clang using dlls to conserve space at the cost of efficiency, which may be
a trade off I'm willing to make. I'm wondering if the performance is
*terrible* or just not as efficient as one would like? If we are talking
about a few seconds difference to build a small library then I think that's
worth while.

I also read in the documentation something along the lines of "Use the
Visual Studio solution generated from CMake to read the Clang source code".
I tried that but the solution files created by CMake don't seem to link to
the source code? In fact, I've never had CMake generated VS solutions link
to source code so I'm not sure what was actually being expressed? Can VS be
used to browse the project or should I try to import it into Eclipse or
CLion? I typically use Geany but most of my C work in Windows is limited in
scope.

Any and all input is welcome.

Regards,
Russ
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200118/f629600a/attachment.html>


More information about the cfe-dev mailing list