Skip to content

Commit 0712115

Browse files
committed
build: Update to LLVM/Clang 20.
1 parent b47fd55 commit 0712115

File tree

5 files changed

+47
-35
lines changed

5 files changed

+47
-35
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ else()
132132
set(ZIG_SYSTEM_LIBCXX "stdc++" CACHE STRING "system libcxx name for build.zig")
133133
endif()
134134

135-
find_package(llvm 19)
136-
find_package(clang 19)
137-
find_package(lld 19)
135+
find_package(llvm 20)
136+
find_package(clang 20)
137+
find_package(lld 20)
138138

139139
if(ZIG_STATIC_ZLIB)
140140
if (MSVC)

build.zig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,10 +1166,10 @@ const llvm_libs = [_][]const u8{
11661166
"LLVMXRay",
11671167
"LLVMLibDriver",
11681168
"LLVMDlltoolDriver",
1169+
"LLVMTelemetry",
11691170
"LLVMTextAPIBinaryReader",
11701171
"LLVMCoverage",
11711172
"LLVMLineEditor",
1172-
"LLVMSandboxIR",
11731173
"LLVMXCoreDisassembler",
11741174
"LLVMXCoreCodeGen",
11751175
"LLVMXCoreDesc",
@@ -1196,6 +1196,10 @@ const llvm_libs = [_][]const u8{
11961196
"LLVMSystemZCodeGen",
11971197
"LLVMSystemZDesc",
11981198
"LLVMSystemZInfo",
1199+
"LLVMSPIRVCodeGen",
1200+
"LLVMSPIRVDesc",
1201+
"LLVMSPIRVInfo",
1202+
"LLVMSPIRVAnalysis",
11991203
"LLVMSparcDisassembler",
12001204
"LLVMSparcAsmParser",
12011205
"LLVMSparcCodeGen",
@@ -1294,18 +1298,19 @@ const llvm_libs = [_][]const u8{
12941298
"LLVMCoroutines",
12951299
"LLVMipo",
12961300
"LLVMVectorize",
1301+
"LLVMSandboxIR",
12971302
"LLVMLinker",
12981303
"LLVMInstrumentation",
12991304
"LLVMFrontendOpenMP",
13001305
"LLVMFrontendOffloading",
13011306
"LLVMFrontendOpenACC",
13021307
"LLVMFrontendHLSL",
13031308
"LLVMFrontendDriver",
1309+
"LLVMFrontendAtomic",
13041310
"LLVMExtensions",
13051311
"LLVMDWARFLinkerParallel",
13061312
"LLVMDWARFLinkerClassic",
13071313
"LLVMDWARFLinker",
1308-
"LLVMCodeGenData",
13091314
"LLVMGlobalISel",
13101315
"LLVMMIRParser",
13111316
"LLVMAsmPrinter",
@@ -1314,6 +1319,7 @@ const llvm_libs = [_][]const u8{
13141319
"LLVMTarget",
13151320
"LLVMObjCARCOpts",
13161321
"LLVMCodeGenTypes",
1322+
"LLVMCGData",
13171323
"LLVMIRPrinter",
13181324
"LLVMInterfaceStub",
13191325
"LLVMFileCheck",
@@ -1329,14 +1335,14 @@ const llvm_libs = [_][]const u8{
13291335
"LLVMDebugInfoBTF",
13301336
"LLVMDebugInfoPDB",
13311337
"LLVMDebugInfoMSF",
1338+
"LLVMDebugInfoCodeView",
13321339
"LLVMDebugInfoDWARF",
13331340
"LLVMObject",
13341341
"LLVMTextAPI",
13351342
"LLVMMCParser",
13361343
"LLVMIRReader",
13371344
"LLVMAsmParser",
13381345
"LLVMMC",
1339-
"LLVMDebugInfoCodeView",
13401346
"LLVMBitReader",
13411347
"LLVMFuzzerCLI",
13421348
"LLVMCore",

cmake/Findclang.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ find_path(CLANG_INCLUDE_DIRS NAMES clang/Frontend/ASTUnit.h
1717
if(${LLVM_LINK_MODE} STREQUAL "shared")
1818
find_library(CLANG_LIBRARIES
1919
NAMES
20-
libclang-cpp.so.19
21-
libclang-cpp.so.19.1
22-
clang-cpp-19.0
23-
clang-cpp190
20+
libclang-cpp.so.20
21+
libclang-cpp.so.20.1
22+
clang-cpp-20.0
23+
clang-cpp200
2424
clang-cpp
2525
NAMES_PER_DIR
2626
HINTS "${LLVM_LIBDIRS}"

cmake/Findlld.cmake

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99
find_path(LLD_INCLUDE_DIRS NAMES lld/Common/Driver.h
1010
HINTS ${LLVM_INCLUDE_DIRS}
1111
PATHS
12-
/usr/lib/llvm-19/include
13-
/usr/local/llvm190/include
14-
/usr/local/llvm19/include
15-
/usr/local/opt/llvm@19/include
16-
/opt/homebrew/opt/llvm@19/include
12+
/usr/lib/llvm-20/include
13+
/usr/local/llvm200/include
14+
/usr/local/llvm20/include
15+
/usr/local/opt/llvm@20/include
16+
/opt/homebrew/opt/llvm@20/include
1717
/mingw64/include)
1818

19-
find_library(LLD_LIBRARY NAMES lld-19.0 lld190 lld NAMES_PER_DIR
19+
find_library(LLD_LIBRARY NAMES lld-20.0 lld200 lld NAMES_PER_DIR
2020
HINTS ${LLVM_LIBDIRS}
2121
PATHS
22-
/usr/lib/llvm-19/lib
23-
/usr/local/llvm190/lib
24-
/usr/local/llvm19/lib
25-
/usr/local/opt/llvm@19/lib
26-
/opt/homebrew/opt/llvm@19/lib
22+
/usr/lib/llvm-20/lib
23+
/usr/local/llvm200/lib
24+
/usr/local/llvm20/lib
25+
/usr/local/opt/llvm@20/lib
26+
/opt/homebrew/opt/llvm@20/lib
2727
)
2828
if(EXISTS ${LLD_LIBRARY})
2929
set(LLD_LIBRARIES ${LLD_LIBRARY})
@@ -34,11 +34,11 @@ else()
3434
HINTS ${LLVM_LIBDIRS}
3535
PATHS
3636
${LLD_LIBDIRS}
37-
/usr/lib/llvm-19/lib
38-
/usr/local/llvm190/lib
39-
/usr/local/llvm19/lib
40-
/usr/local/opt/llvm@19/lib
41-
/opt/homebrew/opt/llvm@19/lib
37+
/usr/lib/llvm-20/lib
38+
/usr/local/llvm200/lib
39+
/usr/local/llvm20/lib
40+
/usr/local/opt/llvm@20/lib
41+
/opt/homebrew/opt/llvm@20/lib
4242
/mingw64/lib
4343
/c/msys64/mingw64/lib
4444
c:/msys64/mingw64/lib)

cmake/Findllvm.cmake

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ if(ZIG_USE_LLVM_CONFIG)
1717
# terminate when the right LLVM version is not found.
1818
unset(LLVM_CONFIG_EXE CACHE)
1919
find_program(LLVM_CONFIG_EXE
20-
NAMES llvm-config-19 llvm-config-19.0 llvm-config190 llvm-config19 llvm-config NAMES_PER_DIR
20+
NAMES llvm-config-20 llvm-config-20.0 llvm-config200 llvm-config20 llvm-config NAMES_PER_DIR
2121
PATHS
2222
"/mingw64/bin"
2323
"/c/msys64/mingw64/bin"
2424
"c:/msys64/mingw64/bin"
25-
"C:/Libraries/llvm-19.0.0/bin")
25+
"C:/Libraries/llvm-20.0.0/bin")
2626

2727
if ("${LLVM_CONFIG_EXE}" STREQUAL "LLVM_CONFIG_EXE-NOTFOUND")
2828
if (NOT LLVM_CONFIG_ERROR_MESSAGES STREQUAL "")
@@ -40,9 +40,9 @@ if(ZIG_USE_LLVM_CONFIG)
4040
OUTPUT_STRIP_TRAILING_WHITESPACE)
4141

4242
get_filename_component(LLVM_CONFIG_DIR "${LLVM_CONFIG_EXE}" DIRECTORY)
43-
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 19 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 20 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 20)
43+
if("${LLVM_CONFIG_VERSION}" VERSION_LESS 20 OR "${LLVM_CONFIG_VERSION}" VERSION_EQUAL 21 OR "${LLVM_CONFIG_VERSION}" VERSION_GREATER 21)
4444
# Save the error message, in case this is the last llvm-config we find
45-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 19.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
45+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "expected LLVM 20.x but found ${LLVM_CONFIG_VERSION} using ${LLVM_CONFIG_EXE}")
4646

4747
# Ignore this directory and try the search again
4848
list(APPEND CMAKE_IGNORE_PATH "${LLVM_CONFIG_DIR}")
@@ -66,9 +66,9 @@ if(ZIG_USE_LLVM_CONFIG)
6666
if (LLVM_CONFIG_ERROR)
6767
# Save the error message, in case this is the last llvm-config we find
6868
if (ZIG_SHARED_LLVM)
69-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
69+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 20.x found at ${LLVM_CONFIG_EXE} does not support linking as a shared library")
7070
else()
71-
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 19.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
71+
list(APPEND LLVM_CONFIG_ERROR_MESSAGES "LLVM 20.x found at ${LLVM_CONFIG_EXE} does not support linking as a static library")
7272
endif()
7373

7474
# Ignore this directory and try the search again
@@ -197,10 +197,10 @@ else()
197197
FIND_AND_ADD_LLVM_LIB(LLVMXRay)
198198
FIND_AND_ADD_LLVM_LIB(LLVMLibDriver)
199199
FIND_AND_ADD_LLVM_LIB(LLVMDlltoolDriver)
200+
FIND_AND_ADD_LLVM_LIB(LLVMTelemetry)
200201
FIND_AND_ADD_LLVM_LIB(LLVMTextAPIBinaryReader)
201202
FIND_AND_ADD_LLVM_LIB(LLVMCoverage)
202203
FIND_AND_ADD_LLVM_LIB(LLVMLineEditor)
203-
FIND_AND_ADD_LLVM_LIB(LLVMSandboxIR)
204204
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDisassembler)
205205
FIND_AND_ADD_LLVM_LIB(LLVMXCoreCodeGen)
206206
FIND_AND_ADD_LLVM_LIB(LLVMXCoreDesc)
@@ -227,6 +227,10 @@ else()
227227
FIND_AND_ADD_LLVM_LIB(LLVMSystemZCodeGen)
228228
FIND_AND_ADD_LLVM_LIB(LLVMSystemZDesc)
229229
FIND_AND_ADD_LLVM_LIB(LLVMSystemZInfo)
230+
FIND_AND_ADD_LLVM_LIB(LLVMSPIRVCodeGen)
231+
FIND_AND_ADD_LLVM_LIB(LLVMSPIRVDesc)
232+
FIND_AND_ADD_LLVM_LIB(LLVMSPIRVInfo)
233+
FIND_AND_ADD_LLVM_LIB(LLVMSPIRVAnalysis)
230234
FIND_AND_ADD_LLVM_LIB(LLVMSparcDisassembler)
231235
FIND_AND_ADD_LLVM_LIB(LLVMSparcAsmParser)
232236
FIND_AND_ADD_LLVM_LIB(LLVMSparcCodeGen)
@@ -325,18 +329,19 @@ else()
325329
FIND_AND_ADD_LLVM_LIB(LLVMCoroutines)
326330
FIND_AND_ADD_LLVM_LIB(LLVMipo)
327331
FIND_AND_ADD_LLVM_LIB(LLVMVectorize)
332+
FIND_AND_ADD_LLVM_LIB(LLVMSandboxIR)
328333
FIND_AND_ADD_LLVM_LIB(LLVMLinker)
329334
FIND_AND_ADD_LLVM_LIB(LLVMInstrumentation)
330335
FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenMP)
331336
FIND_AND_ADD_LLVM_LIB(LLVMFrontendOffloading)
332337
FIND_AND_ADD_LLVM_LIB(LLVMFrontendOpenACC)
333338
FIND_AND_ADD_LLVM_LIB(LLVMFrontendHLSL)
334339
FIND_AND_ADD_LLVM_LIB(LLVMFrontendDriver)
340+
FIND_AND_ADD_LLVM_LIB(LLVMFrontendAtomic)
335341
FIND_AND_ADD_LLVM_LIB(LLVMExtensions)
336342
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerParallel)
337343
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinkerClassic)
338344
FIND_AND_ADD_LLVM_LIB(LLVMDWARFLinker)
339-
FIND_AND_ADD_LLVM_LIB(LLVMCodeGenData)
340345
FIND_AND_ADD_LLVM_LIB(LLVMGlobalISel)
341346
FIND_AND_ADD_LLVM_LIB(LLVMMIRParser)
342347
FIND_AND_ADD_LLVM_LIB(LLVMAsmPrinter)
@@ -345,6 +350,7 @@ else()
345350
FIND_AND_ADD_LLVM_LIB(LLVMTarget)
346351
FIND_AND_ADD_LLVM_LIB(LLVMObjCARCOpts)
347352
FIND_AND_ADD_LLVM_LIB(LLVMCodeGenTypes)
353+
FIND_AND_ADD_LLVM_LIB(LLVMCGData)
348354
FIND_AND_ADD_LLVM_LIB(LLVMIRPrinter)
349355
FIND_AND_ADD_LLVM_LIB(LLVMInterfaceStub)
350356
FIND_AND_ADD_LLVM_LIB(LLVMFileCheck)
@@ -360,14 +366,14 @@ else()
360366
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoBTF)
361367
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoPDB)
362368
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoMSF)
369+
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
363370
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoDWARF)
364371
FIND_AND_ADD_LLVM_LIB(LLVMObject)
365372
FIND_AND_ADD_LLVM_LIB(LLVMTextAPI)
366373
FIND_AND_ADD_LLVM_LIB(LLVMMCParser)
367374
FIND_AND_ADD_LLVM_LIB(LLVMIRReader)
368375
FIND_AND_ADD_LLVM_LIB(LLVMAsmParser)
369376
FIND_AND_ADD_LLVM_LIB(LLVMMC)
370-
FIND_AND_ADD_LLVM_LIB(LLVMDebugInfoCodeView)
371377
FIND_AND_ADD_LLVM_LIB(LLVMBitReader)
372378
FIND_AND_ADD_LLVM_LIB(LLVMFuzzerCLI)
373379
FIND_AND_ADD_LLVM_LIB(LLVMCore)

0 commit comments

Comments
 (0)