mirror of
https://github.com/SerenityOS/serenity
synced 2026-04-25 17:15:42 +02:00
Meta: Require at least GCC 14
This will be necessary for moving to C++26.
This commit is contained in:
@@ -12,11 +12,11 @@ sudo apt install build-essential cmake curl libmpfr-dev libmpc-dev libgmp-dev e2
|
||||
|
||||
Optional: `fuse2fs` for [building images without root](https://github.com/SerenityOS/serenity/pull/11224).
|
||||
|
||||
#### GCC 13 or Clang 17+
|
||||
#### GCC 14 or Clang 17+
|
||||
|
||||
A host compiler that supports C++23 features is required for building host tools, the newer the better. Tested versions include gcc-13 and Clang 17 through 19.
|
||||
A host compiler that supports C++23 features is required for building host tools, the newer the better. Tested versions include gcc-14 and Clang 17 through 19.
|
||||
|
||||
On Ubuntu gcc-13 is available in the repositories of 24.04 (Noble) and later.
|
||||
On Ubuntu gcc-14 is available in the repositories of 24.04 (Noble) and later.
|
||||
If you are running an older version, you will either need to upgrade, or find an alternative installation source
|
||||
(i.e. from the [ubuntu-toolchain-r/test PPA](https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test)).
|
||||
|
||||
@@ -28,10 +28,10 @@ Next, update your local package information from the new repositories:
|
||||
sudo apt update
|
||||
```
|
||||
|
||||
Now on Ubuntu or Debian you can install gcc-13 with apt like this:
|
||||
Now on Ubuntu or Debian you can install gcc-14 with apt like this:
|
||||
|
||||
```console
|
||||
sudo apt install gcc-13 g++-13
|
||||
sudo apt install gcc-14 g++-14
|
||||
```
|
||||
|
||||
For Clang, the following packages are required (for example Clang 19). Note that the `-dev` packages are only necessary when jakt is enabled.
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
## Build Prerequisites
|
||||
|
||||
Qt6 development packages and a C++23 capable compiler are required. g++-13 or clang-17 are required at a minimum for c++23 support.
|
||||
Qt6 development packages and a C++23 capable compiler are required. g++-14 or clang-17 are required at a minimum for c++23 support.
|
||||
|
||||
On Debian/Ubuntu required packages include, but are not limited to:
|
||||
|
||||
@@ -149,7 +149,7 @@ The install rules in Ladybird/cmake/InstallRules.cmake define which binaries and
|
||||
installed into the configured CMAKE_PREFIX_PATH or path passed to `cmake --install`.
|
||||
|
||||
Note that when using a custom build directory rather than Meta/serenity.sh, the user may need to provide
|
||||
a suitable C++ compiler (g++ >= 13, clang >= 14, Apple Clang >= 14.3) via the CMAKE_CXX_COMPILER and
|
||||
a suitable C++ compiler (g++ >= 14, clang >= 14, Apple Clang >= 14.3) via the CMAKE_CXX_COMPILER and
|
||||
CMAKE_C_COMPILER cmake options.
|
||||
|
||||
```
|
||||
|
||||
@@ -25,13 +25,13 @@ sudo add-apt-repository ppa:canonical-server/server-backports
|
||||
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
|
||||
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-16 main'
|
||||
apt update
|
||||
apt install git build-essential make cmake clang-format-16 gcc-13 g++-13 libstdc++-13-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt
|
||||
apt install git build-essential make cmake clang-format-16 gcc-14 g++-14 libstdc++-13-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt
|
||||
```
|
||||
|
||||
### Force usage of GCC 13
|
||||
|
||||
```shell
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 100 --slave /usr/bin/g++ g++ /usr/bin/g++-13
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 --slave /usr/bin/g++ g++ /usr/bin/g++-14
|
||||
```
|
||||
|
||||
### Create a new user account named 'runner'
|
||||
|
||||
@@ -43,9 +43,9 @@ If this happens, run `Meta/serenity.sh rebuild x86_64` to start over from a fres
|
||||
|
||||
### GCC is missing or is outdated
|
||||
|
||||
Ensure your gcc version is >= 13 with `gcc --version`. Otherwise, install it. If your gcc binary is not
|
||||
Ensure your gcc version is >= 14 with `gcc --version`. Otherwise, install it. If your gcc binary is not
|
||||
called `gcc` you have to specify the names of your C and C++ compiler when you run cmake, e.g.
|
||||
`cmake ../.. -GNinja -DCMAKE_C_COMPILER=gcc-13 -DCMAKE_CXX_COMPILER=g++-13`.
|
||||
`cmake ../.. -GNinja -DCMAKE_C_COMPILER=gcc-14 -DCMAKE_CXX_COMPILER=g++-14`.
|
||||
|
||||
### Legacy renegotiation is disabled
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ is_supported_compiler() {
|
||||
[ "$MAJOR_VERSION" -ge 17 ] && return 0
|
||||
else
|
||||
# GCC version check
|
||||
[ "$MAJOR_VERSION" -ge 13 ] && return 0
|
||||
[ "$MAJOR_VERSION" -ge 14 ] && return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
@@ -63,7 +63,7 @@ pick_host_compiler() {
|
||||
return
|
||||
fi
|
||||
|
||||
find_newest_compiler egcc gcc gcc-13 gcc-14 /usr/local/bin/gcc-{13,14} /opt/homebrew/bin/gcc-{13,14}
|
||||
find_newest_compiler egcc gcc gcc-{14,15} /usr/local/bin/gcc-{14,15} /opt/homebrew/bin/gcc-{14,15}
|
||||
if is_supported_compiler "$HOST_COMPILER"; then
|
||||
export CC="${HOST_COMPILER}"
|
||||
export CXX="${HOST_COMPILER/gcc/g++}"
|
||||
@@ -73,6 +73,6 @@ pick_host_compiler() {
|
||||
if [ "$(uname -s)" = "Darwin" ]; then
|
||||
die "Please make sure that Xcode 14.3, Homebrew Clang 17, or higher is installed."
|
||||
else
|
||||
die "Please make sure that GCC version 13, Clang version 17, or higher is installed."
|
||||
die "Please make sure that GCC version 14, Clang version 17, or higher is installed."
|
||||
fi
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user