Commit graph

359 commits

Author SHA1 Message Date
Timothy Flynn
2f66d7b3ba Meta: Update ICU to version 74.2#2
There is no functional change here, but they added an error message to
the install output to indicate what host tools need to be installed.
This has tripped some people up, so it seems worth updating to.
2024-06-23 10:30:23 +02:00
Timothy Flynn
946a09d355 Meta: Re-bootstrap vcpkg when we update its version
Fetching package versions that were shipped after vcpkg was last
bootstrapped requires re-bootstrapping vcpkg.
2024-06-23 10:30:23 +02:00
Andrew Kaster
527632f416 CI: Re-enable libjs-test262 and test-wasm runs 2024-06-22 11:10:15 -04:00
Timothy Flynn
b36ab480bf Meta+Toolchain+CI: Add a script to bootstrap vcpkg
And hook it into ladybird.sh for convenience. The script will set up
PATH and other environment variables automatically.

On CI, vcpkg is theoretically already installed on Linux machines, but
not with the right environment variables, and not on macOS. So this also
makes CI use this script to bootstrap vcpkg.
2024-06-06 11:27:03 -04:00
Andrew Kaster
dd1fbd3513 Meta: Remove SerenityOS components not needed for Ladybird 2024-06-03 10:53:53 +02:00
Gurkirat Singh
e444b0aace Toolchain+Docs: Improve the way to enable clangd
Allowing an environment variable to enable/disable the build for clangd
and other toolchains will improve the developer-experience than
reconfiguring and building the toolchain manually.

Now you will have to call the command as following
	$ CLANG_ENABLE_CLANGD=ON Toolchain/BuildClang.sh
2024-05-23 00:54:20 -06:00
Kenneth Myhra
1e60b4ec40 Toolchain: Set cpu_family in meson cross files to SERENITY_ARCH 2024-05-16 10:55:16 +02:00
Timothy Flynn
daa9e852c9 Toolchain+CI: Remove unused TRY_USE_LOCAL_TOOLCHAIN parameter
This was used to create a .tar of the built Clang toolchain, but now we
just upload the built toolchain artifacts (same as the GNU toolchain).
2024-05-15 15:20:29 -06:00
Kristoffer Ellersgaard Koch
aa3e13b707 nix-shell: Disable gcc hardening to be able to build toolchain
Currently, if building under `nix-shell Toolchain`, serenityOS'
gcc won't build because of hardening options added in nix,
more specifically the breaking format-security.
2024-05-14 13:57:25 -06:00
Dan Klishch
ce5813d6ab LibC: Remove libssp_nonshared.a
__stack_chk_fail_local, which libssp_nonshared.a provides, is a relic of
i386 times and is not used on modern architectures.
2024-05-07 16:39:17 -06:00
Liav A.
872b6f626e Toolchain/Stubs: Fix small typo in README.md 2024-04-28 07:25:41 -06:00
Tim Schumacher
5f088f3233 Meta: Trim the CI ccache down to files used in the current build 2024-04-23 22:00:07 -04:00
Dan Klishch
fa1eef8bbe Toolchain: Update LLVM to 18.1.3
Apart from bumping the toolchain Clang's and port's version, this commit
completely overhauls the way LLVM toolchain is built.

First, it gets rid of a complicated two-stage process of first compiling
clang and compiler-rt builtins and then building libunwind, libc++abi,
and libc++ -- it is possible to create a complete cross-compilation
toolchain in a single CMake invocation with a modern LLVM. Moreover, the
old method was inherently unsupported and subtly broken.

Next, it utilizes full potential of the Stubs "framework". Now we are
even able to compile Clang with -Wl,-z,defs which makes one of the
patches obsolete and the whole installation less error-prone. Note that
it comes at a cost of complicating the bootstrap process on a completely
novel architecture but this hopefully won't happen often.

Lastly, it fixes handling of the -no*lib* family of flags in the
Serenity LLVM driver and correctly uses -nostartfiles in conjunction
with stubs to make necessary CMake configure-time checks succeed.
2024-04-18 13:14:33 -06:00
Andrew Kaster
3b84b03d62 Toolchain: Cherry-pick gcc patch for poisoned includes on libc++ hosts
Port the fix for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111632
which was committed to gcc/master as
https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=9970b576b7e4ae337af1268395ff221348c4b34a

This fixes the GCC Toolchain build on macOS hosts, and presumably
FreeBSD-15 as well.
2024-04-17 11:12:49 +02:00
RGBCube
720feaa658 nix: Clean up files, use good practices 2024-03-25 14:19:34 -06:00
Idan Horowitz
f7a1f28d7f Kernel: Add initial basic support for KASAN
This commit adds minimal support for compiler-instrumentation based
memory access sanitization.
Currently we only support detection of kmalloc redzone accesses, and
kmalloc use-after-free accesses.

Support for inline checks (for improved performance), and for stack
use-after-return and use-after-return detection is left for future PRs.
2023-12-30 13:57:10 +01:00
networkException
20162874e0 Toolchain: Use nixos-unstable instead of nixpkgs master in flake
This patch updates the flake to track the nixos-unstable branch instead
of master for the nixpkgs flake input.

This ensures that hydra.nixos.org (the NixOS CI) has built all packages,
made them available in the cache.nixos.org binary cache without the risk
of a definitions (evalulation) being broken on master.
2023-12-04 08:03:29 +00:00
Timothy Flynn
2cb977e368 Toolchain: Actually compile the GN binary in BuildGN.sh
The gen.py script only generates the build.ninja file for GN. We have to
explicitly build it afterwards.

This also sets the executable bit on BuildGN.sh.
2023-11-14 09:36:36 -05:00
networkException
4aa5816651 Toolchain: Use gcc13 serenity.nix 2023-10-31 18:09:14 +01:00
Daniel Bertalan
4defa401d3 Toolchain+Ports: Update binutils to 2.41
Aside from a straightforward rebase, this contains an out-of-tree patch
from MaskRay which adds the `-Bsymbolic-non-weak-functions` flag to ld.
2023-09-18 10:26:42 +02:00
Daniel Bertalan
ae21002cb5 Toolchain+Ports: Update GCC to 13.2.0
This is a minor bugfix release, which to my knowledge contains nothing
of importance to us. However, there is one QoL change to our patches.

We no longer force `-fpic` in the compiler driver, and instead use the
`--enable-default-pie` configure option to generate position-independent
code suitable for executables. For building shared libraries, the
`-fpic` flag must be specified explicitly.
2023-09-18 10:26:42 +02:00
Daniel Bertalan
d87fbcccb7 Toolchain+Ports: Update QEMU to 8.1.0
This version contains my patch that adds support for the proprietary
VideoCore mailbox message for reading the kernel command line, so
patches aren't needed anymore.
2023-09-17 15:26:20 -06:00
EWouters
05d8e2f6f8 Toolchain: Remove dependency on gnu-sed for Clang on Darwin 2023-09-17 15:18:03 -06:00
Ali Caglayan
0347d04289 Ladybird: Add ladybird.nix to nix flake in Toolchain/
Add another dev shell to `Toolchain/flake.nix` called `ladybird.nix`
that pulls in the dependencies for building Ladybird.

Also update the documentation to mention building with a flake.
2023-09-09 11:22:00 -06:00
Ali Caglayan
f46b393d2d Toolchain: Add Toolchain/nix-profiles/ to .gitignore
Let users save their nix develop derivation in a profile by ignoring
this specific folder. It encourages the following workflow:

```
nix develop Toolchain/ --profile Toolchain/nix-profiles/dev
```

Which stops the dev enviornment being collected in the nix store. Later
devs can come back and do:

```
nix develop Toolchain/nix-profiles/dev
```

To continue where they left off, without having to download everything
from nixpkgs again.
2023-09-01 11:52:04 +02:00
Ali Caglayan
0124d731ce Toolchain: Remove xlibswrapper and add python3 to serenity.nix
xlibswrapper is removed from `Toolchain/serenity.nix` as it is a
wrapper package and has been deprecated. We don't use it in the build
anyway.

This fixes #19286

During the build, python3 is required so we add `python3` as a build
dependency.
2023-09-01 11:52:04 +02:00
Ali Caglayan
47e0ea8e42 Toolchain: Add nix flake
Add a nix flake to `Toolchain/` that wraps the existing nix derivation
`Toolchain/serenity.nix`. This also comes with a lockfile making the nix
developer enviornment setup more reproducible.

We also update the documentation for "other builds" to mention the
flake.
2023-09-01 11:52:04 +02:00
Andrew Kaster
50383d318c Toolchain: Add a script to build GN from source 2023-08-19 21:05:06 -06:00
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