build: update to LLVM 23

This commit is contained in:
Alex Rønne Petersen committed 2026-10-07 00:30:51 +02:00
1 parent 3a2f2614e1
commit 37b8e4fc8f
5 files changed
+47 -37

No files matched your search

+3 -3
View File
@@ -133,9 +133,9 @@ else()
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
endif()
find_package(llvm 22)
find_package(clang 22)
find_package(lld 22)
find_package(llvm 23)
find_package(clang 23)
find_package(lld 23)
if(ZIG_STATIC_ZLIB)
if (MSVC)
+8 -4
View File
@@ -1362,20 +1362,23 @@ const clang_libs = [_][]const u8{
"clangStaticAnalyzerCheckers",
"clangStaticAnalyzerCore",
"clangCrossTU",
"clangFrontend",
"clangDriver",
"clangScalableStaticAnalysisAnalyses",
"clangScalableStaticAnalysisCore",
"clangScalableStaticAnalysisFrontend",
"clangScalableStaticAnalysisSourceTransformation",
"clangDependencyScanning",
"clangFrontend",
"clangOptions",
"clangSerialization",
"clangSema",
"clangAnalysisLifetimeSafety",
"clangAnalysis",
"clangASTMatchers",
"clangAST",
"clangParse",
"clangSema",
"clangAPINotes",
"clangBasic",
"clangEdit",
"clangUnifiedSymbolResolution",
"clangLex",
"clangRewriteFrontend",
"clangRewrite",
@@ -1387,6 +1390,7 @@ const clang_libs = [_][]const u8{
"clangSupport",
"clangInstallAPI",
"clangAST",
"clangBasic",
};
const lld_libs = [_][]const u8{
"lldMinGW",
+11 -5
View File
@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
if(${LLVM_LINK_MODE} STREQUAL "shared")
find_library(CLANG_LIBRARIES
NAMES
libclang-cpp.so.22
libclang-cpp.so.22.1
clang-cpp-22.0
clang-cpp220
libclang-cpp.so.23
libclang-cpp.so.23.1
clang-cpp-23.0
clang-cpp230
clang-cpp
NAMES_PER_DIR
HINTS "${LLVM_LIBDIRS}"
@@ -48,8 +48,13 @@ else()
FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCheckers)
FIND_AND_ADD_CLANG_LIB(clangStaticAnalyzerCore)
FIND_AND_ADD_CLANG_LIB(clangCrossTU)
FIND_AND_ADD_CLANG_LIB(clangFrontend)
FIND_AND_ADD_CLANG_LIB(clangDriver)
FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisAnalyses)
FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisCore)
FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisFrontend)
FIND_AND_ADD_CLANG_LIB(clangScalableStaticAnalysisSourceTransformation)
FIND_AND_ADD_CLANG_LIB(clangDependencyScanning)
FIND_AND_ADD_CLANG_LIB(clangFrontend)
FIND_AND_ADD_CLANG_LIB(clangOptions)
FIND_AND_ADD_CLANG_LIB(clangSerialization)
FIND_AND_ADD_CLANG_LIB(clangSema)
@@ -59,6 +64,7 @@ else()
FIND_AND_ADD_CLANG_LIB(clangParse)
FIND_AND_ADD_CLANG_LIB(clangAPINotes)
FIND_AND_ADD_CLANG_LIB(clangEdit)
FIND_AND_ADD_CLANG_LIB(clangUnifiedSymbolResolution)
FIND_AND_ADD_CLANG_LIB(clangLex)
FIND_AND_ADD_CLANG_LIB(clangRewriteFrontend)
FIND_AND_ADD_CLANG_LIB(clangRewrite)
+19 -19
View File
@@ -9,23 +9,23 @@
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
HINTS ${LLVM_INCLUDE_DIRS}
PATHS
/usr/lib/llvm-22/include
/usr/local/llvm220/include
/usr/local/llvm22/include
/usr/local/opt/lld@22/include
/opt/homebrew/opt/lld@22/include
/home/linuxbrew/.linuxbrew/opt/lld@22/include
/usr/lib/llvm-23/include
/usr/local/llvm230/include
/usr/local/llvm23/include
/usr/local/opt/lld@23/include
/opt/homebrew/opt/lld@23/include
/home/linuxbrew/.linuxbrew/opt/lld@23/include
/mingw64/include)
find_library(LLD_LIBRARY NAMES lld-22.0 lld220 lld NAMES_PER_DIR
find_library(LLD_LIBRARY NAMES lld-23.0 lld230 lld NAMES_PER_DIR
HINTS ${LLVM_LIBDIRS}
PATHS
/usr/lib/llvm-22/lib
/usr/local/llvm220/lib
/usr/local/llvm22/lib
/usr/local/opt/lld@22/lib
/opt/homebrew/opt/lld@22/lib
/home/linuxbrew/.linuxbrew/opt/lld@22/lib
/usr/lib/llvm-23/lib
/usr/local/llvm230/lib
/usr/local/llvm23/lib
/usr/local/opt/lld@23/lib
/opt/homebrew/opt/lld@23/lib
/home/linuxbrew/.linuxbrew/opt/lld@23/lib
)
if(EXISTS ${LLD_LIBRARY})
set(LLD_LIBRARIES ${LLD_LIBRARY})
@@ -36,12 +36,12 @@ else()
HINTS ${LLVM_LIBDIRS}
PATHS
${LLD_LIBDIRS}
/usr/lib/llvm-22/lib
/usr/local/llvm220/lib
/usr/local/llvm22/lib
/usr/local/opt/lld@22/lib
/opt/homebrew/opt/lld@22/lib
/home/linuxbrew/.linuxbrew/opt/lld@22/lib
/usr/lib/llvm-23/lib
/usr/local/llvm230/lib
/usr/local/llvm23/lib
/usr/local/opt/lld@23/lib
/opt/homebrew/opt/lld@23/lib
/home/linuxbrew/.linuxbrew/opt/lld@23/lib
/mingw64/lib
/c/msys64/mingw64/lib
c:/msys64/mingw64/lib)
+6 -6
View File
@@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)
# terminate when the right LLVM version is not found.
unset(LLVM_CONFIG_EXE CACHE)
find_program(LLVM_CONFIG_EXE
NAMES llvm-config-22 llvm-config-22.0 llvm-config220 llvm-config22 llvm-config NAMES_PER_DIR
NAMES llvm-config-23 llvm-config-23.0 llvm-config230 llvm-config23 llvm-config NAMES_PER_DIR
PATHS
"/mingw64/bin"
"/c/msys64/mingw64/bin"
"c:/msys64/mingw64/bin"
"C:/Libraries/llvm-22.0.0/bin")
"C:/Libraries/llvm-23.0.0/bin")
if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
@@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)
OUTPUT_STRIP_TRAILING_WHITESPACE)
get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 22 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 23 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 23)
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 23 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 24 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 24)
# Save the error message, in case this is the last llvm-config we find
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 22.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 23.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
# Ignore this directory and try the search again
list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
@@ -66,9 +66,9 @@ if(ZIG_USE_LLVM_CONFIG)
if (LLVM_CONFIG_ERROR)
# Save the error message, in case this is the last llvm-config we find
if (ZIG_SHARED_LLVM)
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 23.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
else()
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 22.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 23.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
endif()
# Ignore this directory and try the search again