Closed smunix closed 3 years ago
Thanks for working on this. I have checked out the latest commit from master but it still fails to build for me:-
[1/184] Building CXX object CMakeFiles/hobbes-test.dir/test/Existentials.C.o
FAILED: CMakeFiles/hobbes-test.dir/test/Existentials.C.o
/home/chaz/.local/local/clang+llvm/bin/clang++ -I/home/chaz/.local/local/clang+llvm/include -I../include -Werror=old-style-cast -Werror -Wall -Wextra -Winit-self -Wreturn-type -Wunused-variable -Wsign-compare
-Warray-bounds -Wunknown-pragmas -Wuninitialized -Wstrict-aliasing -Wunused-value -Wunused-label -Wswitch -Wcast-align -Wctor-dtor-privacy -Wmissing-noreturn -Wunused-parameter -Wreorder -O2 -D_GNU_SOURCE -D_
_STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DPYTHON_EXECUTABLE="/home/chaz/.local/bin/python" -DSCRIPT_DIR="/home/chaz/git/github.com_Morgan-Stanley_hobbes/scripts/" -std=gnu++14 -MD -MT
CMakeFiles/hobbes-test.dir/test/Existentials.C.o -MF CMakeFiles/hobbes-test.dir/test/Existentials.C.o.d -o CMakeFiles/hobbes-test.dir/test/Existentials.C.o -c ../test/Existentials.C
In file included from ../test/Existentials.C:2:
In file included from ../include/hobbes/hobbes.H:6:
In file included from ../include/hobbes/eval/cc.H:13:
In file included from ../include/hobbes/eval/jitcc.H:9:
In file included from ../include/hobbes/util/llvm.H:18:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/DerivedTypes.h:23:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/Type.h:17:
/home/chaz/.local/local/clang+llvm/include/llvm/ADT/APFloat.h:842:31: error: function 'APFloat' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
APFloat() : U(IEEEdouble()) {
^
In file included from ../test/Existentials.C:2:
In file included from ../include/hobbes/hobbes.H:6:
In file included from ../include/hobbes/eval/cc.H:13:
In file included from ../include/hobbes/eval/jitcc.H:9:
In file included from ../include/hobbes/util/llvm.H:19:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/IRBuilder.h:22:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/BasicBlock.h:22:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/Instruction.h:22:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/DebugLoc.h:17:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/TrackingMDRef.h:16:
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Metadata.h:95:49: error: function 'handleChangedOperand' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void handleChangedOperand(void *, Metadata *) {
^
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Metadata.h:888:42: error: function 'operator delete' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void operator delete(void *, unsigned) {
^
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Metadata.h:893:48: error: function 'operator delete' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void operator delete(void *, unsigned, bool) {
^
In file included from ../test/Existentials.C:2:
In file included from ../include/hobbes/hobbes.H:6:
In file included from ../include/hobbes/eval/cc.H:13:
In file included from ../include/hobbes/eval/jitcc.H:9:
In file included from ../include/hobbes/util/llvm.H:19:
In file included from /home/chaz/.local/local/clang+llvm/include/llvm/IR/IRBuilder.h:33:
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Instructions.h:2941:50: error: function 'setSuccessor' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void setSuccessor(unsigned idx, BasicBlock *B) {
^
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Instructions.h:4132:56: error: function 'setSuccessor' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void setSuccessor(unsigned idx, BasicBlock *NewSucc) {
^
/home/chaz/.local/local/clang+llvm/include/llvm/IR/Instructions.h:4635:50: error: function 'setSuccessor' could be declared with attribute 'noreturn' [-Werror,-Wmissing-noreturn]
void setSuccessor(unsigned idx, BasicBlock *B) {
^
7 errors generated.
If I remove -Wmissing-noreturn
then it does compile successfully. Does this need reporting upstream (to llvm)? It seems odd that this would happen.
I spoke too soon! The linking failed with this output:-
libhobbes.a(jitcc.C.o):jitcc.C:typeinfo for hobbes::jitmm: error: undefined reference to 'typeinfo for llvm::SectionMemoryManager'
libhobbes.a(jitcc.C.o):jitcc.C:typeinfo for hobbes::LenWatch: error: undefined reference to 'typeinfo for llvm::JITEventListener'
Are you able to write a Github actions workflow describing the steps to reproduce your build failures? If not, maybe you want to share detailed steps to reproduce this?
What version of clang are you using? it is unusual to have llvm builds in one's $HOME as you do here.
Sorry I do not know how to write a Github actions workflow. I am using LLVM 11.0.0 (I will upgrade to 11.0.1 later today) on a CentOS 7 64bit host (like RHEL). I keep all my build environment in $HOME so as not to interfere with the system.
try the following 2 commands from within your Hobbes directory (it won't mess up with the rest of your system, I promise):
$ curl -L https://nixos.org/nix/install | sh
$ nix-build -A hobbesPackages.clang-8.hobbes
Grab a beer and watch it build ... Your binaries will eventually be stored in $HOBBES/result/bin/...
I have figured it out, LLVM needs to be built with LLVM_ENABLE_RTTI=ON
and now I have been able to compile it from git with no problem.
There is a test for this; the output of llvm-config --has-rtti
should equal YES
but in my case it was NO
.
Originally posted by @Chaz6 in https://github.com/Morgan-Stanley/hobbes/issues/382#issuecomment-761621253