summaryrefslogtreecommitdiff
path: root/Meta
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2023-05-21 11:04:47 +0200
committerAndrew Kaster <andrewdkaster@gmail.com>2023-05-24 01:20:02 -0600
commit4202bb597b29e0d0e19afea37a272f0e3c87a88d (patch)
tree6701b4c6cf56ffb67cd9f2336f0ce6dfcd2f2bb0 /Meta
parente5618b17c453775b2a317fa2239d1a246f232b5f (diff)
downloadserenity-4202bb597b29e0d0e19afea37a272f0e3c87a88d.zip
Meta+Documentation: Require Xcode 14.3 or Clang 14 for the host compiler
There have been multiple reports of Xcode 14.0 (based on upstream LLVM 14) segfaulting when compiling `LibCore/Process.cpp`. Let's require Xcode 14.3, which is a known good version based on LLVM 15. Note that Xcode 14.3 requires macOS Ventura, so users of Monterey or older are expected to get Homebrew Clang instead. Homebrew Clang 13 also suffers from the same crash. Although I have not tested on Linux, the backtrace points to the middle-end, so x86_64 is also likely to be affected. LLVM 14 was released 14 months ago, so it's not an unreasonable requirement.
Diffstat (limited to 'Meta')
-rwxr-xr-xMeta/Lagom/BuildFuzzers.sh6
-rw-r--r--Meta/Lagom/ReadMe.md2
-rwxr-xr-xMeta/serenity.sh14
3 files changed, 14 insertions, 8 deletions
diff --git a/Meta/Lagom/BuildFuzzers.sh b/Meta/Lagom/BuildFuzzers.sh
index 0d83bc05ea..da995648c1 100755
--- a/Meta/Lagom/BuildFuzzers.sh
+++ b/Meta/Lagom/BuildFuzzers.sh
@@ -14,7 +14,7 @@ die() {
pick_clang() {
local BEST_VERSION=0
- for CLANG_CANDIDATE in clang clang-13 clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang ; do
+ for CLANG_CANDIDATE in clang clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang ; do
if ! command -v $CLANG_CANDIDATE >/dev/null 2>&1; then
continue
fi
@@ -33,8 +33,8 @@ pick_clang() {
BEST_CLANG_CANDIDATE="$CLANG_CANDIDATE"
fi
done
- if [ "$BEST_VERSION" -lt 13 ]; then
- die "Please make sure that Clang version 13 or higher is installed."
+ if [ "$BEST_VERSION" -lt 14 ]; then
+ die "Please make sure that Clang version 14 or higher is installed."
fi
}
diff --git a/Meta/Lagom/ReadMe.md b/Meta/Lagom/ReadMe.md
index 03da24d01c..f8fdd03af9 100644
--- a/Meta/Lagom/ReadMe.md
+++ b/Meta/Lagom/ReadMe.md
@@ -61,7 +61,7 @@ To build with LLVM's libFuzzer, invoke the ``BuildFuzzers.sh`` script with no ar
./Build/lagom-fuzzers/FuzzSomething # The full list can be found in Fuzzers/CMakeLists.txt
```
-(Note that we require clang >= 13, see the pick_clang() function in the script for the paths that are searched)
+(Note that we require clang >= 14, see the pick_clang() function in the script for the paths that are searched)
To build fuzzers without any kind of default instrumentation, pass the ``--standalone`` flag to ``BuildFuzzers.sh``:
diff --git a/Meta/serenity.sh b/Meta/serenity.sh
index 578206a7a6..deb8bf4986 100755
--- a/Meta/serenity.sh
+++ b/Meta/serenity.sh
@@ -152,10 +152,12 @@ is_supported_compiler() {
MAJOR_VERSION="${VERSION%%.*}"
if $COMPILER --version 2>&1 | grep "Apple clang" >/dev/null; then
# Apple Clang version check
- [ "$MAJOR_VERSION" -ge 14 ] && return 0
+ BUILD_VERSION=$(echo | $COMPILER -dM -E - | grep __apple_build_version__ | cut -d ' ' -f3)
+ # Xcode 14.3, based on upstream LLVM 15
+ [ "$BUILD_VERSION" -ge 14030022 ] && return 0
elif $COMPILER --version 2>&1 | grep "clang" >/dev/null; then
# Clang version check
- [ "$MAJOR_VERSION" -ge 13 ] && return 0
+ [ "$MAJOR_VERSION" -ge 14 ] && return 0
else
# GCC version check
[ "$MAJOR_VERSION" -ge 12 ] && return 0
@@ -189,7 +191,7 @@ pick_host_compiler() {
return
fi
- find_newest_compiler clang clang-13 clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang
+ find_newest_compiler clang clang-14 clang-15 /opt/homebrew/opt/llvm/bin/clang
if is_supported_compiler "$HOST_COMPILER"; then
export CC="${HOST_COMPILER}"
export CXX="${HOST_COMPILER/clang/clang++}"
@@ -203,7 +205,11 @@ pick_host_compiler() {
return
fi
- die "Please make sure that GCC version 12, Clang version 13, or higher is installed."
+ if [ "$(uname -s)" = "Darwin" ]; then
+ die "Please make sure that Xcode 14.3, Homebrew Clang 14, or higher is installed."
+ else
+ die "Please make sure that GCC version 12, Clang version 14, or higher is installed."
+ fi
}
cmd_with_target() {