summaryrefslogtreecommitdiff
path: root/Toolchain/CMake
AgeCommit message (Collapse)Author
2021-11-14Toolchain: Enable clang-tools-extra for LLVMAndrew Kaster
If we want to use clang-tidy on the codebase, we'll need to build clang-tidy from an LLVM that has been patched and built with Serenity cross-compilation support.
2021-11-07CMake: Assume working compiler instead of using static linkingTim Schumacher
We were previously using TRY_COMPILE_TARGET_TYPE to bypass the compiler check at the beginning of the CMake build, since we don't have LibC available and therefore can't link at that point. However, this breaks a lot of assumptions in try_compile when it comes to library checks. While this was the main idea behind our usage of the flag, it also has some really nasty side effects when software wants to find out what library a symbol is in. Instead, just manually tell CMake that our compiler works as intended and keep the target type setting at its default.
2021-10-31Toolchain: Use dynamic paths for cross-compile CMake toolchainsTim Schumacher
`CMAKE_INSTALL_PREFIX` is supposed to be the in-system installation path. The sysroot path on the host doesn't belong there, since other applications will duplicate that path when applying their respective sysroot.
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-15Meta+Toolchain: Rename CMAKE_CXXFILT to SERENITY_CXXFILTAndrew Kaster
The "CMAKE_<foo>" variable namespace is reserved, and CXXFILT is not currently a variable known to upstream CMake.
2021-09-15Meta: Switch to a SuperBuild that splits host and target buildsAndrew Kaster
Replace the old logic where we would start with a host build, and swap all the CMake compiler and target variables underneath it to trick CMake into building for Serenity after we configured and built the Lagom code generators. The SuperBuild creates two ExternalProjects, one for Lagom and one for Serenity. The Serenity project depends on the install stage for the Lagom build. The SuperBuild also generates a CMakeToolchain file for the Serenity build to use that replaces the old toolchain file that was only used for Ports. To ensure that code generators are rebuilt when core libraries such as AK and LibCore are modified, developers will need to direct their manual `ninja` invocations to the SuperBuild's binary directory instead of the Serenity binary directory. This commit includes warning coalescing and option style cleanup for the affected CMakeLists in the Kernel, top level, and runtime support libraries. A large part of the cleanup is replacing USE_CLANG_TOOLCHAIN with the proper CMAKE_CXX_COMPILER_ID variable, which will no longer be confused by a host clang compiler.
2021-06-03Toolchain: Use gcc's arHediadyoin1
the vanilla versions might not handle all things, that gcc can do; For example is lto not really supported by the vanilla versions source: https://gcc.gnu.org/wiki/LinkTimeOptimizationFAQ
2021-06-02Toolchain: Set CMAKE_AR to the right executableOleg Kosenkov
2021-04-25Toolchain: Update cmake platform definitionGunnar Beutner
This fixes building cmake and other ports which use cmake to detect whether we have -ldl.
2021-04-20Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIRPanagiotis Vasilopoulos
2021-04-18Toolchain: Enable -fexceptions and build a separate libstdc++ for the kernelGunnar Beutner
This enables building usermode programs with exception handling. It also builds a libstdc++ without exception support for the kernel. This is necessary because the libstdc++ that gets built is different when exceptions are enabled. Using the same library binary would require extensive stubs for exception-related functionality in the kernel.
2021-04-17Toolchain: Fix cmake definition for CMAKE_DL_LIBSGunnar Beutner
We don't have libdl (yet) so update the CMAKE_DL_LIBRARY definition to match.
2021-04-16Ports: Make sure ports are installed into /usr/localGunnar Beutner
2021-04-16Toolchain+Ports: Move the CMake toolchain file into a subdirectoryGunnar Beutner
2021-04-16Toolchain: Add platform definition for CMakeGunnar Beutner
This also ensures that pkg-config finds packages in /usr/local and changes the install prefix to /usr/local.