LLVM versions > 11 break compilation
wysiwyng opened this issue · 4 comments
Commit 6470d4d relaxed LLVM version checks to allow version 11 and up. This breaks at least on my system (Arch Linux) with LLVM version 12.0.1. A reason why the CI didn't catch this fault is that in Windows builds LLVM is not even used, and on Linux / Mac builds LLVM version 11.0.0 is manually installed.
A better fix for the CI failure the aforementioned commit tried to fix would be to force installation of LLVM 11 on windows: choco install llvm --version=11.0.0 --allow-downgrade
Sorry for that! I trusted the CI too much on that one, but like you mentioned, it does not use LLVM:
https://github.com/tum-ei-eda/etiss/runs/3859384773#step:9:34
This is not expected, because we do support LLVMJIT on Windows. I could not track back to when this first stopped working, since older logs are not kept by github.
Another strange behavior is that ETISS switches the JIT engine even if we explicitly specify one. This is bad for testing.
https://github.com/tum-ei-eda/etiss/blob/master/.github/workflows/ci.yml#L137
This is not expected, because we do support LLVMJIT on Windows.
I would expect this line:
etiss/.github/workflows/ci.yml
Line 68 in 2da3eca
Another strange behavior is that ETISS switches the JIT engine even if we explicitly specify one. This is bad for testing.
This is explained rather quickly, ETISS switches to its default engine (that is TCC afaik) when the specified one doesn't work. Which admittedly is not ideal as you say, maybe an error would be more suitable in this case.
I noticed the same today. Just wanted to add that the compile issues are caused by this LLVM change, which changes the function signature of overrideFileContents()
.
/etiss/JITImpl/LLVM/src/LLVMJIT.cpp: In member function ‘virtual void* etiss::LLVMJIT::translate(std::string, std::set<std::__cxx11::basic_string<char> >, std::set<std::__cxx11::basic_string<char> >, std::set<std::__cxx11::basic_string<char> >, std::string&, bool)’:
/etiss/JITImpl/LLVM/src/LLVMJIT.cpp:265:47: error: no matching function for call to ‘clang::SourceManager::overrideFileContents(const clang::FileEntry*, std::unique_ptr<llvm::MemoryBuffer>::pointer, bool)’
265 | CI.getSourceManager().overrideFileContents(
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
266 | CI.getFileManager().getVirtualFile("/etiss_llvm_clang_memory_mapped_file.c", buffer->getBufferSize(), 0),
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267 | buffer.get(), true);
| ~~~~~~~~~~~~~~~~~~~