Skip to content

Commit 2595a1f

Browse files
authored
Upgrade CppInterOp to be compatible with llvm 20 (#491)
1 parent 90248d6 commit 2595a1f

21 files changed

+223
-39
lines changed

.github/workflows/MacOS-arm.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25+
- name: osx15-arm-clang-clang-repl-20
26+
os: macos-15
27+
compiler: clang
28+
clang-runtime: '20'
29+
cling: Off
30+
llvm_enable_projects: "clang"
31+
llvm_targets_to_build: "host"
2532
- name: osx15-arm-clang-clang-repl-19
2633
os: macos-15
2734
compiler: clang
@@ -252,6 +259,12 @@ jobs:
252259
fail-fast: false
253260
matrix:
254261
include:
262+
- name: osx15-arm-clang-clang-repl-20
263+
os: macos-15
264+
compiler: clang
265+
clang-runtime: '20'
266+
cling: Off
267+
cppyy: Off
255268
- name: osx15-arm-clang-clang-repl-19-cppyy
256269
os: macos-15
257270
compiler: clang

.github/workflows/MacOS.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25+
- name: osx13-x86-clang-clang-repl-20
26+
os: macos-13
27+
compiler: clang
28+
clang-runtime: '20'
29+
cling: Off
30+
llvm_enable_projects: "clang"
31+
llvm_targets_to_build: "host"
2532
- name: osx13-x86-clang-clang-repl-19
2633
os: macos-13
2734
compiler: clang
@@ -236,6 +243,12 @@ jobs:
236243
fail-fast: false
237244
matrix:
238245
include:
246+
- name: osx13-x86-clang-clang-repl-20
247+
os: macos-13
248+
compiler: clang
249+
clang-runtime: '20'
250+
cling: Off
251+
cppyy: Off
239252
- name: osx13-x86-clang-clang-repl-19-cppyy
240253
os: macos-13
241254
compiler: clang

.github/workflows/Ubuntu-arm.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25+
- name: ubu24-arm-gcc12-clang-repl-20
26+
os: ubuntu-24.04-arm
27+
compiler: gcc-12
28+
clang-runtime: '20'
29+
cling: Off
30+
llvm_enable_projects: "clang"
31+
llvm_targets_to_build: "host;NVPTX"
2532
- name: ubu24-arm-gcc12-clang-repl-19
2633
os: ubuntu-24.04-arm
2734
compiler: gcc-12
@@ -240,6 +247,12 @@ jobs:
240247
fail-fast: false
241248
matrix:
242249
include:
250+
- name: ubu24-arm-gcc12-clang-repl-20
251+
os: ubuntu-24.04-arm
252+
compiler: gcc-12
253+
clang-runtime: '20'
254+
cling: Off
255+
cppyy: Off
243256
- name: ubu24-arm-gcc12-clang-repl-19-cppyy
244257
os: ubuntu-24.04-arm
245258
compiler: gcc-12

.github/workflows/Ubuntu.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
include:
25+
- name: ubu24-x86-gcc12-clang-repl-20
26+
os: ubuntu-24.04
27+
compiler: gcc-12
28+
clang-runtime: '20'
29+
cling: Off
30+
llvm_enable_projects: "clang"
31+
llvm_targets_to_build: "host;NVPTX"
2532
- name: ubu24-x86-gcc12-clang-repl-19
2633
os: ubuntu-24.04
2734
compiler: gcc-12
@@ -240,6 +247,12 @@ jobs:
240247
fail-fast: false
241248
matrix:
242249
include:
250+
- name: ubu24-x86-gcc12-clang-repl-20
251+
os: ubuntu-24.04
252+
compiler: gcc-12
253+
clang-runtime: '20'
254+
cling: Off
255+
cppyy: Off
243256
- name: ubu24-x86-gcc12-clang-repl-19-cppyy
244257
os: ubuntu-24.04
245258
compiler: gcc-12

.github/workflows/Windows-arm.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24-
- name: win11-msvc-clang-repl-19
24+
- name: win11-msvc-clang-repl-20
2525
os: windows-11-arm
2626
compiler: msvc
27-
clang-runtime: '19'
27+
clang-runtime: '20'
2828
cling: Off
2929
llvm_enable_projects: "clang"
3030
llvm_targets_to_build: "host;NVPTX"
@@ -225,10 +225,10 @@ jobs:
225225
fail-fast: false
226226
matrix:
227227
include:
228-
- name: win11-msvc-clang-repl-19
228+
- name: win11-msvc-clang-repl-20
229229
os: windows-11-arm
230230
compiler: msvc
231-
clang-runtime: '19'
231+
clang-runtime: '20'
232232
cling: Off
233233
cppyy: Off
234234

.github/workflows/Windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24-
- name: win2025-msvc-clang-repl-19
24+
- name: win2025-msvc-clang-repl-20
2525
os: windows-2025
2626
compiler: msvc
27-
clang-runtime: '19'
27+
clang-runtime: '20'
2828
cling: Off
2929
llvm_enable_projects: "clang"
3030
llvm_targets_to_build: "host;NVPTX"
@@ -225,10 +225,10 @@ jobs:
225225
fail-fast: false
226226
matrix:
227227
include:
228-
- name: win2025-msvc-clang-repl-19
228+
- name: win2025-msvc-clang-repl-20
229229
os: windows-2025
230230
compiler: msvc
231-
clang-runtime: '19'
231+
clang-runtime: '20'
232232
cling: Off
233233
cppyy: Off
234234

.github/workflows/deploy-pages.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
fail-fast: false
2222
matrix:
2323
include:
24-
- name: osx15-arm-clang-repl-19-emscripten_wasm
24+
- name: osx15-arm-clang-repl-20-emscripten_wasm
2525
os: macos-15
26-
clang-runtime: '19'
26+
clang-runtime: '20'
2727
cling: Off
2828
micromamba_shell_init: bash
2929
emsdk_ver: "3.1.73"

.github/workflows/emscripten.yml

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,34 @@ jobs:
4949
llvm_enable_projects: "clang;lld"
5050
llvm_targets_to_build: "WebAssembly"
5151
emsdk_ver: "3.1.73"
52+
- name: ubu24-arm-clang-repl-20-emscripten
53+
os: ubuntu-24.04-arm
54+
clang-runtime: '20'
55+
cling: Off
56+
llvm_enable_projects: "clang;lld"
57+
llvm_targets_to_build: "WebAssembly"
58+
emsdk_ver: "3.1.73"
59+
- name: osx15-arm-clang-repl-20-emscripten
60+
os: macos-15
61+
clang-runtime: '20'
62+
cling: Off
63+
llvm_enable_projects: "clang;lld"
64+
llvm_targets_to_build: "WebAssembly"
65+
emsdk_ver: "3.1.73"
66+
- name: ubu24-x86-clang-repl-20-emscripten
67+
os: ubuntu-24.04
68+
clang-runtime: '20'
69+
cling: Off
70+
llvm_enable_projects: "clang;lld"
71+
llvm_targets_to_build: "WebAssembly"
72+
emsdk_ver: "3.1.73"
73+
- name: win2025-x86-clang-repl-20-emscripten
74+
os: windows-2025
75+
clang-runtime: '20'
76+
cling: Off
77+
llvm_enable_projects: "clang;lld"
78+
llvm_targets_to_build: "WebAssembly"
79+
emsdk_ver: "3.1.73"
5280

5381
steps:
5482
- uses: actions/checkout@v4
@@ -220,7 +248,7 @@ jobs:
220248
else
221249
# Apply patches
222250
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
223-
if [[ "${llvm_vers}" == "19" ]]; then
251+
if [[ "${llvm_vers}" == "19" || "${llvm_vers}" == "20" ]]; then
224252
git apply -v ../patches/llvm/emscripten-clang${{ matrix.clang-runtime }}-*.patch
225253
echo "Apply emscripten-clang${{ matrix.clang-runtime }}-*.patch patches:"
226254
fi
@@ -329,6 +357,11 @@ jobs:
329357
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
330358
git apply -v emscripten-clang19-3-remove-zdefs.patch
331359
}
360+
elseif ( "${{ matrix.clang-runtime }}" -imatch "20" )
361+
{
362+
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
363+
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
364+
}
332365
cd build
333366
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
334367
emcmake cmake -DCMAKE_BUILD_TYPE=Release `
@@ -414,6 +447,30 @@ jobs:
414447
cling: Off
415448
micromamba_shell_init: powershell
416449
emsdk_ver: "3.1.73"
450+
- name: ubu24-x86-clang-repl-20-emscripten_wasm
451+
os: ubuntu-24.04
452+
clang-runtime: '20'
453+
cling: Off
454+
micromamba_shell_init: bash
455+
emsdk_ver: "3.1.73"
456+
- name: osx15-arm-clang-repl-20-emscripten_wasm
457+
os: macos-15
458+
clang-runtime: '20'
459+
cling: Off
460+
micromamba_shell_init: bash
461+
emsdk_ver: "3.1.73"
462+
- name: ubu24-arm-clang-repl-20-emscripten_wasm
463+
os: ubuntu-24.04-arm
464+
clang-runtime: '20'
465+
cling: Off
466+
micromamba_shell_init: bash
467+
emsdk_ver: "3.1.73"
468+
- name: win2025-x86-clang-repl-20-emscripten
469+
os: windows-2025
470+
clang-runtime: '20'
471+
cling: Off
472+
micromamba_shell_init: powershell
473+
emsdk_ver: "3.1.73"
417474

418475
steps:
419476
- uses: actions/checkout@v4

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ include(GNUInstallDirs)
6868
## Define supported version of clang and llvm
6969

7070
set(CLANG_MIN_SUPPORTED 13.0)
71-
set(CLANG_MAX_SUPPORTED "19.1.x")
72-
set(CLANG_VERSION_UPPER_BOUND 20.0.0)
71+
set(CLANG_MAX_SUPPORTED "20.1.x")
72+
set(CLANG_VERSION_UPPER_BOUND 21.0.0)
7373
set(LLD_MIN_SUPPORTED 13.0)
74-
set(LLD_MAX_SUPPORTED "19.1.x")
75-
set(LLD_VERSION_UPPER_BOUND 20.0.0)
74+
set(LLD_MAX_SUPPORTED "20.1.x")
75+
set(LLD_VERSION_UPPER_BOUND 21.0.0)
7676
set(LLVM_MIN_SUPPORTED 13.0)
77-
set(LLVM_MAX_SUPPORTED "19.1.x")
78-
set(LLVM_VERSION_UPPER_BOUND 20.0.0)
77+
set(LLVM_MAX_SUPPORTED "20.1.x")
78+
set(LLVM_VERSION_UPPER_BOUND 21.0.0)
7979

8080
## Set Cmake packages search order
8181

Emscripten-build-instructions.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,11 @@ $env:PWD_DIR= $PWD.Path
4242
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
4343
```
4444

45-
Now clone the 19.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be
45+
Now clone the 20.x release of the LLVM project repository and CppInterOp (the building of the emscripten version of llvm can be
4646
avoided by executing micromamba install llvm -c <https://repo.mamba.pm/emscripten-forge> and setting the LLVM_BUILD_DIR/$env:LLVM_BUILD_DIR appropriately)
4747

48-
4948
```bash
50-
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
49+
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
5150
git clone --depth=1 https://github.com/compiler-research/CppInterOp.git
5251
```
5352

@@ -56,7 +55,7 @@ executing
5655

5756
```bash
5857
cd ./llvm-project/
59-
git apply -v ../CppInterOp/patches/llvm/emscripten-clang19-*.patch
58+
git apply -v ../CppInterOp/patches/llvm/emscripten-clang20-*.patch
6059
```
6160

6261
On Windows execute the following
@@ -65,9 +64,8 @@ On Windows execute the following
6564
cd .\llvm-project\
6665
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
6766
cp -r ..\patches\llvm\Windows-emscripten-clang${{ matrix.clang-runtime }}*
68-
git apply -v Windows-emscripten-clang19-1-CrossCompile.patch
69-
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
70-
git apply -v emscripten-clang19-3-remove-zdefs.patch
67+
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
68+
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
7169
```
7270

7371
We are now in a position to build an emscripten build of llvm by executing the following on Linux

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ git clone --depth=1 https://github.com/compiler-research/cppyy-backend.git
115115

116116
#### Setup Clang-REPL
117117

118-
Clone the 19.x release of the LLVM project repository.
118+
Clone the 20.x release of the LLVM project repository.
119119

120120
```bash
121-
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
121+
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
122122
cd llvm-project
123123
```
124124

docs/DevelopersDocumentation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ library
3434
Setup Clang-REPL
3535
******************
3636

37-
Clone the 19.x release of the LLVM project repository.
37+
Clone the 20.x release of the LLVM project repository.
3838

3939
.. code:: bash
4040
41-
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
41+
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
4242
cd llvm-project
4343
4444
For Clang 16 & 17, the following patches required for development work. To apply

docs/Emscripten-build-instructions.rst

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,15 @@ and on Windows execute in Powershell
5353
$env:PWD_DIR= $PWD.Path
5454
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
5555
56-
Now clone the 19.x release of the LLVM project repository and CppInterOp
56+
Now clone the 20.x release of the LLVM project repository and CppInterOp
5757
(the building of the emscripten version of llvm can be avoided by
5858
executing micromamba install llvm -c
5959
<https://repo.mamba.pm/emscripten-forge> and setting the LLVM_BUILD_DIR/$env:LLVM_BUILD_DIR
6060
appropriately)
6161

6262
.. code:: bash
6363
64-
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
64+
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
6565
git clone --depth=1 https://github.com/compiler-research/CppInterOp.git
6666
6767
Now move into the cloned llvm-project folder and apply the required patches. On Linux and osx this
@@ -70,7 +70,7 @@ executing
7070
.. code:: bash
7171
7272
cd ./llvm-project/
73-
git apply -v ../CppInterOp/patches/llvm/emscripten-clang19-*.patch
73+
git apply -v ../CppInterOp/patches/llvm/emscripten-clang20-*.patch
7474
7575
On Windows execute the following
7676

@@ -79,9 +79,8 @@ On Windows execute the following
7979
cd .\llvm-project\
8080
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
8181
cp -r ..\patches\llvm\Windows-emscripten-clang${{ matrix.clang-runtime }}*
82-
git apply -v Windows-emscripten-clang19-1-CrossCompile.patch
83-
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
84-
git apply -v emscripten-clang19-3-remove-zdefs.patch
82+
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
83+
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
8584
8685
We are now in a position to build an emscripten build of llvm by executing the following on Linux
8786
and osx

docs/InstallationAndUsage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ library
3434
Setup Clang-REPL
3535
******************
3636

37-
Clone the 19.x release of the LLVM project repository.
37+
Clone the 20.x release of the LLVM project repository.
3838

3939
.. code:: bash
4040
41-
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
41+
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
4242
cd llvm-project
4343
4444
For Clang 16 & 17, the following patches required for development work. To apply

0 commit comments

Comments
 (0)