For the LLVM wishlist


I don't know if there's a wishlist for future LLVM releases but, in
case there is one, maybe you'd like to consider my experience (as a
multiplatform application developer who discovered clang just because
Apple started to include it in Xcode since 10.8 Mountain Lion IIRC,
and really liked it, specially for how warnings are issued, which
really helps to improve your app code quality, as well as because of
the build speed).

Unfortunately, I've to say that I've felt a bit disappointed regarding
the build process. I mean, if some UNIX system has a C++11-compliant
compiler installed, and LLVM has both a backend for the system CPU
and support for the system linker, there should be a very simple build
procedure for getting clang up and running on such a system (at least
with the most basic components which should require only a C++11
compiler, such as clang itself, the static analyzer, and builtins for
optimized code generation).

What I found is that the build system is really complex, performs many
checks, and quite often takes wrong decisions (example: a fatal error
if the OS X version is older than 10.7, instead of just disabling
sanitizers and continuing with the build --moreover, if you manually
disable the sanitizers build, its tests are not disabled at make
check-all, so you end up with many tests failing because of a
component you didn't build).

So, if you've a wishlist, my only wish at this time would be to have a
way of easily building clang on any system that has a C++11-compliant
compiler. Even an old UNIX system from the 90s, if you managed to
build gcc with C++11 support on it, and LLVM supports its linker,
should be able to build clang 3.8.0 in a straightforward way by just
specifying the C++ compiler path and the C++ flags.


Huh? If you check out only llvm and clang, nothing is checked for the
sanitizers, they don't get built and they don't get tested.


But if you don't check out compiler-rt, you don't get builtins.
Missing the feature of getting highly optimized code output is a big
miss, IMHO. And I don't think builtins require anything apart from a
standard compiler.


On most platforms you don't need compiler-rt except for the sanitizers.


Wait, do you mean that builtins for processors like x86_64 or PowerPC
aren't being used by clang? I understood builtins were a key lib for
getting maximum performance on the processors it supports, but maybe I
misunderstood it.


Few builtins are lowered to libcalls on x86_64 and powerpc and those are
normally provided e.g. by libgcc already.



Your comments about the compiler-rt build system being a problem are very correct. We're working on it. We're moving in a direction with the compiler-rt build system to separate the build logic for the sanitizers from the build logic for the builtins, and to clean up the interface between the top-level LLVM & Clang build systems and the compiler-rt one.


Thanks a lot, Chris. However, during these weeks trying to build LLVM
myself, I learnt the issue is more of a mindset thing. I believed LLVM
was developed with a mindset/style similar to mine because its
warnings messages so closely match my way of coding, but, while
patching LLVM for building it in older systems, I learnt -from
patches/reports discussions- that LLVM development recommends
cutting-edge OS versions and discourages continued support of systems
that were supported at some moment.

That's a valid strategy, but opposite to my needs and my style. I
won't argue against it because it's a valid paradigm, but however it
turns clang into a compiler I'll only be able to use on a very small
subset of the Unices I support. I tried hard these weeks because I
really like clang, but I just found myself in a no way out road, a
symptom that it's not for me.

Thanks anyway,