Commit graph

307 commits

Author SHA1 Message Date
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
Andrew Kaster d2f78a9411 Toolchain: Remove upstreamed CMake platform files :^) 2022-12-13 11:36:14 +01:00
Andrew Kaster e4a59f664b Toolchain+Meta: Add script to build CMake from source
Since we upstreamed CMake support for Serenity, we can use the Platform
files from upstream instead of keeping our local copy. While not added
in this commit, we can add patching capabilities for the platform files
similar to what we do for gdb, llvm, gcc, and binutils later.
2022-12-13 11:36:14 +01:00
Victor Hugo Aguiar Pacce e63f3f3c96 Toolchain: Add libxcrypt to serenity.nix
Should deal with build errors related to a missing crypt.h file
2022-11-13 19:38:14 +00:00
Steffen Rusitschka 6805cf00ad Toolchain: Fix missing makeinfo on macOS Ventura
macOS ventura no longer comes with makeinfo. binutils has already been
fixed - see https://github.com/SerenityOS/serenity/pull/15932

This patch does the same for GDB.
2022-11-12 07:53:52 +01:00
Christopher Wales 266882937d Toolchain: Disable makeinfo for binutils
This is necessary to build on MacOS. As discussed in #15530, Serenity
no longer appears to build on MacOS Ventura. This attempts to fix that
by enforcing it at the command level.
2022-11-05 14:23:21 -06:00
Marco Rebhan e773b9abe9 Toolchain: Use pkg-config instead of pkgconfig in serenity.nix
pkgconfig was renamed to pkg-config in nixpkgs.
2022-11-01 00:16:11 +00:00
Marco Rebhan 9c9ca8a8be Toolchain: Update gcc11 to gcc12 in serenity.nix 2022-11-01 00:15:53 +00:00
Kenneth Myhra e152a28737 Toolchain: Update BuildQemu.sh to qemu-7.1
QEMU 7.1 was released on August 30th.
Release Notes: https://wiki.qemu.org/ChangeLog/7.1

The patch 'Toolchain/Patches/qemu-cf-protection-none.patch' (or similar)
has been upstreamed so it can be safely removed.
2022-10-27 13:29:40 +02:00
Linus Groh bc2ebcadc0 Everywhere: Require version >= 12 for GCC host compiler
So far we've gotten away with using GCC 11 for Lagom and to compile the
toolchain, but via #15795 we discovered a compiler bug that has been
fixed in the latest version but would error the build with CI's GCC 11.
Time for an upgrade :^)

We already use ubuntu-22.04 images in most places, so this is pretty
straightforward. The only exception is Idan's self-hosted runner, which
uses Ubuntu Focal. LibJS should build fine with GCC 11, still.
2022-10-25 23:15:51 +01:00
Tim Schumacher e5e7ea90b1 Toolchain: Update LLVM to 15.0.3 2022-10-24 15:33:58 +02:00
Tim Schumacher 335fd20c34 Toolchain: Keep LLVM from using shm_open and friends
I originally missed this while handling the upgrade to LLVM 15 (as it
only affects the on-serenity port), so the patch gets to be here with a
bit of a delay.

Co-Authored-By: sin-ack <sin-ack@users.noreply.github.com>
2022-10-21 20:15:34 +02:00
grxnola 2c64f7f900 Toolchain: Fix nix-shell; fuse2fs is now part of e2fsprogs derivation 2022-10-20 22:51:11 +02:00
Gunnar Beutner c18c84dbfd Toolchain: Fix building libgcc for AARCH64
There was a typo in one of the spec files which resulted in us not
building softfp support for libgcc. Additionally we were missing flags
to build libgcc_s. This patch also makes sure we're not trying to
link against crtbeginS.o and crtendS.o. This is part of a larger effort
to at least get the userland to build at all.
2022-10-14 13:01:13 +02:00
Tim Schumacher 24987e2b1f Toolchain: Add SerenityOS to the LLVM config.guess 2022-10-14 12:57:55 +02:00
Tim Schumacher a61a0a63c1 Toolchain: Force makeinfo to be a no-op
Neither are we changing any of our documentation files, nor do we need
any of the documentation that is likely being built.

With macOS potentially removing makeinfo from the default Xcode lineup,
SerenityOS not being able to install it at all currently due to a lack
of perl, and it otherwise just being a dependency that has to be
installed to make the build system happy, lets just stub it out.
2022-10-11 09:28:46 +02:00
Baitinq 48389f4179 Toolchain: serenity.nix: Fix fuse2fs not being installed
Nix (nixpkgs) have updated a while back how the e2fsprogs derivation
works and now fuse2fs wasnt being installed with it. It is now needed to
add a new derivation (package) to the dependency list: "fuse2fs". This
fixes the Meta/serenity.sh script not finding the fuse2fs binary for
rootless image building :^)
2022-10-06 16:16:51 +01:00
Liav A 74018be739 Meta: Make x86-64 target the default
This is a preparation to check if our users find noticeable bugs in the
x86-64 target, before we can decide if we want to remove the i686 target
for good.
2022-10-03 11:14:53 +02:00
Andrew Kaster 9c32b9ea3c Toolchain: Update BuildMold to mold 1.5.1 and use CMake
Per the release notes for 1.5.0, the CMake build is preferred going
forward.
2022-10-03 10:01:06 +01:00
Tim Schumacher eb6c911b3a Toolchain: Hardcode the results of LLVM runtime library detection
This keeps us from accidentally building toolchains that don't make it
through a clean build if we build them using a populated sysroot, as it
would otherwise detect libpthread and friends and try to pull them in
while LibC is not yet built.
2022-10-01 18:59:51 +01:00
Tim Schumacher b52b6e8739 Toolchain: Only reextract GCC-related tarballs if patches change
This brings the behaviour in line with Clang, which already does this
since a few revisions.
2022-10-01 18:43:29 +01:00
Tim Schumacher 1faca15193 Toolchain: Move the binutils patch into its own folder
This makes binutils compatible with `./package.sh dev`, so that we can
regenerate patches more easily, and neatly stack (temporary) patches on
top.
2022-10-01 18:43:29 +01:00
Tim Schumacher cb2f0d9861 Toolchain: Regenerate patches using the latest format rules 2022-09-18 13:00:46 +04:30
Tim Schumacher 77f124c87a Toolchain: Remove references to -lm 2022-09-16 16:09:19 +00:00
Tim Schumacher 1b25c38b8b Everywhere: Fully remove the separate LibM directory 2022-09-16 16:09:19 +00:00