summaryrefslogtreecommitdiff
path: root/Toolchain/BuildClang.sh
AgeCommit message (Collapse)Author
2021-10-17Toolchain+Meta: Update LLVM version to 13.0.0Daniel Bertalan
This commit updates the Clang toolchain's version to 13.0.0, which comes with better C++20 support and improved handling of new features by clang-format. Due to the newly enabled `-Bsymbolic-functions` flag, our Clang binaries will only be 2-4% slower than if we dynamically linked them, but we save hundreds of megabytes of disk space. The `BuildClang.sh` script has been reworked to build the entire toolchain in just three steps: one for the compiler, one for GNU binutils, and one for the runtime libraries. This reduces the complexity of the build script, and will allow us to modify the CI configuration to only rebuild the libraries when our libc headers change. Most of the compile flags have been moved out to a separate CMake cache file, similarly to how the Android and Fuchsia toolchains are implemented within the LLVM repo. This provides a nicer interface than the heaps of command-line arguments. We no longer build separate toolchains for each architecture, as the same Clang binary can compile code for multiple targets. The horrible mess that `SERENITY_CLANG_ARCH` was, has been removed in this commit. Clang happily accepts an `i686-pc-serenity` target triple, which matches what our GCC toolchain accepts.
2021-09-21Toolchain: Add --ci option to BuildClang to enable ccacheTimothy Flynn
2021-09-07Meta: Make BuildClang.sh produce less output when running in a TTYNico Weber
Ninja disables its fancy output mode when it's not writing to a TTY. So don't pipe its output into something else, so that it writes to a TTY if the invoking terminal is a TTY.
2021-09-07Meta: Don't pass LLVM_LLVM_BUILD_LLVM_DYLIB to cmakeNico Weber
`LLVM_LLVM_BUILD_LLVM_DYLIB` does not exist, so passing this does nothing but make CMake warn. However, since we pass `LLVM_LINK_LLVM_DYLIB`, `LLVM_BUILD_LLVM_DYLIB` (the correct spelling) defaults to true anyways. So let's pass fewer flags. No behavior change, but fixes a CMake warning.
2021-09-07Meta: Make `serenity.sh rebuild-toolchain aarch64 clang` workNico Weber
2021-09-03Meta: Add the ability to specify clang with serenity.shTom
This enables maintaining gcc and clang builds side-by-side.
2021-08-17Toolchain: Make Kernel/API headers available to Clang toolchain buildTimothy Flynn
Copied from 9b7986790900a3a81edd879ea31583670977496f.
2021-08-08Toolchain: Remove static LLVM librariesDaniel Bertalan
We link against these dynamically anyways, so having them around is not useful. Removing them frees precious storage space on CI.
2021-08-08Toolchain: Build libLLVM as a dynamic libraryDaniel Bertalan
This library is used by virtually all executables in the Clang toolchain. By default, it is linked statically, which leads to huge file sizes and us running out of artifact storage disk space on CI.
2021-08-08Toolchain: Add caching to BuildClang.sh for CIDaniel Bertalan
2021-08-08Toolchain: Add LLVM patch and script for building itDaniel Bertalan
This contains all the bits and pieces necessary to build a Clang binary that will correctly compile SerenityOS. I had some trouble with getting LLVM building with a single command, so for now, I decided to build each LLVM component in a separate command invocation. In the future, we can also make the main llvm build step architecture-independent, but that would come with extra work to make library and include paths work. The binutils build invocation and related boilerplate is duplicated because we only use `objdump` from GNU binutils in the Clang toolchain, so most features can be disabled.