Dockerfiles for building the latest versions of a fully optimized, two-stage bootstrapped clang/LLVM, including support for libc++ and lld+LTO, directly from the sources available at the GitHub mirror of the LLVM subversion repository (https://github.com/llvm/llvm-project).
CI builds are run on GitLab, using an AWS c5.4xlarge instance to compile LLVM. Docker images based on various Linux distributions with clang preinstalled and ready-to-use are made available on Docker Hub:
- Alpine Linux: https://hub.docker.com/r/coldfusionjp/alpine-clang
- Amazon Linux: https://hub.docker.com/r/coldfusionjp/amazonlinux-clang
Below are approximate build times required to perform a full two-stage bootstap build on various hardware configurations. Note that building an LTO optimized clang/LLVM requires large amounts of memory.
MacBook Pro 2018 (2.9 GHz Intel Core i9, 32 GB RAM) with Docker engine 18.09.2 (Docker prefs: 24GB RAM, 2GB swap):
real 111m56.801s
user 0m1.014s
sys 0m1.221s
AWS c5.4xlarge EC2 instance (16 CPU cores, 32 GB RAM):
real 63m0.509s
user 0m0.996s
sys 0m0.628s