This blog post is to announce the first binary release of a portable LLVM Clang compiler, version 3.3, for Linux i386.
Download the release from here: pts-clang-xstatic-bin-3.3-linux-i386.sfx.7z. You can extract it with 7z (in the p7zip package), but you can also make it executable and run it, because it's a self-extracting archive.
Clang itself is a cross-compiler, so it can generate object files for many architectures and operating systems (see the -target flag), but you also need a system-specific linker (not included) to build binaries or libraries. To run the clang tool in this release, you need a Linux i386 or a Linux x86_64 system.
This release introduces a non-standard command-line flag -xstatic which enables the Linux i386 target with static linking using the bundled uClibc library. The required .h and .a files, as well as a portable GNU ld linker binary are also included for the use of this flag.
The rest of this blog post is a copy of the README.
This directory contains a portable Linux i386 version of the clang tool of the LLVM Clang compiler (http://clang.llvm.org/), version 3.3. C and C++ compilation is supported, other frontends (such as Objective C) were not tested. This modified release of the tool also supports a non-standard command-line flag -xstatic, which makes it create statically linked Linux i386 binaries, using the uClibc 0.9.30.1 etc. libraries in the xstatic subdirectory. Without -xstatic the system glibc and libraries in /usr/lib and /lib are used.
To use this software on a Linux i386 or Linux x86_64 system, extract it to any directory, and create symlinks to bin/clang and bin/clang++ on a directory on your $PATH.
Clang relies on the library header (.h) and library code (.so and .a) files on the system, and also the GNU linker (/usr/bin/ld). It doesn't need GCC though. If you specify -xstatic, these system files won't be needed, all the .h and .a files and s statically linked version of the GNU linker ld will be used from the xstatic subdirectory.
The included clang tool doesn't use any system libraries (.so files) to run, all dependencies are included. With -xstatic, the whole compilation and linking end-to-end doesn't use any other files outside this release directory (except for the temporary files it creates in /tmp), so it can be run in a chroot environment.
Please note that even though Clang 3.3 supports C++11, much of that is implemented in the C++ standard library (GCC's libstdc++ or Clang's libc++), and no attempt is made in this binary release to provide the most up-to-date C++ standard library. With -xstatic, a pretty old libstdc++ is provided, and without -xstatic the system's default libstdc++ will be used, which can be older than C++11.
The binaries here were created by Péter Szabó