summaryrefslogtreecommitdiff
path: root/Toolchain
AgeCommit message (Collapse)Author
2022-07-19Toolchain: Don't pass `-lpthread` when pthreads are requestedTim Schumacher
This is essentially a no-op since we have our replacement linker script, but if we can skip over that entirely, why not?
2022-07-19Everywhere: Fully remove the separate LibPthread directoryTim Schumacher
2022-07-19LibPthread: Move the pthread and semaphore implementation to LibCTim Schumacher
This additionally adds some compatibility code to redirect linking attempts for LibPthread to LibC instead.
2022-07-16Toolchain: Update mold to 1.3.1Tim Schumacher
2022-07-13Meta+Ports: Automatically generate a meson cross file that we can useTim Schumacher
2022-06-30Toolchain: Remove workarounds for initializer_list and _aligned_allocAndrew Kaster
These are no longer required to use libc++ on Serenity
2022-06-30Toolchain: Create separate serenity xlocale support fileAndrew Kaster
2022-06-30Toolchain: Format llvm patches per new patch formatAndrew Kaster
This removes the patch series 1/N comments, git version at the bottom of the patch, and zeros out the original commit hash.
2022-06-30Toolchain+Ports: Install host ruby into Local/ruby, not Local/$ARCHAndrew Kaster
Following the pattern for qemu, mold, and clang, we should install the host ruby required to build the ruby port into its own install tree rather than forcing it into the GNU compiler's bindir.
2022-06-30Toolchain+Ports: Install host python into Local/python, not Local/$ARCHAndrew Kaster
Following the pattern for qemu, mold, and clang, we should install the host python required to build the python port into its own install tree rather than forcing it into the GNU compiler's bindir.
2022-06-30Toolchain: Set '/' as default division character for binutilsTim Schumacher
While we are at it, regenerate the patch and remove some outdated parts of the description.
2022-06-29Toolchain: Update Platform files to match those in upstream cmakeAndrew Kaster
Serenity support was merged into the CMake master branch for the 3.25.0 milestone (https://gitlab.kitware.com/cmake/cmake/-/merge_requests/6837) Remove some settings that are now redundant from the Toolchain files.
2022-06-21Revert "Toolchain: Load x64 executables at a higher address"Tim Schumacher
Now that the lower pages can be unmapped and more of the virtual address range is available to us, we can actually use the default mapping address of x86_64 again. This reverts commit 292398b5857d0104f7c33fdb5d79f45fe8b395dd.
2022-06-19Toolchain: Update mold to 1.0.3kleines Filmröllchen
2022-06-11Toolchain: Add $arch-pc-serenity-clang symlinkDaniel Bertalan
This will allow us to build ports that don't allow the --target and --sysroot compiler arguments to be specified in $CC/$CXX.
2022-05-20Toolchain: Fix shellcheck warningDaniel Bertalan
2022-05-19Toolchain+Ports: Split the GCC patchesDaniel Bertalan
This shouldn't cause any breaking changes, so a toolchain rebuild is not required. As per Hendiadyoin's request, math errno is disabled by default, which should enable some extra compiler optimizations in LibGL and LibSoftGPU code that uses math functions heavily. Co-Authored-By: Ali Mohammad Pur <mpfard@serenityos.org>
2022-05-12Toolchain: Upgrade to GCC 12.1.0Daniel Bertalan
This release brings support for various C++23 constructs like `if consteval` and multidimensional subscript operators. Vectorization is now enabled for O2 too, and `-ftrivial-auto-var-init` has been added which can help us find and prevent security issues coming from uninitialized variables. Toolchain/Patches/gcc.patch is now significanly smaller as some unused, autoconf-generated code has been removed.
2022-05-08Toolchain: Allow BuildQemu.sh to resume downloadsLucas CHOLLET
Use -C option for curl to resume if a partially downloaded file already exists.
2022-05-02Toolchain: Enable LLVM Profile instrumentationAndrew Kaster
Add a patch to let llvm's InstrProfiling modules know serenity supports all the Unix-y features required to make -fprofile-instr-generate and -fcoverage-mapping work properly on target.
2022-04-25Toolchain: Explicitly install llvm-config and FileCheckAndrew Kaster
Also disable the "toolchain only build" to ensure we install llvm headers for when we want to build host tools that link against llvm.
2022-04-23Toolchain: Update BuildQemu.sh to qemu-7.0EWouters
QEMU 7.0 was released on April 19th. Release Notes: https://wiki.qemu.org/ChangeLog/7.0
2022-04-23Toolchain+Ports: Update LLVM to 14.0.1Daniel Bertalan
Besides a version bump, the following changes have been made to our toolchain infrastructure: - LLVM/Clang is now built with -march=native if the host compiler supports it. An exception to this is CI, as the toolchain cache is shared among many different machines there. - The LLVM tarball is not re-extracted if the hash of the applied patches doesn't differ. - The patches have been split up into atomic chunks. - Port-specific patches have been integrated into the main patches, which will aid in the work towards self-hosting. - <sysroot>/usr/local/lib is now appended to the linker's search path by default. - --pack-dyn-relocs=relr is appended to the linker command line by default, meaning ports take advantage of RELR relocations without any patches or additional compiler flags. The formatting of LLVM port's package.sh has been bothering me, so I also indented the arguments to the CMake invocation.
2022-04-01Toolchain: Fix the gdb build for aarch64 target on macOS hostJames Mintram
2022-03-31Toolchain: Add a gcc patch to fix linker error on M1 hostJames Mintram
2022-03-29Toolchain: Fix serenity.nixjd
* x11 package name has changed to xlibsWrapper. * texinfo is necessary for Makeinfo. * e2fsprogs was recenty fixed on nicpkgs to include fuse2fs to mount serenity images without root access but it needed some configuration.
2022-03-24Toolchain: Update gdb to 11.2Daniel Bertalan
2022-03-19Toolchain: Make wint_t unsigned for ClangTim Schumacher
2022-03-19Toolchain: Enable IFUNC support for GCCTim Schumacher
2022-03-19Toolchain: Enforce correct sizes for size_t and ptrdiff_tTim Schumacher
2022-03-08Toolchain: Move nix script from Documentation into ToolchainJonathan Marler
Moves the nix script to setup the build environment from Documentation into the Toolchain as a callable script. I also modified the script to accept a "pkgs" argument to make it easy to override the nixpkgs version from the command-line when calling the script.
2022-03-04Kernel: Add support for SA_SIGINFOAli Mohammad Pur
We currently don't really populate most of the fields, but that can wait :^)
2022-02-19Toolchain: Set CMAKE_NM for Clang and GNU toolchain filesAndrew Kaster
Make sure that we set CMAKE_NM, it's possible that some version of CMake could choose a host nm binary instead of the ones we just built. It's unlikely that host nm will understand our .dyn.relr segments unless it's from binutils 2.38 or higher, so it might complain.
2022-02-14Toolchain: Update Dockerfile to use gcc 11 and add texinfo packageAndrew Kaster
Missed this in the gcc 11 version update, but if anyone is using this then they'll need gcc 11 to build Lagom.
2022-02-13Toolchain: Fix QEMU build with latest gcc by disabling `-fcf-protection`Brian Gianforcaro
I noticed after upgrading my machine that the QEMU is no longer building due to GCC enabling `-fcf-protection` by default, even for targets that don't support it. The included patch came from the QEMU development list, but hasn't be included in any patch releases at the time of writing. https://lore.kernel.org/all/20220208211937.79580-1-vineetg@rivosinc.com/ Until QEMU patches, lets fix it on our end by patching before we build.
2022-02-11Toolchain: Update binutils to version 2.38Daniel Bertalan
This version comes with general fixes and, more importantly, introduces support for the packed RELR relocation format.
2022-01-24Toolchain: Add support for building the userland with the mold linkerDaniel Bertalan
This commit adds support for building the SerenityOS userland with the new [mold linker]. This is not enabled by default yet; to link using mold, run the `Toolchain/BuildMold.sh` script to build the latest release of mold, and set the `ENABLE_MOLD_LINKER` CMake variable to ON. This option relies on toolchain support that has been added just recently, so you might need to rebuild your toolchain for mold to work. [mold linker]: https://github.com/rui314/mold
2022-01-24Toolchain: Backport support for the mold linkerDaniel Bertalan
The `-fuse-ld=mold` flag was only added in the not-yet-released GCC 12. Cherry-picked from the following upstream commit: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ad964f7eaef9c03ce68a01cfdd7fde9d56524868
2022-01-24Toolchain+Ports: Use the GNU hash format by defaultDaniel Bertalan
This hash format offers faster symbol lookup than the System V hash. We've been using it in all our shared libraries for a long time, but did not have it enabled by default in our toolchain, so ports couldn't make use of it.
2022-01-24Kernel+Toolchain: Use `.init_array` section for global constructorsDaniel Bertalan
Before this change, our dynamic linker's global constructor handler relied on the GNU linker implicitly including the content of `.ctors` section inside `.init_array`. The mold linker does not do this, so global constructors would fail to be called in the mold-built userland. There is no point in sticking to `.ctors`, as most other systems already use the superior `.init_array` scheme. This commit changes the kernel linker script to not discard this new section, and enables it by default in our toolchain.
2022-01-12Toolchain: Enable the `-rdynamic` flag in the gcc driverDaniel Bertalan
Although we handle it in the linker spec file, gcc will actually reject this argument unless it's also enabled in the option file. CMake adds this flag if the minimum required version is 3.3 or less (see CMP0065), so old projects would fail to compile because of this unrecognized option.
2022-01-12Toolchain: Enable std::filesystem support in libc++Daniel Bertalan
Now that the last missing function (`fchmodat(2)`) has been added to LibC, libc++ compiles successfully with std::filesystem support enabled.
2022-01-10Toolchain+CI: Link LLVM with LLD if availableDaniel Bertalan
According to most benchmarks, LLD is faster than GNU ld and the macOS linker, so let's use it if possible in order to speed up the toolchain build.
2022-01-10Toolchain: Do not overwrite libraries with stubs when rebuilding LLVMDaniel Bertalan
We erroneously appended ".so" after the base name for the library, so we ended up checking for the existence of e.g. `libc.so.so`, which obviously didn't exist, so we overwrote the existing libraries when we rebuilt the toolchain.
2022-01-10Toolchain: Don't use GNU objcopy in the LLVM toolchainDaniel Bertalan
Our build of LLVM's objcopy now supports the single missing feature (--update-section) that previously forced us to use the one from GNU Binutils. This means that there is no reason anymore to build Binutils alongside LLVM's tools.
2022-01-10Toolchain: Backport `--update-section` support to llvm-objcopyDaniel Bertalan
This commit backports the LLVM commit that adds support for the `--update-section` flag to llvm-objcopy. We use this feature of GNU objcopy to embed the symbol map in the kernel. The corresponding LLVM Phabricator Differential Revision can be found here: https://reviews.llvm.org/D112116 This patch is identical to the upstream commit, except for two hunks that had to be changed as they didn't apply cleanly.
2022-01-09Toolchain: Fix macOS build failure due to a malformed patchDaniel Bertalan
Discord user aesophor pointed out that the GCC toolchain fails to build on macOS, and traced the issue back to 41ea37f2, which is the latest change to `gcc.patch`. Similarly, when I tried to run BuildIt.sh in the `--dev` mode, `git apply` complained about the patch being malformed. I regenerated the patch by manually applying the changes of 41ea37f2 on top of a known good GCC source tree, and I sent the new file to them. They reported that this fixed the build issue they were having.
2022-01-07Toolchain/GCC: Declare we don't have memalignMartin Bříza
I'm not even sure if this is a hack. However, we don't implement memalign so it's necessary to tell GCC so it doesn't go looking for it in their implementation of `new`
2022-01-04Toolchain: Fix building the aarch64 toolchainDaniel Bertalan
The `aarch64/t-aarch64` makefile fragment needs to be included for the aarch64-specific parts of GCC to be built. Before 738e52da5, this was done implicitly, but now it is not. This caused the following error when building the toolchain: "aarch64-builtins.o: No such file or directory".
2022-01-04Toolchain: Add support for Clang on MacOSJean-Paul Balabanian
This commit adds Darwin as a possible host for building the toolchain with Clang.