Skip to content

Upgrade CppInterOp to support llvm 20 #491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 29 commits into from
May 11, 2025
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
391be18
Upgrade to support llvm 20
mcbarton Jan 29, 2025
9df8277
Update emscripten.yml
mcbarton Feb 2, 2025
9c64f35
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 2, 2025
889f996
Part of upgrade to llvm 20
mcbarton Feb 2, 2025
fce2b83
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 20, 2025
ba99ace
See if CUDA tests still broken llvm 20
mcbarton Feb 20, 2025
8c6e593
Revert "See if CUDA tests still broken llvm 20"
mcbarton Feb 21, 2025
8a4c0af
Merge branch 'main' into Update-to-llvm-20
mcbarton Feb 28, 2025
a38a66e
Merge branch 'main' into Update-to-llvm-20
mcbarton Mar 11, 2025
641da6a
Revert changes to CudaTests to show error message in ci run
mcbarton Mar 12, 2025
a3111e0
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 3, 2025
13c69a5
Add llvm 20 Emscripten jobs
mcbarton Apr 3, 2025
6e1a9ff
Remove Windows 19 job
mcbarton Apr 3, 2025
bb13b49
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 13, 2025
8bccb8d
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 17, 2025
37f4742
Update documentation
mcbarton Apr 18, 2025
780f02b
Update Windows-arm.yml to use llvm 20
mcbarton Apr 18, 2025
a2fecb9
Merge branch 'main' into Update-to-llvm-20
mcbarton Apr 25, 2025
4bf0c13
Add Windows Emscripten 20 cross compile llvm patch
mcbarton Apr 25, 2025
82744ee
Update Emscripten-build-instructions.rst
mcbarton Apr 25, 2025
2f98909
Update Emscripten-build-instructions.md
mcbarton Apr 25, 2025
271c0aa
Remove patch which is now in main llvm 20 Windows
mcbarton Apr 25, 2025
7e4e4e5
Enable Emscripten tests which pass for llvm 20
mcbarton Apr 25, 2025
cb6b552
Add patch needed to wasm-ld
mcbarton Apr 30, 2025
e8b557b
Fix Emscripten build instructions due to new patch
mcbarton Apr 30, 2025
4fc1c76
Merge branch 'main' into Update-to-llvm-20
mcbarton May 10, 2025
8149aa9
Revert "Add patch needed to wasm-ld"
mcbarton May 11, 2025
bcdfae9
Update Emscripten-build-instructions.md
mcbarton May 11, 2025
ef39018
Update Emscripten-build-instructions.rst
mcbarton May 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/MacOS-arm.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-clang-repl-20
os: macos-15
compiler: clang
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
- name: osx15-arm-clang-clang-repl-19
os: macos-15
compiler: clang
@@ -252,6 +259,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-clang-repl-20
os: macos-15
compiler: clang
clang-runtime: '20'
cling: Off
cppyy: Off
- name: osx15-arm-clang-clang-repl-19-cppyy
os: macos-15
compiler: clang
13 changes: 13 additions & 0 deletions .github/workflows/MacOS.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx13-x86-clang-clang-repl-20
os: macos-13
compiler: clang
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host"
- name: osx13-x86-clang-clang-repl-19
os: macos-13
compiler: clang
@@ -236,6 +243,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx13-x86-clang-clang-repl-20
os: macos-13
compiler: clang
clang-runtime: '20'
cling: Off
cppyy: Off
- name: osx13-x86-clang-clang-repl-19-cppyy
os: macos-13
compiler: clang
13 changes: 13 additions & 0 deletions .github/workflows/Ubuntu-arm.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-arm-gcc12-clang-repl-20
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-19
os: ubuntu-24.04-arm
compiler: gcc-12
@@ -240,6 +247,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-arm-gcc12-clang-repl-20
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '20'
cling: Off
cppyy: Off
- name: ubu24-arm-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04-arm
compiler: gcc-12
13 changes: 13 additions & 0 deletions .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -22,6 +22,13 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-x86-gcc12-clang-repl-20
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-x86-gcc12-clang-repl-19
os: ubuntu-24.04
compiler: gcc-12
@@ -240,6 +247,12 @@ jobs:
fail-fast: false
matrix:
include:
- name: ubu24-x86-gcc12-clang-repl-20
os: ubuntu-24.04
compiler: gcc-12
clang-runtime: '20'
cling: Off
cppyy: Off
- name: ubu24-x86-gcc12-clang-repl-19-cppyy
os: ubuntu-24.04
compiler: gcc-12
8 changes: 4 additions & 4 deletions .github/workflows/Windows-arm.yml
Original file line number Diff line number Diff line change
@@ -21,10 +21,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win11-msvc-clang-repl-19
- name: win11-msvc-clang-repl-20
os: windows-11-arm
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
@@ -225,10 +225,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win11-msvc-clang-repl-19
- name: win11-msvc-clang-repl-20
os: windows-11-arm
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
cppyy: Off

8 changes: 4 additions & 4 deletions .github/workflows/Windows.yml
Original file line number Diff line number Diff line change
@@ -21,10 +21,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win2025-msvc-clang-repl-19
- name: win2025-msvc-clang-repl-20
os: windows-2025
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
@@ -225,10 +225,10 @@ jobs:
fail-fast: false
matrix:
include:
- name: win2025-msvc-clang-repl-19
- name: win2025-msvc-clang-repl-20
os: windows-2025
compiler: msvc
clang-runtime: '19'
clang-runtime: '20'
cling: Off
cppyy: Off

4 changes: 2 additions & 2 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@ jobs:
fail-fast: false
matrix:
include:
- name: osx15-arm-clang-repl-19-emscripten_wasm
- name: osx15-arm-clang-repl-20-emscripten_wasm
os: macos-15
clang-runtime: '19'
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
59 changes: 58 additions & 1 deletion .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
@@ -49,6 +49,34 @@ jobs:
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: ubu24-arm-clang-repl-20-emscripten
os: ubuntu-24.04-arm
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: osx15-arm-clang-repl-20-emscripten
os: macos-15
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: ubu24-x86-clang-repl-20-emscripten
os: ubuntu-24.04
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.73"

steps:
- uses: actions/checkout@v4
@@ -220,7 +248,7 @@ jobs:
else
# Apply patches
llvm_vers=$(echo "${{ matrix.clang-runtime }}" | tr '[:lower:]' '[:upper:]')
if [[ "${llvm_vers}" == "19" ]]; then
if [[ "${llvm_vers}" == "19" || "${llvm_vers}" == "20" ]]; then
git apply -v ../patches/llvm/emscripten-clang${{ matrix.clang-runtime }}-*.patch
echo "Apply emscripten-clang${{ matrix.clang-runtime }}-*.patch patches:"
fi
@@ -329,6 +357,11 @@ jobs:
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
}
elseif ( "${{ matrix.clang-runtime }}" -imatch "20" )
{
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
}
cd build
echo "Apply clang${{ matrix.clang-runtime }}-*.patch patches:"
emcmake cmake -DCMAKE_BUILD_TYPE=Release `
@@ -414,6 +447,30 @@ jobs:
cling: Off
micromamba_shell_init: powershell
emsdk_ver: "3.1.73"
- name: ubu24-x86-clang-repl-20-emscripten_wasm
os: ubuntu-24.04
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: osx15-arm-clang-repl-20-emscripten_wasm
os: macos-15
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: ubu24-arm-clang-repl-20-emscripten_wasm
os: ubuntu-24.04-arm
clang-runtime: '20'
cling: Off
micromamba_shell_init: bash
emsdk_ver: "3.1.73"
- name: win2025-x86-clang-repl-20-emscripten
os: windows-2025
clang-runtime: '20'
cling: Off
micromamba_shell_init: powershell
emsdk_ver: "3.1.73"

steps:
- uses: actions/checkout@v4
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -68,14 +68,14 @@ include(GNUInstallDirs)
## Define supported version of clang and llvm

set(CLANG_MIN_SUPPORTED 13.0)
set(CLANG_MAX_SUPPORTED "19.1.x")
set(CLANG_VERSION_UPPER_BOUND 20.0.0)
set(CLANG_MAX_SUPPORTED "20.1.x")
set(CLANG_VERSION_UPPER_BOUND 21.0.0)
set(LLD_MIN_SUPPORTED 13.0)
set(LLD_MAX_SUPPORTED "19.1.x")
set(LLD_VERSION_UPPER_BOUND 20.0.0)
set(LLD_MAX_SUPPORTED "20.1.x")
set(LLD_VERSION_UPPER_BOUND 21.0.0)
set(LLVM_MIN_SUPPORTED 13.0)
set(LLVM_MAX_SUPPORTED "19.1.x")
set(LLVM_VERSION_UPPER_BOUND 20.0.0)
set(LLVM_MAX_SUPPORTED "20.1.x")
set(LLVM_VERSION_UPPER_BOUND 21.0.0)

## Set Cmake packages search order

12 changes: 5 additions & 7 deletions Emscripten-build-instructions.md
Original file line number Diff line number Diff line change
@@ -42,12 +42,11 @@ $env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
```

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


```bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
git clone --depth=1 https://github.com/compiler-research/CppInterOp.git
```

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

```bash
cd ./llvm-project/
git apply -v ../CppInterOp/patches/llvm/emscripten-clang19-*.patch
git apply -v ../CppInterOp/patches/llvm/emscripten-clang20-*.patch
```

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

We are now in a position to build an emscripten build of llvm by executing the following on Linux
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -115,10 +115,10 @@ git clone --depth=1 https://github.com/compiler-research/cppyy-backend.git

#### Setup Clang-REPL

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

```bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project
```

4 changes: 2 additions & 2 deletions docs/DevelopersDocumentation.rst
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@ library
Setup Clang-REPL
******************

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

.. code:: bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project
For Clang 16 & 17, the following patches required for development work. To apply
11 changes: 5 additions & 6 deletions docs/Emscripten-build-instructions.rst
Original file line number Diff line number Diff line change
@@ -53,15 +53,15 @@ and on Windows execute in Powershell
$env:PWD_DIR= $PWD.Path
$env:SYSROOT_PATH="$env:EMSDK/upstream/emscripten/cache/sysroot"
Now clone the 19.x release of the LLVM project repository and CppInterOp
Now clone the 20.x release of the LLVM project repository and CppInterOp
(the building of the emscripten version of llvm can be avoided by
executing micromamba install llvm -c
<https://repo.mamba.pm/emscripten-forge> and setting the LLVM_BUILD_DIR/$env:LLVM_BUILD_DIR
appropriately)

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

@@ -79,9 +79,8 @@ On Windows execute the following
cd .\llvm-project\
cp -r ..\patches\llvm\emscripten-clang${{ matrix.clang-runtime }}*
cp -r ..\patches\llvm\Windows-emscripten-clang${{ matrix.clang-runtime }}*
git apply -v Windows-emscripten-clang19-1-CrossCompile.patch
git apply -v emscripten-clang19-2-shift-temporary-files-to-tmp-dir.patch
git apply -v emscripten-clang19-3-remove-zdefs.patch
git apply -v Windows-emscripten-clang20-1-CrossCompile.patch
git apply -v emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
We are now in a position to build an emscripten build of llvm by executing the following on Linux
and osx
4 changes: 2 additions & 2 deletions docs/InstallationAndUsage.rst
Original file line number Diff line number Diff line change
@@ -34,11 +34,11 @@ library
Setup Clang-REPL
******************

Clone the 19.x release of the LLVM project repository.
Clone the 20.x release of the LLVM project repository.

.. code:: bash
git clone --depth=1 --branch release/19.x https://github.com/llvm/llvm-project.git
git clone --depth=1 --branch release/20.x https://github.com/llvm/llvm-project.git
cd llvm-project
For Clang 16 & 17, the following patches required for development work. To apply
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ infrastructure are described first.
## External Dependencies

- CppInterOp now works with:
- llvm19
- llvm20

## Introspection

19 changes: 18 additions & 1 deletion lib/Interpreter/Paths.cpp
Original file line number Diff line number Diff line change
@@ -174,12 +174,29 @@ void CopyIncludePaths(const clang::HeaderSearchOptions& Opts,
if (!withSystem) continue;
if (withFlags) incpaths.push_back("-isystem");
break;

// Option was removed in llvm 20. Git log message below.
// git log --grep="index-header"
// commit 19b4f17d4c0ae12725050d09f04f85bccc686d8e
// Author: Jan Svoboda <jan_svoboda@apple.com>
// Date: Thu Oct 31 16:04:35 2024 -0700
//
// [clang][lex] Remove `-index-header-map` (#114459)
//
// This PR removes the `-index-header-map` functionality from Clang.
// AFAIK this was only used internally at Apple and is now dead code.
// The main motivation behind this change is to enable the removal of
// `HeaderFileInfo::Framework` member and reducing the size of that
// data structure.
//
// rdar://84036149

#if CLANG_VERSION_MAJOR < 20
case frontend::IndexHeaderMap:
if (!withSystem) continue;
if (withFlags) incpaths.push_back("-index-header-map");
if (withFlags) incpaths.push_back(E.IsFramework? "-F" : "-I");
break;
#endif

case frontend::CSystem:
if (!withSystem) continue;
20 changes: 20 additions & 0 deletions patches/llvm/Windows-emscripten-clang20-1-CrossCompile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 39b4abaa0..474ceddbb 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -74,10 +74,12 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
endif()

add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt
- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
+ COMMAND ${CMAKE_COMMAND} -G Ninja
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
- -DCMAKE_C_COMPILER_LAUNCHER="${CMAKE_C_COMPILER_LAUNCHER}"
- -DCMAKE_CXX_COMPILER_LAUNCHER="${CMAKE_CXX_COMPILER_LAUNCHER}"
+ -DCMAKE_C_COMPILER="clang-cl"
+ -DCMAKE_CXX_COMPILER="clang-cl"
+ -DCMAKE_ASM_MASM_COMPILER=llvm-ml
+ -DCMAKE_ASM_MASM_FLAGS="-m64"
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_CURRENT_SOURCE_DIR}
${CROSS_TOOLCHAIN_FLAGS_${project_name}_${target_name}}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
16 changes: 16 additions & 0 deletions patches/llvm/emscripten-clang20-1-CrossCompile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/llvm/cmake/modules/CrossCompile.cmake b/llvm/cmake/modules/CrossCompile.cmake
index 6af47b51d4c6..c635e7f5be9e 100644
--- a/llvm/cmake/modules/CrossCompile.cmake
+++ b/llvm/cmake/modules/CrossCompile.cmake
@@ -70,8 +70,8 @@ function(llvm_create_cross_target project_name target_name toolchain buildtype)
add_custom_command(OUTPUT ${${project_name}_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
-DCMAKE_MAKE_PROGRAM="${CMAKE_MAKE_PROGRAM}"
- -DCMAKE_C_COMPILER_LAUNCHER="${CMAKE_C_COMPILER_LAUNCHER}"
- -DCMAKE_CXX_COMPILER_LAUNCHER="${CMAKE_CXX_COMPILER_LAUNCHER}"
+ -DCMAKE_C_COMPILER="clang"
+ -DCMAKE_CXX_COMPILER="clang++"
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_CURRENT_SOURCE_DIR}
${CROSS_TOOLCHAIN_FLAGS_${project_name}_${target_name}}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/clang/lib/Interpreter/Wasm.cpp b/clang/lib/Interpreter/Wasm.cpp
index aa10b160ccf8..184867e2b55f 100644
--- a/clang/lib/Interpreter/Wasm.cpp
+++ b/clang/lib/Interpreter/Wasm.cpp
@@ -76,8 +76,8 @@ llvm::Error WasmIncrementalExecutor::addModule(PartialTranslationUnit &PTU) {
llvm::TargetMachine *TargetMachine = Target->createTargetMachine(
PTU.TheModule->getTargetTriple(), "", "", TO, llvm::Reloc::Model::PIC_);
PTU.TheModule->setDataLayout(TargetMachine->createDataLayout());
- std::string ObjectFileName = PTU.TheModule->getName().str() + ".o";
- std::string BinaryFileName = PTU.TheModule->getName().str() + ".wasm";
+ std::string ObjectFileName = "/tmp/" + PTU.TheModule->getName().str() + ".o";
+ std::string BinaryFileName = "/tmp/" + PTU.TheModule->getName().str() + ".wasm";

std::error_code Error;
llvm::raw_fd_ostream ObjectFileOutput(llvm::StringRef(ObjectFileName), Error);
10 changes: 9 additions & 1 deletion unittests/CppInterOp/FunctionReflectionTest.cpp
Original file line number Diff line number Diff line change
@@ -1379,7 +1379,9 @@ TEST(FunctionReflectionTest, IsStaticMethod) {

TEST(FunctionReflectionTest, GetFunctionAddress) {
#ifdef EMSCRIPTEN
#if CLANG_VERSION_MAJOR < 20
GTEST_SKIP() << "Test fails for Emscipten builds";
#endif
#endif
if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
@@ -1428,7 +1430,9 @@ TEST(FunctionReflectionTest, IsVirtualMethod) {

TEST(FunctionReflectionTest, JitCallAdvanced) {
#ifdef EMSCRIPTEN
#if CLANG_VERSION_MAJOR < 20
GTEST_SKIP() << "Test fails for Emscipten builds";
#endif
#endif
if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
@@ -1783,7 +1787,9 @@ TEST(FunctionReflectionTest, GetFunctionArgDefault) {

TEST(FunctionReflectionTest, Construct) {
#ifdef EMSCRIPTEN
#if CLANG_VERSION_MAJOR < 20
GTEST_SKIP() << "Test fails for Emscipten builds";
#endif
#endif
if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
@@ -1844,7 +1850,9 @@ TEST(FunctionReflectionTest, Construct) {
// Test nested constructor calls
TEST(FunctionReflectionTest, ConstructNested) {
#ifdef EMSCRIPTEN
#if CLANG_VERSION_MAJOR < 20
GTEST_SKIP() << "Test fails for Emscipten builds";
#endif
#endif
if (llvm::sys::RunningOnValgrind())
GTEST_SKIP() << "XFAIL due to Valgrind report";
@@ -1984,4 +1992,4 @@ TEST(FunctionReflectionTest, UndoTest) {
EXPECT_EQ(ret, 1);
#endif
#endif
}
}
2 changes: 2 additions & 0 deletions unittests/CppInterOp/VariableReflectionTest.cpp
Original file line number Diff line number Diff line change
@@ -264,7 +264,9 @@ CODE

TEST(VariableReflectionTest, GetVariableOffset) {
#ifdef EMSCRIPTEN
#if CLANG_VERSION_MAJOR < 20
GTEST_SKIP() << "Test fails for Emscipten builds";
#endif
#endif
std::vector<Decl *> Decls;
#define Stringify(s) Stringifyx(s)