You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unless a new toolchain update has been merged, users should not need to
rebuild their toolchain. Yet, the first thing they see in the build
documentation is to run `Meta/serenity.sh rebuild-toolchain`, which
might incorrectly lead them to use it whenever they encounter an error.
This is a waste of time and causes frustration.
Move any mentions of this option to `Troubleshooting.md` and add a note
to `BuildInstructions.md` about the toolchain build being a one-time
endeavor.
Copy file name to clipboardexpand all lines: Documentation/BuildInstructions.md
+5-8
Original file line number
Diff line number
Diff line change
@@ -92,14 +92,6 @@ There is also documentation for installing the build prerequisites for some less
92
92
93
93
## Build
94
94
95
-
In order to build SerenityOS you will first need to build the toolchain by running the following command:
96
-
97
-
```console
98
-
Meta/serenity.sh rebuild-toolchain
99
-
```
100
-
101
-
Later on, when you use `git pull` to get the latest changes, there's (usually) no need to rebuild the toolchain.
102
-
103
95
Run the following command to build and run SerenityOS:
104
96
105
97
```console
@@ -109,6 +101,11 @@ Meta/serenity.sh run
109
101
This will compile all of SerenityOS and install the built files into the `Build/x86_64/Root` directory inside your Git
110
102
repository. It will also build a disk image and start SerenityOS using QEMU.
111
103
104
+
The first time this command is executed, it will also download some required database files from the internet and build
105
+
the SerenityOS cross-compiler toolchain. These steps only have to be done once, so the next build will go much faster.
106
+
When we update to a newer compiler, you might be prompted to re-build the toolchain; see the [troubleshooting guide](Troubleshooting.md#the-toolchain-is-outdated)
107
+
for what to do when this happens.
108
+
112
109
If, during build, an error like `fusermount: failed to open /etc/mtab: No such file or directory` appears, you have installed `fuse2fs` but your system does not provide the mtab symlink for various reasons. Simply create this symlink with `ln -sv /proc/self/mounts /etc/mtab`.
113
110
114
111
Note that the `anon` user is able to become `root` without a password by default, as a development convenience.
Copy file name to clipboardexpand all lines: Documentation/Troubleshooting.md
+28-1
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,33 @@ version of CMake, you can download a binary release from the [CMake website](htt
14
14
Ensure your [QEMU](https://www.qemu.org/) version is >= 5 with `qemu-system-i386 -version`. Otherwise,
15
15
install it. You can also build it using the `Toolchain/BuildQemu.sh` script.
16
16
17
+
### The toolchain is outdated
18
+
19
+
We strive to use the latest compilers and build tools to ensure the best developer experience; so every
20
+
few months, the toolchain needs to be updated. When such an update is due, an error like the following
21
+
will be printed during the build:
22
+
23
+
```
24
+
CMake Error at CMakeLists.txt:28 (message):
25
+
GNU version (13.1.0) does not match expected compiler version (13.2.0).
26
+
27
+
Please rebuild the GNU Toolchain
28
+
```
29
+
30
+
Or like this one:
31
+
32
+
```
33
+
Your toolchain has an old version of binutils installed.
34
+
installed version: "GNU ld (GNU Binutils) 2.40"
35
+
expected version: "GNU ld (GNU Binutils) 2.41"
36
+
Please run Meta/serenity.sh rebuild-toolchain x86_64 to update it.
37
+
```
38
+
39
+
Run `Meta/serenity.sh rebuild-toolchain x86_64` to perform the update.
40
+
41
+
CMake might cache the compiler version in some cases and print an error even after the toolchain has been rebuilt.
42
+
If this happens, run `Meta/serenity.sh rebuild x86_64` to start over from a fresh build directory.
43
+
17
44
### GCC is missing or is outdated
18
45
19
46
Ensure your gcc version is >= 12 with `gcc --version`. Otherwise, install it. If your gcc binary is not
@@ -78,5 +105,5 @@ extensions, or you try to use VirtualBox without using a x64 virtualization mode
78
105
79
106
### Boot fails with "KVM doesn't support guest debugging"
80
107
- Update your host kernel to at least version `5.10`. This is the oldest kernel which properly supports the required KVM capability `KVM_CAP_SET_GUEST_DEBUG` (see corresponding [kernel commit](https://github.com/torvalds/linux/commit/b9b2782cd5)).
81
-
- Make sure that your distro has the qemu debug feature actually enabled (the corresponding check is [here](https://gitlab.com/qemu-project/qemu/-/blob/222059a0fccf4af3be776fe35a5ea2d6a68f9a0b/accel/kvm/kvm-all.c#L2540)).
108
+
- Make sure that your distro has the qemu debug feature actually enabled (the corresponding check is [here](https://gitlab.com/qemu-project/qemu/-/blob/222059a0fccf4af3be776fe35a5ea2d6a68f9a0b/accel/kvm/kvm-all.c#L2540)).
82
109
- Or, disable KVM debugging by setting this env var when running serenity: `SERENITY_DISABLE_GDB_SOCKET=1`
0 commit comments