Commit Graph

41 Commits

Author SHA1 Message Date
Daniel Bertalan
0f2e18403c Meta: Make serenity.sh gdb work with the Clang toolchain
We now pass along the toolchain type to all subcommands. This ensures
that gdb will load the correct debug information for kernels compiled
with Clang, and the following warning won't appear with the GNU
toolchain:

> WARNING: unknown toolchain 'gdb'. Defaulting to GNU.
>         Valid values are 'Clang', 'GNU' (default)
2022-02-19 11:36:08 +01:00
czapek1337
64ff8af074 Meta: Add support for the Limine bootloader 2022-02-14 11:52:07 +01:00
Daniel Bertalan
ba5bbde7ee Meta: Enable RELR relocations
Also add a check to serenity.sh to ensure that the toolchain is new
enough for this feature to work.
2022-02-11 18:07:53 +01:00
Andrew Kaster
c62c10caf0 Meta+CI+Documentation: Bump host gcc requirement up to gcc 11
Bump macOS CI version to macOS 11 while we're here.
2022-01-07 11:02:30 +01:00
tuftedocelot
68e4e7923a Meta: Add egcc as a GCC candidate
egcc is the alias for the GCC compiler (since OpenBSD uses Clang by
default). Toolchain/BuildIt.sh has the necessary adjustments, but the
compiler check occurs before BuildIt.sh is called.
2021-12-29 03:46:56 -08:00
Linus Groh
897471c852 Meta: Don't check for toolchain if serenity.sh target is lagom
This is just silly :^)

    $ serenity run lagom js
    WARNING: unknown toolchain 'js'. Defaulting to GNU.
             Valid values are 'Clang', 'GNU' (default)
2021-11-02 11:09:05 +01:00
Ben Wiederhake
8d13f6ddce Kernel+SystemServer: Change bootmode to system_mode
'bootmode' now only controls which set of services are started by
SystemServer, so it is more appropriate to rename it to system_mode, and
no longer validate it in the Kernel.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
09432a8241 Kernel: Separate panic behavior from bootmode
Bootmode used to control panic behavior and SystemServer.
This patch factors panic behavior control into a separate flag.
2021-10-25 23:38:28 +02:00
Ben Wiederhake
542a88a7be Kernel: Separate framebuffers from bootmode
Bootmode used to control framebuffers, panic behavior, and SystemServer.
This patch factors framebuffer control into a separate flag.
Note that the combination 'bootmode=self-test fbdev=on' leads to
unexpected behavior, which can only be fixed in a later commit.
2021-10-25 23:38:28 +02:00
Daniel Bertalan
928665d3bc Meta: Support llvm-addr2line in serenity.sh
With this, the subcommands 'addr2line` and `kaddr2line` work as with the
GNU toolchain.
2021-10-17 17:09:58 +01:00
Daniel Bertalan
06fc64be13 Toolchain+Meta: Update LLVM version to 13.0.0
This commit updates the Clang toolchain's version to 13.0.0, which comes
with better C++20 support and improved handling of new features by
clang-format. Due to the newly enabled `-Bsymbolic-functions` flag, our
Clang binaries will only be 2-4% slower than if we dynamically linked
them, but we save hundreds of megabytes of disk space.

The `BuildClang.sh` script has been reworked to build the entire
toolchain in just three steps: one for the compiler, one for GNU
binutils, and one for the runtime libraries. This reduces the complexity
of the build script, and will allow us to modify the CI configuration to
only rebuild the libraries when our libc headers change.

Most of the compile flags have been moved out to a separate CMake cache
file, similarly to how the Android and Fuchsia toolchains are
implemented within the LLVM repo. This provides a nicer interface than
the heaps of command-line arguments.

We no longer build separate toolchains for each architecture, as the
same Clang binary can compile code for multiple targets.

The horrible mess that `SERENITY_CLANG_ARCH` was, has been removed in
this commit. Clang happily accepts an `i686-pc-serenity` target triple,
which matches what our GCC toolchain accepts.
2021-10-17 17:09:58 +01:00
Nico Weber
a7b558bf7d Meta: Warn on rebuild-toolchain i686 clang
It's "Clang" (capitalized). Silently building gcc if the toolchain
isn't know seems a bit unfriendly. So print a warning for this
(and for other unknown toolchains).
2021-10-07 18:34:13 +03:00
Andrew Kaster
d0506730b8 Meta: Ensure BUILD_LAGOM is set when running serenity.sh test lagom
If the superbuild created the lagom binary directory, it won't set
BUILD_LAGOM=ON in the CMake cache for that binary directory. Insert a
check into build_target() to make sure that if the user explicitly asks
for the lagom target, we have all our ducks in a row.
2021-09-16 15:47:13 +00:00
Andrew Kaster
bd7b158c71 Meta: Update serenity.sh for the SuperBuild
Direct build commands to the SuperBuild's binary directory, and
image/run commands to the Serenity binary directory.

As a side benefit, make the lagom target only build Lagom instead of the
entire OS alongside Lagom.
2021-09-15 19:04:52 +04:30
Idan Horowitz
f56bdd2bb7 Meta: Don't immediately continue in serenity.sh's gdb option
This allows us to step through the initial boot instructions.
2021-09-07 12:58:46 +02:00
Tom
77953a937d Meta: Add the ability to specify clang with serenity.sh
This enables maintaining gcc and clang builds side-by-side.
2021-09-03 23:12:17 +02:00
Linus Groh
747af8a031 Meta: Remove duplicate valid target check from serenity.sh 2021-08-29 13:50:07 +01:00
Linus Groh
2b70f32876 Meta: Mention aarch64 as a supported TARGET in serenity.sh's help 2021-08-29 13:48:35 +01:00
Nico Weber
7052f403c8 Toolchain: Enough to make rebuild-toolchain aarch64 work
The gcc patch might not be completely correct, but at least the
toolchain completes building.
2021-08-28 14:43:07 +01:00
Linus Groh
822566ff1a Meta: Let serenity.sh's TARGET default to SERENITY_ARCH, not i686
This environment variable is already widely used across our build
scripts and tooling, so serenity.sh should respect it as well.
It still uses i686 as the fallback.
2021-08-28 11:20:52 +01:00
Itamar
6f4324e64e Meta: Add 'copy-src' command to serenity.sh
This command copies the project's source tree to
/home/anon/Source/serenity in the built disk image.

This will be useful for working on serenity inside serenity :^)
2021-08-22 10:28:13 +02:00
Gunnar Beutner
9026dbbfd6 Documentation: Reorganize the build documentation 2021-07-10 23:24:45 +02:00
Gunnar Beutner
9780cdfb33 Meta: Automatically pick an appropriate GCC binary 2021-07-10 23:24:45 +02:00
Idan Horowitz
3265141286 Meta: Make serenity.sh pass the SERENITY_ARCH cmake argument for x86_64
This is required as our CMake config defaults to i686 if not overriden
manually via the SERENITY_ARCH argument.
2021-07-01 18:08:16 +02:00
Linus Groh
21a62fe836 Meta: Remove duplicated ensure_toolchain from serenity.sh 2021-06-02 00:34:41 +01:00
Jelle Raaijmakers
468bb54677 Meta: Make serenity.sh invoke cmake when build.ninja is missing 2021-06-01 11:33:56 +01:00
Gunnar Beutner
232e64c10a Meta: Add GDB pretty printers 2021-04-22 00:45:43 +02:00
Panagiotis Vasilopoulos
e45e0eeb47 Everywhere: Replace SERENITY_ROOT with SERENITY_SOURCE_DIR 2021-04-20 15:27:52 +02:00
Brian Gianforcaro
8f6a5a1c39 Meta: Add a rebuild-world command to serenity.sh
This was brought up as something that would be useful by
`RealKC` on the discord, and I happened to agree that it
would be useful. Especially given the abundance of Toolchain
changes recently.
2021-04-20 08:10:21 +02:00
Linus Groh
a48d365046 Meta: Replace /bin/env with /usr/bin/envin serenity.sh shebang
This is more portable.
2021-04-18 14:01:52 +02:00
Linus Groh
2ac9790883 Meta: Remove stray newline from serenity.sh help text 2021-04-17 19:16:19 +02:00
Brian Gianforcaro
253114e3b1 Meta: Allow serenity.sh to be used outside of assumed working directory
This change fixes two bugs:

1) If you run `serenity.sh` outside of your serenity git clone, the
   `get_top_dir()` function won't be able to auto detect the serenity
    root dir and we'll error out. By allowing the script to use an
    existing $SERENITY_ROOT vlaue if it exists, we can solve
    this problem.

2) If tried to run a command which ends up calling `build_toolchain()`
   and you were outside of the root of the project, it should just
   fail. Fix this by utilizing `$SERENITY_ROOT`.
2021-04-17 09:27:19 +02:00
Brian Gianforcaro
265e155181 Meta: Use basename for serenity.sh help message
I have this symlinked into ~/bin, when looking at the help/usage
it would previously print the fully qualified path to the script
making the help very difficult to read.
2021-04-15 17:47:09 +02:00
Linus Groh
ad4cc19ca0 Meta: Pass arguments to 'serenity.sh run lagom' executable 2021-03-24 20:38:05 +01:00
Linus Groh
89602c6fc0 Meta: Support 'serenity.sh gdb lagom' 2021-03-12 21:27:09 +01:00
Linus Groh
eb5b2b4b4f Lagom: Add 'test' command to serenity.sh 2021-03-12 21:27:09 +01:00
Linus Groh
04fc4a8134 Meta: Make 'serenity.sh run lagom' run Lagom executables
Running the tests will be moved to a separate test command which can
then leverage the availability of different targets and run either unit
tests on the host or the image in QEMU in self-test mode. :^)
2021-03-12 21:27:09 +01:00
Linus Groh
1c85ce0324 Meta: Don't depend on toolchain for lagom target in serenity.sh
- Only call ensure_toolchain for non-lagom targets
- Use host addr2line, we can't expect the i686 toolchain's addr2line to
  support the host's binary executable format
- Don't export SERENITY_ARCH and TOOLCHAIN_DIR, don't need them anymore
2021-03-12 21:27:09 +01:00
Linus Groh
cab2982feb Meta: Add lagom_unsupported helper function to serenity.sh 2021-03-12 21:27:09 +01:00
Tom
929c90f8c8 Meta: Add gdb command to serenity.sh
This uses tmux for a split screen setup, which makes it easy do debug
the kernel while viewing the QEMU output in the same terminal.
2021-03-11 08:29:23 +01:00
Tom
389dddd4b3 Meta: Add a build helper script
This script automatically manages the toolchain and cmake/ninja folders
making it easier to manage the different target architectures.
2021-03-09 07:28:59 +01:00