Build failure on linux with llvm 3.7.0
Closed this issue · 7 comments
- linux x86_64 4.2.3
- clang/llvm 3.7.0
- gcc 5.2.0
When attempting to set both the C_COMPILER
and CXX_COMPILER
together, cmake identifies the C compiler as clang but the CXX compiler as gcc. So instead I used the CC and CXX environments instead which appears to have worked. Either way both compilers generate similar errors, formatted in their particular manners.
Note: I am not using a build directory, but this doesn't change the result.
% ~/build/lab/llpe-git/src/llpe/llpe CC=clang CXX=clang++ cmake .
-- The C compiler identification is Clang 3.7.0
-- The CXX compiler identification is Clang 3.7.0
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.2d")
-- Found wxWidgets: TRUE
-- Configuring done
-- Generating done
-- Build files have been written to: /home/earnest/build/lab/llpe-git/src/llpe/llpe
% ~/build/lab/llpe-git/src/llpe/llpe make
Scanning dependencies of target LLVMLLPEMain
[ 2%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/ArgSpec.cpp.o
In file included from /home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:16:
/home/earnest/build/lab/llpe-git/src/llpe/llpe/include/llvm/Analysis/LLPE.h:403:7: error: deleted function '~LLPEAnalysisPass' cannot override a non-deleted function
class LLPEAnalysisPass : public ModulePass {
^
/usr/include/llvm/Pass.h:253:3: note: overridden virtual function is here
~ModulePass() override;
^
In file included from /home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:16:
/home/earnest/build/lab/llpe-git/src/llpe/llpe/include/llvm/Analysis/LLPE.h:535:13: error: constructor for 'llvm::LLPEAnalysisPass' must explicitly initialize the member
'fakeDebugType' which does not have a default constructor
explicit LLPEAnalysisPass() : ModulePass(ID), cacheDisabled(false) {
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/include/llvm/Analysis/LLPE.h:533:20: note: member is declared here
DICompositeType fakeDebugType;
^
/usr/include/llvm/IR/DebugInfoMetadata.h:838:7: note: 'llvm::DICompositeType' declared here
class DICompositeType : public DICompositeTypeBase {
^
In file included from /home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:16:
/home/earnest/build/lab/llpe-git/src/llpe/llpe/include/llvm/Analysis/LLPE.h:533:20: error: field of type 'llvm::DICompositeType' has private destructor
DICompositeType fakeDebugType;
^
/usr/include/llvm/IR/DebugInfoMetadata.h:849:3: note: implicitly declared private here
~DICompositeType() = default;
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:72:31: error: no matching function for call to 'getGetElementPtr'
lineStartConsts.push_back(ConstantExpr::getGetElementPtr(EnvInitG, gepArgs, 2));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/IR/Constants.h:1092:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/usr/include/llvm/IR/Constants.h:1100:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C, Constant *Idx,
^
/usr/include/llvm/IR/Constants.h:1108:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:84:26: error: no matching function for call to 'getGetElementPtr'
Constant* EnvPtrsPtr = ConstantExpr::getGetElementPtr(EnvPtrsG, gepArgs, 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/IR/Constants.h:1092:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/usr/include/llvm/IR/Constants.h:1100:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C, Constant *Idx,
^
/usr/include/llvm/IR/Constants.h:1108:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:156:29: error: no matching function for call to 'getGetElementPtr'
Constant* stringPtr = ConstantExpr::getGetElementPtr(ArgvConsts, gepArgs, 2);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/IR/Constants.h:1092:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/usr/include/llvm/IR/Constants.h:1100:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C, Constant *Idx,
^
/usr/include/llvm/IR/Constants.h:1108:20: note: candidate function not viable: no known conversion from 'llvm::GlobalVariable *' to 'llvm::Type *' for 1st argument
static Constant *getGetElementPtr(Type *Ty, Constant *C,
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:160:30: error: no matching function for call to 'Create'
Instruction* argvPtr = GetElementPtrInst::Create(Arg, gepArg, "argv_ptr", InsertBefore);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/IR/Instructions.h:854:29: note: candidate function not viable: no known conversion from 'Function::arg_iterator' (aka 'ilist_iterator<llvm::Argument>')
to 'llvm::Type *' for 1st argument
static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
^
/usr/include/llvm/IR/Instructions.h:869:29: note: candidate function not viable: requires 5 arguments, but 4 were provided
static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
^
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/ArgSpec.cpp:169:29: error: no matching function for call to 'Create'
Instruction* argvEndPtr = GetElementPtrInst::Create(Arg, gepArg, "argv_end_ptr", InsertBefore);
^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/llvm/IR/Instructions.h:854:29: note: candidate function not viable: no known conversion from 'Function::arg_iterator' (aka 'ilist_iterator<llvm::Argument>')
to 'llvm::Type *' for 1st argument
static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
^
/usr/include/llvm/IR/Instructions.h:869:29: note: candidate function not viable: requires 5 arguments, but 4 were provided
static GetElementPtrInst *Create(Type *PointeeType, Value *Ptr,
^
8 errors generated.
main/CMakeFiles/LLVMLLPEMain.dir/build.make:62: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/ArgSpec.cpp.o' failed
make[2]: *** [main/CMakeFiles/LLVMLLPEMain.dir/ArgSpec.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/all' failed
make[1]: *** [main/CMakeFiles/LLVMLLPEMain.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
If there is any other information I can provide which will help please ask,
thanks
Hi! The reason is that LLPE currently builds against LLVM 3.6. However I have created a 3.7 branch that compiles against 3.7 (but is untested). Could you try
git pull
git checkout 3.7
And then rebuild?
It gets a bit futher before coming upon a new error:
teapot earnest i ~/build/lab/llpe-git/src/llpe/llpe % make
Scanning dependencies of target LLVMLLPEMain
[ 2%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/ArgSpec.cpp.o
[ 5%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/FunctionSharing.cpp.o
[ 8%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/MainLoop.cpp.o
[ 11%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/Shadows.cpp.o
[ 14%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/CFGEval.cpp.o
[ 17%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/Eval.cpp.o
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/Eval.cpp:2274:43: error: variable length array of non-POD element type 'std::pair<ValSetType, ImprovedVal>'
std::pair<ValSetType, ImprovedVal> Ops[SI->getNumOperands()];
^
1 error generated.
main/CMakeFiles/LLVMLLPEMain.dir/build.make:182: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/Eval.cpp.o' failed
make[2]: *** [main/CMakeFiles/LLVMLLPEMain.dir/Eval.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/all' failed
make[1]: *** [main/CMakeFiles/LLVMLLPEMain.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
This is a Clang vs. G++ thing (the former doesn't support non-POD VLAs). Either use G++ or I'll finally remove the VLA stuff tonight :)
Ah, I thought given its llvm nature that clang was assumed. It does get further again with gcc (g++) but a new error is produced:
% cmake .
% make
[ 60%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/DOT.cpp.o
[ 62%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/IntegratorShared.cpp.o
[ 65%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/Save.cpp.o
[ 68%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/DSE.cpp.o
[ 71%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/LoadForward.cpp.o
[ 74%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/SaveSplit.cpp.o
[ 77%] Building CXX object main/CMakeFiles/LLVMLLPEMain.dir/Misc.cpp.o
/home/earnest/build/lab/llpe-git/src/llpe/llpe/main/Misc.cpp:30:43: fatal error: llvm/Target/TargetLibraryInfo.h: No such file or directory
compilation terminated.
main/CMakeFiles/LLVMLLPEMain.dir/build.make:686: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/Misc.cpp.o' failed
make[2]: *** [main/CMakeFiles/LLVMLLPEMain.dir/Misc.cpp.o] Error 1
CMakeFiles/Makefile2:85: recipe for target 'main/CMakeFiles/LLVMLLPEMain.dir/all' failed
make[1]: *** [main/CMakeFiles/LLVMLLPEMain.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
As for removing VLAs, that always sounds like a good idea :-P
Both of these are done -- the one remaining VLA is now a vector, and the TLI include path is fixed (it was finding an old LLVM source tree by mistake).
Unfortunately building with Clang is currently still blocked because WxWidgets uses typeid and LLVM builds with -fno-rtti per default. Odd that GCC is ok with that, but it seems it is! So for now try building with GCC and I'll look into the RTTI issue some more.
That did the trick, it builds to completion now but with many warnings essentially repeating the same thing:
/home/earnest/build/lab/llpe-git/src/llpe/llpe/driver/Integrator.cpp:636:1: warning: ‘virtual void wxWindowBase::MakeModal(bool)’ is deprecated [-Wdeprecated-declarations]
}
^
In file included from /usr/include/wx-3.0/wx/wx.h:14:0,
from /home/earnest/build/lab/llpe-git/src/llpe/llpe/driver/Integrator.cpp:15:
/usr/include/wx-3.0/wx/window.h:688:5: note: declared here
wxDEPRECATED( virtual void MakeModal(bool modal = true) );
^
Full log: https://ptpb.pw/-pAn
Other than that, this particular issue can probably be closed now.
Standard WX I'm afraid :) Thanks for the report!