Commit graph

331 commits

Author SHA1 Message Date
kleines Filmröllchen 096cecb95e Everywhere: Add RISC-V 64 target to the build system
This is a minimal set of changes to allow `serenity.sh build riscv64` to
successfully generate the build environment and start building. This
includes some, but not all, assembly stubs that will be needed later on;
they are currently empty.
2023-08-18 08:37:43 -06:00
kleines Filmröllchen 0b91d36a1e Toolchain: Build Clang with RISC-V support 2023-08-11 13:35:17 +02:00
kleines Filmröllchen e21af23754 Toolchain: Provide the RISC-V 64 emulator with our QEMU build 2023-08-11 13:35:17 +02:00
Sönke Holz 9522794a0e Toolchain: Add (basic) support for riscv64
This makes `ARCH=riscv64 Toolchain/BuildGNU.sh` work, but the patches
might not be completely correct.
2023-08-11 09:20:08 +02:00
Sergey Bugaev 6a4cdc3ef2 Toolchain: Enable Objective-C and Objective-C++ 2023-07-29 16:52:11 -06:00
Tim Schumacher 9410f0a96c Toolchain: Copy the same headers as GNU when building Clang
We were previously missing `Kernel/Arch`, which gets included by
`Kernel/API`.

While at it, remove `AK` from the list of copied headers for the
toolchain, as nothing in our LibC headers should ever publicly depend on
AK.
2023-07-19 00:19:35 -06:00
Shannon Booth 4e911cb40e Toolchain: Update cmake to 3.26.4
Also update the comment so that people remember to update the port at
the same time, and clarify that updating `cmake-version.cmake` is not
required if there is no change in cmake that we need in our buildsystem.
2023-07-16 00:05:53 -06:00
Shannon Booth 2b46e6f664 Everywhere: Update copyrights with my new serenityos.org e-mail :^) 2023-07-15 16:21:29 +02:00
implicitfield 941d68ac2d Toolchain+Ports: Update LLVM to 16.0.6 2023-06-27 12:40:38 +02:00
implicitfield 79adeb626b LibC+LibELF: Move ELF definitions from LibC to LibELF
This is needed to avoid including LibC headers in Lagom builds.
Unfortunately, we cannot rely on the build machine to provide a
fully POSIX-compatible ELF header for Lagom builds, so we have to
use our own.
2023-06-27 12:40:38 +02:00
implicitfield 7d19abda7a LibC+LibRegex: Move regex_defs.h from LibC to LibRegex
This is needed to avoid including LibC headers in Lagom builds.
2023-06-27 12:40:38 +02:00
Jelle Raaijmakers 5ff80b60cf Meta: Rename BuildIt.sh to BuildGNU.sh
Bring it in line with `Toolchain/BuildClang.sh`.
2023-06-12 16:22:55 -07:00
networkException 0e5ec8c0ab Toolchain+Ladybird: Declare dependencies in correct nix file
The dependencies added in b5e9b9a939
are a better fit for Ladybird/ladybird.nix
2023-06-04 10:01:34 +02:00
networkException b5e9b9a939 Toolchain: Add qt6.qt{base,svg} to serenity.nix
This is required for building ladybird.
2023-06-02 20:05:51 +02:00
networkException 43182285fd Toolchain: Sort packages in {nativeB,b}uildInputs nix lists 2023-06-02 20:05:51 +02:00
Daniel Bertalan 41f7f821f6 Toolchain+Ports: Use ftpmirror.gnu.org for faster downloads
This service automatically redirects to a mirror that's geographically
closer, which should make downloading the tarballs faster. The GNU
project recommends this instead of bombarding their top-level downloads
site.
2023-05-28 06:34:12 -07:00
Daniel Bertalan 9bceff88c8 Toolchain: Fix Linux libisl detection in BuildGDB.sh
There is no top-level `isl.h`, let's check for `isl/version.h` instead.
2023-05-28 06:34:12 -07:00
Daniel Bertalan 6bcd73a2ff Toolchain: Disable libstdc++ PCH compilation
These are not useful for us, and unnecessarily waste time when building
the toolchain. Even if we used libstdc++ more heavily, our use of
uncommon, PCH-affecting flags and our frequent LibC header changes would
make these ineligible for use anyways.
2023-05-28 05:05:09 -06:00
Daniel Bertalan 58da4c93fb Toolchain+CI: Remove cache handling logic from BuildIt.sh
Instead of manually compressing/decompressing a toolchain tarball if
`TRY_USE_LOCAL_TOOLCHAIN` is set, let's use the cache action's automatic
built-in compression (which is zstd, I believe).
2023-05-28 05:05:09 -06:00
Daniel Bertalan 02fe3feb71 Toolchain: Enable RELRO support for AArch64
The BFD linker requires the `COMMONPAGESIZE` emulation parameter to be
set in order to enable RELRO support for AArch64. As we are adding a
custom `emulparams` file anyways, let's also tell LD that our ELF
interpreter is called `/usr/lib/Loader.so`.

This commit also removes some vestigial references to i686 SerenityOS.
The one in `gas/configure.tgt` is still needed, as it also handles
x86_64.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 07918b79b7 Toolchain+Ports: Update GCC to 13.1.0
This is a mostly straight-forward rebase of our patches on top of
13.1.0. The spec files needed a change, as GCC no longer supports STABS
debug information, but we were building GCC with support for it.

Highlights of this release include static `operator()`, The Equality
Operator You Are Looking For and extended `constexpr` support.
2023-05-15 07:00:29 +02:00
Daniel Bertalan 4809f60e2d Toolchain: Use xz-compressed GCC and Binutils archives
This reduces the downloaded archives' size from 143+46 MB to 81+25 MB.
2023-05-15 07:00:29 +02:00
Kenneth Myhra 50413c2326 Toolchain: Replace inline nproc with get_number_of_processing_units() 2023-05-07 14:29:25 +02:00
MacDue 4c2ad70066 Toolchain: Use ninja to bootstrap CMake
For some reason (for me) on Ubuntu 22.04 the standard make generator
fails:

  ---------------------------------------------
  CMake has bootstrapped.  Now run gmake.
  make: make: Permission denied
  make: *** [Makefile:166: all] Error 127

This seems to be because Source/kwsys/CMakeFiles/cmsys.dir/depend is
missing or not generated. Using ninja works fine though, and as it is
already the default for Serenity proper, it seems reasonable to switch
it here too.
2023-05-06 22:04:12 +02:00
Daniel Bertalan 20fcbcb860 Toolchain: Patch QEMU to support reading kernel cmdline via RPI Mailbox
This commit backports my upstream QEMU patch to implement this
functionality, which is currently waiting for review.

It was submitted here:
https://lists.nongnu.org/archive/html/qemu-arm/2023-04/msg00549
2023-04-29 08:24:18 +02:00
Daniel Bertalan a7f61a15af Toolchain: Fix self-built QEMU crashing on startup on macOS
If the SDL libraries are present on the system, QEMU will attempt to use
that for rendering the UI. This causes a crash when the AArch64 port
starts up with the following message:

> NSWindow drag regions should only be invalidated on the Main Thread!

Fix this by explicitly disabling SDL support.
2023-04-29 08:24:18 +02:00
Kenneth Myhra f5cb46e316 Toolchain: Exit Build*.sh scripts if executed as root 2023-04-25 01:53:42 -06:00
Kenneth Myhra 1cc095c5ab Toolchain+Ports: Consolidate version information for QEMU
This consolidates version information, archive's download location,
filename and SHA256 checksum into version.sh. This file is then sourced
from the port script and toolchain build script.

The version.sh script contains the following variables:
- QEMU_VERSION           - Version number
- QEMU_ARCHIVE           - Filename
- QEMU_ARCHIVE_URL       - Full url to download location
- QEMU_ARCHIVE_SHA256SUM - The SHA256 checksum
2023-04-23 14:20:42 +02:00
Linus Groh 8d3e941ae6 Toolchain: Add imagemagick to serenity.nix
This is required to install ports with a launcher icon.
2023-04-15 18:10:49 +02:00
Tim Schumacher 18565dd286 Ports/llvm: Increase the default stack size for LLVM executables 2023-04-14 10:05:05 +02:00
Daniel Bertalan 5ca1bd55a0 Toolchain: Move GDB build to a separate script
Target GDB is only used for debugging the kernel, which is not relevant
to most people. Starting with 924758c6f8, GDB would always be built
as part of the toolchain if the user didn't have it installed. This is
unnecessary.

This commit adds a separate script for building GDB, which the user
needs to explicitly invoke. A message is added to Meta/debug-kernel.sh
which alerts the user to this fact.
2023-04-11 06:44:13 -04:00
Tim Schumacher 83701ec54b Meta+Toolchain: Redirect GDB error output to stdout before grepping 2023-04-09 16:51:11 +02:00
Marco Cutecchia 401946947c Toolchain: Stop building QEMU with i386 support 2023-04-08 14:12:29 -07:00
Daniel Bertalan 924758c6f8 Toolchain+Meta: Support kernel debugging with host AArch64 GDB
Previously, we would unconditionally build GDB from source for the
AArch64 toolchain. This commit makes it possible to use the system's
`gdb` binary if it supports the architecture, or `aarch64-elf-gdb` if
such a package is installed.

An `aarch64-elf-gdb` package will be available through Homebrew once
this PR is merged: https://github.com/Homebrew/homebrew-core/pull/127323
2023-04-03 19:56:09 -06:00
Andrew Kaster d74fa5e283 Toolchain: Allow many patches for gdb and add clang workaround
This ports https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ae61525fcf456ab395d55c45492a106d1275873a
from upstream binutils, which enables building with the newest host
clang versions.
2023-04-02 10:52:28 +02:00
Andrew Kaster af01203733 Toolchain: Update gdb to version 13.1 2023-04-02 10:52:28 +02:00
Tim Schumacher 57516c3a9e Toolchain: Create an nm symlink for Clang
This is required for building the QEMU port using Clang.
2023-04-02 00:05:03 -06:00
Cameron Youell 0471ec0567 Toolchain: Update binutils to version 2.40 2023-03-27 16:13:48 +01:00
Cameron Youell cff303bd69 Ports/binutils: Update binutils to version 2.40 2023-03-27 14:27:32 +01:00
EWouters 9841922b6b Toolchain: Update CMake to version 3.26.0 in BuildCMake.sh 2023-03-17 09:59:35 +00:00
Linus Groh 1657a46ee7 Toolchain: Add grub2 and parted to serenity.nix
This allows building the GRUB disk image from within the nix shell.
2023-03-16 18:47:06 +00:00
Linus Groh 6d19a9f9da Toolchain: Use '|' as sed delimiter in Build{Clang,It}.sh, not '@'
The latter is problematic as it may be contained in the username (e.g.
email address-like) and thus the $SRC_ROOT path. This would cause an
invalid sed command to be created, breaking both of these scripts.
2023-03-13 20:12:44 +00:00
Tim Schumacher cd5868a0f1 Toolchain: Don't abuse crt{begin,end}.o for shared or PIE binaries
aarch64 required this to successfully build, but the actual fix to that
is to just make sure that crtbeginS and crtendS get built as a part of
the toolchain.

This partially reverts commit c18c84dbfd.
2023-03-01 12:41:56 +00:00
Baitinq 743f494a9c Toolchain: Add fuse2fs to serenity.nix
This previously missing package was needed for root-less image building
:)
2023-02-11 00:06:55 +01:00
Timon Kruiper 7eccacf418 Toolchain: Ensure aarch64 libgcc_s.so.1 includes DT_SONAME tag
Without this tag, executables that link libgcc_s.so.1, which is every
executable, end up with the host path to libgcc_s.so.1 as the path for
the dynamic dependency (DT_NEEDED) of the executable. By making sure
that the libgcc_s.so.1 shared object includes the DT_SONAME tag, the
path to libgcc_s.so.1 dynamic dependency will only contain the basename,
instead of the absolute host path.
2023-01-25 14:28:53 +01:00
Nico Weber 2949824849 Toolchain: Do not use install -D in BuildIt.sh
`-D` doesn't exist on macOS. Just call `mkdir -p` instead.
2023-01-09 19:23:20 -07:00
Nico Weber 491af34d36 Toolchain: Add macOS definitions of MD5SUM and NPROC in BuildIt.sh 2023-01-09 19:23:20 -07:00
Nico Weber f2011ad0dd Toolchain: Make BuildCMake.sh work on macOS without brew on PATH 2023-01-09 19:23:20 -07:00
kleines Filmröllchen 5ab9a9cb03 Toolchain: Fix aarch64 toolchain GDB build
We just need to pass -disable-werror, otherwise Clang will complain a
lot.
2022-12-30 15:31:04 -05:00
Liav A 55f17fff36 Meta: Remove i686 target 2022-12-28 11:53:41 +01:00