-
Notifications
You must be signed in to change notification settings - Fork 31
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
+223
−39
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 9df8277
Update emscripten.yml
mcbarton 9c64f35
Merge branch 'main' into Update-to-llvm-20
mcbarton 889f996
Part of upgrade to llvm 20
mcbarton fce2b83
Merge branch 'main' into Update-to-llvm-20
mcbarton ba99ace
See if CUDA tests still broken llvm 20
mcbarton 8c6e593
Revert "See if CUDA tests still broken llvm 20"
mcbarton 8a4c0af
Merge branch 'main' into Update-to-llvm-20
mcbarton a38a66e
Merge branch 'main' into Update-to-llvm-20
mcbarton 641da6a
Revert changes to CudaTests to show error message in ci run
mcbarton a3111e0
Merge branch 'main' into Update-to-llvm-20
mcbarton 13c69a5
Add llvm 20 Emscripten jobs
mcbarton 6e1a9ff
Remove Windows 19 job
mcbarton bb13b49
Merge branch 'main' into Update-to-llvm-20
mcbarton 8bccb8d
Merge branch 'main' into Update-to-llvm-20
mcbarton 37f4742
Update documentation
mcbarton 780f02b
Update Windows-arm.yml to use llvm 20
mcbarton a2fecb9
Merge branch 'main' into Update-to-llvm-20
mcbarton 4bf0c13
Add Windows Emscripten 20 cross compile llvm patch
mcbarton 82744ee
Update Emscripten-build-instructions.rst
mcbarton 2f98909
Update Emscripten-build-instructions.md
mcbarton 271c0aa
Remove patch which is now in main llvm 20 Windows
mcbarton 7e4e4e5
Enable Emscripten tests which pass for llvm 20
mcbarton cb6b552
Add patch needed to wasm-ld
mcbarton e8b557b
Fix Emscripten build instructions due to new patch
mcbarton 4fc1c76
Merge branch 'main' into Update-to-llvm-20
mcbarton 8149aa9
Revert "Add patch needed to wasm-ld"
mcbarton bcdfae9
Update Emscripten-build-instructions.md
mcbarton ef39018
Update Emscripten-build-instructions.rst
mcbarton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
patches/llvm/Windows-emscripten-clang20-1-CrossCompile.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
15 changes: 15 additions & 0 deletions
15
patches/llvm/emscripten-clang20-2-shift-temporary-files-to-tmp-dir.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
anutosh491 marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.