Skip to content
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

Compatible issue with clang9 #4

Open
dmknght opened this issue Aug 16, 2021 · 1 comment
Open

Compatible issue with clang9 #4

dmknght opened this issue Aug 16, 2021 · 1 comment

Comments

@dmknght
Copy link

dmknght commented Aug 16, 2021

clamav-bytecode-compiler version: clambc-0.102.0-2
OS: Parrot 4.11.2, Debian testing based. Available Clang: 9.0.1, 10.0.1, 11.0.1
As the doc mentioned, supported Clang version is only 8. But on Debian testing repo, Clang 8 is not available. So it is great to support Clang 9, clang 11 IMO.
Error log when i compiled with Clang 9

[  3%] Building CXX object libclambcc/CMakeFiles/clambcc_obj.dir/ClamBCRTChecks/ClamBCRTChecks.cpp.o
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp: In member function ‘llvm::BasicBlock* {anonymous}::PtrVerifier::getAbortBB(unsigned int, llvm::BasicBlock*)’:
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:192:66: error: cannot convert ‘llvm::FunctionCallee’ to ‘llvm::Constant*’ in initialization
  192 |                 BB->getParent()->getParent()->getOrInsertFunction("abort", abrtTy);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  llvm::FunctionCallee
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:194:66: error: cannot convert ‘llvm::FunctionCallee’ to ‘llvm::Constant*’ in initialization
  194 |                 BB->getParent()->getParent()->getOrInsertFunction("bytecode_rt_error", rterrTy);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                                  |
      |                                                                  llvm::FunctionCallee
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp: In member function ‘virtual bool {anonymous}::PtrVerifier::runOnFunction(llvm::Function&)’:
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:1033:51: error: cannot convert ‘llvm::FunctionCallee’ to ‘llvm::Constant*’ in initialization
 1033 |                 F.getParent()->getOrInsertFunction("abort", abrtTy);
      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                                   |
      |                                                   llvm::FunctionCallee
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp: In member function ‘bool {anonymous}::PtrVerifier::insertCheck(const llvm::SCEV*, const llvm::SCEV*, llvm::Instruction*, bool)’:
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:1631:62: error: cannot convert ‘llvm::FunctionCallee’ to ‘llvm::Constant*’ in initialization
 1631 |             BB->getParent()->getParent()->getOrInsertFunction("abort", abrtTy);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              llvm::FunctionCallee
/tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:1633:62: error: cannot convert ‘llvm::FunctionCallee’ to ‘llvm::Constant*’ in initialization
 1633 |             BB->getParent()->getParent()->getOrInsertFunction("bytecode_rt_error", rterrTy);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              llvm::FunctionCallee
In file included from /usr/lib/llvm-9/include/llvm/ADT/DenseMapInfo.h:16,
                 from /usr/lib/llvm-9/include/llvm/ADT/DenseMap.h:16,
                 from /usr/lib/llvm-9/include/llvm/ADT/DenseSet.h:16,
                 from /tmp/clamav-bytecode-compiler/libclambcc/ClamBCRTChecks/ClamBCRTChecks.cpp:23:
@ragusaa
Copy link
Contributor

ragusaa commented Sep 2, 2021

These errors are due to building the compiler itself with llvm-9 and newer libraries (the api changed). The clamav team will investigate supporting both in the future. In the meantime, you can use our docker image.

We currently have a merge request in to support running with newer versions. I'll update this when it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants