Commit graph

373 commits

Author SHA1 Message Date
Ali Mohammad Pur
9d11d82e2c Meta+Toolchain: Move the jakt runtime files into the Toolchain build dir
These files are all static libs and source code, and aren't needed to be
present at runtime inside the image.
2024-11-10 19:22:14 +01:00
MacDue
36a2826cd2 Meta: Enable qemu-vdagent (for copy/paste support) by default on Linux
This updates `run.py` so that it will configure the `qemu-vdagent`
(QEMU's built-in spice agent for clipboard support) when it's available.

Setting `SERENITY_SPICE=1` is only needed to use `spicevmc`, which
implements more features (such as file transfers), but requires more
setup to get working (see Documentation/SpiceIntegration.md).

This matches the behaviour of the old `run.sh` script, the logic was
changed (perhaps unintentionally) in the `run.py` rewrite.

Note: For copy/paste to work you may need to rebuild QEMU with
`--enable-gtk-clipboard` (which is added to `Toolchain/BuildQemu.sh`
for Linux as part of this patch).
2024-11-04 08:56:57 -05:00
Linus Groh
0dde58b487 Toolchain: Add a few packages for building ports to the nix shell
- autoconf, automake, and libtool for bdwgc
- gperf for fontconfig
2024-10-26 21:38:48 -04:00
Ali Mohammad Pur
25b3873c62 Toolchain: Update to latest jakt commit 2024-10-16 13:30:43 +02:00
Ali Mohammad Pur
83777ea16e Toolchain: Stamp built jakt commit hash and skip if unchanged 2024-10-16 13:30:43 +02:00
Ali Mohammad Pur
b522221429 Meta+Toolchain: Disable jakt if the compiler can't be used 2024-10-04 12:42:11 +02:00
Dan Klishch
4b70bff39a Toolchain: Update LLVM to 19.1.0
In addition to being rebased, LLVM driver no longer ever tries to link
crti.o, crtn.o, or crt0_shared.o. The code that handles -pie / -static /
-shared flags has been simplified as per MaskRay's suggestion (I made
changes similar to llvm/llvm-project@ae623d16). Tests have been updated
to match the current behavior of the driver. Note, however, that I
didn't run them with non-default CLANG_DEFAULT_* options.

The commit also removes Daniel's
-fvisibility-inlines-hidden-function-templates patch since this
functionality was never actually used and I feel like such features
should either live in upstream or be deleted.
2024-10-02 21:42:33 -04:00
Dan Klishch
4223192510 Toolchain: Do not pass CMAKE_MODULE_PATH when building LLVM
This was a leftover from the times when CMake didn't support SerenityOS
natively.
2024-10-02 21:42:33 -04:00
Ali Mohammad Pur
37baf67b01 Meta: Make it possible to build jakt files on Lagom 2024-10-02 08:10:54 +02:00
Ali Mohammad Pur
ff54fc0f07 Meta+Toolchain: Bring jakt in as a part of the toolchain
This also updates the hello-world "utility".

Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
2024-10-02 08:10:54 +02:00
vini
c1d77f3ee4 Toolchain/nix: Add some more useful packages
This commit adds the following packages:

clang-tools: Contains clangd and clang-format.
prettier
pre-commit
2024-09-22 09:06:02 -04:00
vini
8307797859 Toolchain/nix: Format nix files
The nixfmt-rfc-style package was used.
2024-09-22 09:06:02 -04:00
Nico Weber
efc6f8d7b7 Toolchain: Remove dependency on grealpath from BuildClang.sh
Regular `realpath` seems to work fine.

This removes the last coreutils dependency from BuildClang.sh.
It can now run on a system that has just ninja and cmake and Xcode
installed.

No intended behavior change.
2024-08-04 22:42:43 +02:00
Nico Weber
d8cf885f89 Toolchain: Remove dependency on install from BuildClang.sh
Less code, and makes it easier to run this script on vanilla macOS.

No intended behavior change.
2024-08-04 22:42:43 +02:00
sdomi
4db8a0b964 Toolchain: Fix default library paths when building with clang
When building with the GNU toolchain, /usr/local/lib and
/usr/local/include are among the default search paths for the compiler
and linker. It seems that this is not the case for Clang/LLVM, and thus
some packages fail to build, while others silently drop optional deps.

This commit adds those paths back, fixing multiple packages at once.
Additionally, it removes legacy -I/-L includes in various Ports which
are no longer needed.

Co-Authored-By: Nico Weber <thakis@chromium.org>
2024-08-04 11:09:53 -04:00
Nico Weber
311af9ad05 Toolchain: Use check_sha256() in BuildQemu.sh 2024-06-29 13:56:36 +02:00
Nico Weber
c1c00f9104 Meta+Toolchain: Move check_sha256 to shell_include.sh
Pure code move, no behavior change.
2024-06-29 13:56:36 +02:00
Nico Weber
046dbe27c4 Toolchain: Rename check_sha() to check_sha256()
No behavior change, just a more descriptive name.
2024-06-29 13:56:36 +02:00
Erick Howard
407dfdac37 Build: Update mold version to fix build problems
Mold issue 1178 is now fixed, so Serenity is able to build fine
using Mold
2024-06-14 06:45:36 -04: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