GrammaTech / ddisasm

A fast and accurate disassembler
https://grammatech.github.io/ddisasm/
GNU Affero General Public License v3.0
647 stars 59 forks source link

DDisasm fails to build due to souffle error #6

Closed aditi-gupta closed 5 years ago

aditi-gupta commented 5 years ago

OS: Ubuntu 16.04 Capstone version: 4.0.1 Souffle version: 1.5.1 Issue: In ddisasm/build directory, running make produces error:


/home/aditi/ddisasm/build/src/souffle_disasm.cpp: In lambda function:
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35309:34: error: redeclaration of ‘const souffle::ram::Tuple<long int, 4> key’
 const ram::Tuple<RamDomain,4> key({{env0[1],0,0,0}});
                                  ^
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35299:31: note: ‘const souffle::ram::Tuple<long int, 4> key’ previously declared here
 const ram::Tuple<RamDomain,4> key({{env0[0],0,0,0}});
                               ^~~
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35310:6: error: conflicting declaration ‘auto range’
 auto range = rel_346_block_points->equalRange_1(key,READ_OP_CONTEXT(rel_346_block_points_op_ctxt));
      ^~~~~
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35300:6: note: previous declaration as ‘souffle::range<souffle::detail::btree<souffle::ram::Tuple<long int, 4>, souffle::ram::index_utils::comparator<0, 1, 2, 3>, std::allocator<souffle::ram::Tuple<long int, 4> >, 256, souffle::detail::binary_search, true, souffle::ram::index_utils::comparator<0, 1, 2, 3>, souffle::detail::updater<souffle::ram::Tuple<long int, 4> > >::iterator> range’
 auto range = rel_346_block_points->equalRange_1(key,READ_OP_CONTEXT(rel_346_block_points_op_ctxt));
      ^~~~~
/home/aditi/ddisasm/build/src/souffle_disasm.cpp: In lambda function:
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35346:34: error: redeclaration of ‘const souffle::ram::Tuple<long int, 4> key’
 const ram::Tuple<RamDomain,4> key({{env0[0],0,0,0}});
                                  ^
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35336:31: note: ‘const souffle::ram::Tuple<long int, 4> key’ previously declared here
 const ram::Tuple<RamDomain,4> key({{env0[1],0,0,0}});
                               ^~~
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35347:6: error: conflicting declaration ‘auto range’
 auto range = rel_346_block_points->equalRange_1(key,READ_OP_CONTEXT(rel_346_block_points_op_ctxt));
      ^~~~~
/home/aditi/ddisasm/build/src/souffle_disasm.cpp:35337:6: note: previous declaration as ‘souffle::range<souffle::detail::btree<souffle::ram::Tuple<long int, 4>, souffle::ram::index_utils::comparator<0, 1, 2, 3>, std::allocator<souffle::ram::Tuple<long int, 4> >, 256, souffle::detail::binary_search, true, souffle::ram::index_utils::comparator<0, 1, 2, 3>, souffle::detail::updater<souffle::ram::Tuple<long int, 4> > >::iterator> range’
 auto range = rel_346_block_points->equalRange_1(key,READ_OP_CONTEXT(rel_346_block_points_op_ctxt));
      ^~~~~
src/CMakeFiles/ddisasm.dir/build.make:86: recipe for target 'src/CMakeFiles/ddisasm.dir/souffle_disasm.cpp.o' failed
make[2]: *** [src/CMakeFiles/ddisasm.dir/souffle_disasm.cpp.o] Error 1
CMakeFiles/Makefile2:124: recipe for target 'src/CMakeFiles/ddisasm.dir/all' failed
make[1]: *** [src/CMakeFiles/ddisasm.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2```
Roadsong commented 5 years ago

Same error here... Any help will be appreciated!

bin2415 commented 5 years ago

I met same error too. And I comment the conflict lines and it can compile...


But it can't work when recompile ex program.

aeflores commented 5 years ago

I can't reproduce this issue. My souffle_disasm.cpp file seems to be different. Would you mind sharing yours? What is the exact configuration of souffle? how did you build it? Are you sure the 1.5.1 version is being called?

Roadsong commented 5 years ago

I finally got it.

The current unstable version of soufflé might have some bugs. @aditi-gupta @bin2415 I think you just cloned the repo, right?

$ git clone git://github.com/souffle-lang/souffle.git

And you will find that there is no option named --disable-provenance since it has been replaced by --disable--ncurses. See commit history.

My suggestion is to check out the stable version 1.5.1 and then build with --enable-64bit-domain --disable-provenance.

$ git checkout 1.5.1
$ sh ./bootstrap
$ ./configure --enable-64bit-domain --disable-provenance
$ make

And , @aeflores , you cannot download soufflé 1.5.1 source code DIRECTLY and build since you will get an error at

 sh ./bootstrap
...
fatal: not a git repository (or any of the parent directories): .git
...

according to its building instructions.

So I also suggest you could mention this at README.md :)

aeflores commented 5 years ago

@Roadsong thanks for following up! Indeed, we use the last stable version of Souffle (1.5.1). I have updated the README.md with detailed installation instructions for souffle. Hopefully this solves the issue.