summaryrefslogtreecommitdiff
path: root/Toolchain
AgeCommit message (Collapse)Author
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-10-17Toolchain: Introduce stubs for core system librariesDaniel Bertalan
This allows the linker to link against these dynamic libraries when compiling libc++/libunwind, without having to do a separate bootstrapping LibC build. Without this change, libc++ would fail to pick up the need to link to `LibPthread` if no prior builds of it existed. Because of this, we'd immediately have an assertion failure in SystemServer, as mutexes are used for the safe construction of function-local static variables.
2021-10-05Everywhere: Change from http to https where feasibleBen Wiederhake
I used "git grep -FIn http://" to find all occurrences, and looked at each one. If an occurrence was really just a link, and if a https version exists, and if our Browser can access it at least as well as the http version, then I changed the occurrence to https. I'm happy to report that I didn't run into a single site where Browser can't deal with the https version.
2021-09-24Ports: Add Ruby 3.0.2Eric Seifert
2021-09-21Toolchain: Add --ci option to BuildClang to enable ccacheTimothy Flynn
2021-09-17Toolchain: Remove breaking mbstate_t define from clangTim Schumacher
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-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-07Toolchain: Build aarch64-gdb for cross-debugging on x86Idan Horowitz
2021-09-03Meta: Add the ability to specify clang with serenity.shTom
This enables maintaining gcc and clang builds side-by-side.
2021-08-28Toolchain: Also build aarch64-softmmu in BuildQemu.shNico Weber
2021-08-28Toolchain: Enough to make `rebuild-toolchain aarch64` workNico Weber
The gcc patch might not be completely correct, but at least the toolchain completes building.
2021-08-28Toolchain: Regenerate binutils.patch and gcc.patchNico Weber
I locally modified Meta/serenity.sh to pass `--dev` to BuildIt.sh in build_toolchain(). Then I ran `Meta/serenity.sh rebuild-toolchain`, cd'd into Toolchain/Tarballs/binutils-2.37, `git add`ed unadded files in `git status`, and then ran `git diff > ../../Patches/binutils.patch`. Then I did the same for Toolchain/Tarballs/gcc-11.2.0 (and was careful not to `git add` serenity-kernel.h, since that's created by Toolchain/BuildIt.sh). No behavior change. This just rewrites the patch like git writes it.
2021-08-25Toolchain: Update BuildQemu.sh to latest 6.1.0Brian Gianforcaro
Change Log: https://wiki.qemu.org/ChangeLog/6.1
2021-08-17Toolchain: Make Kernel/API headers available to Clang toolchain buildTimothy Flynn
Copied from 9b7986790900a3a81edd879ea31583670977496f.
2021-08-14Toolchain: Make Kernel/API/ headers available during toolchain buildAndreas Kling
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+Ports: Let -nostdlib make us not link against libgcc_sGunnar Beutner
For now this is not a mandatory toolchain rebuild.
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.
2021-08-03Ports: Change Python's auth_type to sha256Linus Groh
2021-07-28Toolchain+Ports: Fix building ports on x86_64Gunnar Beutner
Fixes #8377.
2021-07-28Toolchain: Update GCC to version 11.2.0Gunnar Beutner
2021-07-28Toolchain: Update binutils to version 2.37Gunnar Beutner
2021-07-24Toolchain+Ports: Ignore -arch on macOS M1 hostsGunnar Beutner
CMake specifies -arch arm64 for our toolchain. Unfortunately that's an option GCC only understands when built for macOS. This causes the build to fail. I haven't been able to get CMake to not specify that option so this adds a dummy option to GCC.
2021-07-10Toolchain: Use correct variable when deleting the QEMU tarballGunnar Beutner
2021-07-08Toolchain: Fix building toolchain on arm64 macsmodmuss50
This patch is based off: https://github.com/osx-cross/homebrew-avr/pull/248 and https://github.com/riscv/riscv-gnu-toolchain/issues/800
2021-07-06Kernel+Toolchain: Remove the kernel-specific toolchainGunnar Beutner
This is no longer necessary now that the kernel doesn't use libsupc++ anymore.
2021-07-03Meta: Change the QEMU binary directory to Toolchain/Local/qemuGunnar Beutner
Previously we'd place the QEMU binaries into the architecture-specific toolchain directory. This is a problem because the BuildIt.sh script clears those directories which also removes the QEMU binaries users may have built earlier. Also, the QEMU binaries are not specific to the target architecture.
2021-06-29Toolchain: Allow containerized work with Serenity via Dockerkleines Filmröllchen
Docker is a nice way of doing build automation, or just containerizing builds for increased safety and isolating unstable packages. The old Dockerfile in the toolchain did not satisfy these needs. The new Dockerfile is known to run successfully on Docker version 20.10.7. It clones the SerenityOS repo and builds the toolchain. In this way, it is intended to be a starting point for other Docker images that can e.g. run builds. For example, one can simply run this docker image as-is, exec a shell in it and run a build there.
2021-06-26Toolchain: Build the x86_64 target in addition to i386 in BuildQemu.shIdan Horowitz
2021-06-07Toolchain: Add `gettext` as a dependency to `Dockerfile`Jelle Raaijmakers
We need `msgfmt` inside of the `gettext` package in order to build the git port.
2021-06-07Toolchain: Add `ccache` to DockerfileJelle Raaijmakers
Following up on 2d38d56e, we were missing this in our Dockerfile.
2021-06-07Toolchain+Ports: Fix building binutils on FreeBSDGunnar Beutner
This imports the upstream patch from https://sourceware.org/bugzilla/show_bug.cgi?id=27382 Fixes #7407.
2021-06-04Toolchain: Add ImageMagick to DockerfileJelle Raaijmakers
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-05-30Toolchain: Remove dependency check for texinfoGunnar Beutner
Turns out we don't need that after all.
2021-05-30Toolchain: Check whether required tools and libraries are availableGunnar Beutner
Rather than having the toolchain build fail half-way through we should check whether the user has installed all the required tools and libraries early on.
2021-05-27Toolchain: Use set -o pipefail to the toolchain build scriptGunnar Beutner
Previously the buildstep function would obscure error codes because the return value of the function was the exit code for the sed command which caused us to continue execution even though one of the build steps had failed. With set -o pipefail the return value of the buildstep function is the real command's exit code.
2021-05-21Toolchain: Replace the -march=native flag with -mtune=nativeIdan Horowitz
This ensures inter-machine compatibility by not emitting any processor specific instructions. This fixes the issue raised by the non AVX-512 supporting GitHub actions runners.
2021-05-21Toolchain: Enable native host optimizations when building toolchainBrian Gianforcaro
-march=native specializes the binaries for the CPU features available on the CPU the binary is being compiled on. This matches the needs of the Toolchain, as it's always built and used on that machine only. This should be safe for the github actions VMs as well, as they all run on a standard VM SKU in "the cloud". I saw small but notable improvements in end-2-end build times in my local testing. Each compilation unit is on average around a second faster on my Intel(R) Core(TM) i7-8705G CPU @ 3.10GHz.
2021-05-09Toolchain+Ports: Skip link tests for libstdc++v3Gunnar Beutner
This makes stdlib.h and stdio.h functions available in the std namespace for C++. libstdc++v3's link tests can fail if you don't have an up-to-date build directory, for example: 1. Have libc with missing _Exit symbol because you haven't done a build since that was added. 2. Run toolchain rebuild. libstdc++v3's configure script will realize that it can do link tests in general but will fail later on when it tries to link a program that tests for _Exit. Even though this is a toolchain patch this does not necessarily require rebuilding the toolchain right away. This is only required once we start using any of these new members in the std namespace, e.g. for ports.
2021-05-07Toolchain: Make -nodefaultlibs not link against libgcc_sGunnar Beutner
This fixes the -nodefaultlibs flag for gcc which previously linked against libgcc_s anyway. Even though this is a toolchain patch we don't need to rebuild the toolchain right away.
2021-05-05Toolchain: Fix expansion bugs and make BuildIt.sh shellcheck compliantBrian Gianforcaro
BuildIt.sh had a bunch of SC2086 errors, where we were not quoting variables in variable expansions. The logic being: Quoting variables prevents word splitting and glob expansion, and prevents the script from breaking when input contains spaces, line feeds, glob characters and such. Reference: https://github.com/koalaman/shellcheck/wiki/SC2086 As bcoles noticed in #6772, shellcheck actually found a real bug here, where the user's build directory included spaces. Close: #6772