[build images] Upgrade LLVM from 19 to 21

Update all LLVM version references from 19.1.7 to 21.1.0 across:
- CMake configuration (SetupLLVM.cmake)
- CI/CD (Dockerfile, GitHub Actions workflows, CLAUDE.md)
- Bootstrap scripts (bash and PowerShell)
- Nix configurations (flake.nix, shell.nix)
- Documentation (CONTRIBUTING.md, contributing.mdx, building-windows.mdx)
- Build scripts (build-jsc.ts, run-clang-format.sh)
- Test harness (node-napi-tests/harness.ts)
- Crash handler (llvm-symbolizer fallback)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2026-01-16 19:49:33 +00:00
parent f01467d3dc
commit 8e4745972b
20 changed files with 79 additions and 87 deletions

View File

@@ -387,7 +387,7 @@ function Install-PdbAddr2line {
function Install-Llvm {
Install-Package llvm `
-Command clang-cl `
-Version "19.1.7"
-Version "21.1.0"
Add-To-Path "$env:ProgramFiles\LLVM\bin"
}

View File

@@ -1091,7 +1091,7 @@ install_build_essentials() {
}
llvm_version_exact() {
print "19.1.7"
print "21.1.0"
}
llvm_version() {
@@ -1101,28 +1101,20 @@ llvm_version() {
install_llvm() {
case "$pm" in
apt)
# Debian 13 (Trixie) has LLVM 19 natively, and apt.llvm.org doesn't have a trixie repo
if [ "$distro" = "debian" ]; then
install_packages \
"llvm-$(llvm_version)" \
"clang-$(llvm_version)" \
"lld-$(llvm_version)" \
"llvm-$(llvm_version)-dev" \
"llvm-$(llvm_version)-tools" \
"libclang-rt-$(llvm_version)-dev"
else
bash="$(require bash)"
llvm_script="$(download_file "https://apt.llvm.org/llvm.sh")"
execute_sudo "$bash" "$llvm_script" "$(llvm_version)" all
# Use apt.llvm.org for all apt-based distros (Ubuntu, Debian)
# apt.llvm.org has LLVM 21 for trixie/bookworm/bullseye and all Ubuntu versions
bash="$(require bash)"
llvm_script="$(download_file "https://apt.llvm.org/llvm.sh")"
execute_sudo "$bash" "$llvm_script" "$(llvm_version)" all
# Install llvm-symbolizer explicitly to ensure it's available for ASAN
install_packages "llvm-$(llvm_version)-tools"
fi
# Install llvm-symbolizer explicitly to ensure it's available for ASAN
install_packages "llvm-$(llvm_version)-tools"
;;
brew)
install_packages "llvm@$(llvm_version)"
;;
apk)
# Alpine 3.23+ has LLVM 21 available
install_packages \
"llvm$(llvm_version)" \
"clang$(llvm_version)" \
@@ -1172,7 +1164,7 @@ install_gcc() {
;;
esac
llvm_v="19"
llvm_v="21"
append_to_profile "export CC=clang-${llvm_v}"
append_to_profile "export CXX=clang++-${llvm_v}"

View File

@@ -47,8 +47,8 @@ function findExecutable(names: string[]): string | null {
return null;
}
const CC = findExecutable(["clang-19", "clang"]) || "clang";
const CXX = findExecutable(["clang++-19", "clang++"]) || "clang++";
const CC = findExecutable(["clang-21", "clang"]) || "clang";
const CXX = findExecutable(["clang++-21", "clang++"]) || "clang++";
// Build directory based on config
const getBuildDir = (config: BuildConfig) => {

View File

@@ -20,8 +20,8 @@
* On Linux:
* c++ -std=c++17 -o lldb-inline lldb-inline-tool.cpp \
* -llldb \
* -L/usr/lib/llvm-14/lib \
* -I/usr/lib/llvm-14/include
* -L/usr/lib/llvm-21/lib \
* -I/usr/lib/llvm-21/include
*
* USAGE:
* ------

View File

@@ -21,7 +21,7 @@ if [ ! -f "$TOOL_BINARY" ] || [ "$TOOL_SOURCE" -nt "$TOOL_BINARY" ]; then
else
# Linux - try to find LLVM installation
LLVM_DIR=""
for version in 18 17 16 15 14 13 12; do
for version in 21 20 19 18 17 16 15 14; do
if [ -d "/usr/lib/llvm-$version" ]; then
LLVM_DIR="/usr/lib/llvm-$version"
break

View File

@@ -11,8 +11,8 @@ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
# Default to format mode (modify files)
MODE="${1:-format}"
# Use LLVM_VERSION_MAJOR from environment or default to 19
LLVM_VERSION="${LLVM_VERSION_MAJOR:-19}"
# Use LLVM_VERSION_MAJOR from environment or default to 21
LLVM_VERSION="${LLVM_VERSION_MAJOR:-21}"
# Ensure we have the specific clang-format version
CLANG_FORMAT="clang-format-${LLVM_VERSION}"