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

Can't compile against souffle (documentation out of date?) #10

Closed rjzak closed 4 years ago

rjzak commented 4 years ago

Neither the readme document nor the CMake script indicate which version of Souffle to use. I do notice that the readme document is over a year old. The current version of Souffle is 2.0.0, and trying to compile against it throws a lot of operating overloading errors: ddisasm/src/DlOperandTable.cpp:34:76: error: ambiguous overload for ‘operator<<’ (operand types are ‘souffle::tuple’ and ‘const int’).

I fixed some of these by casting the variable to what I guessed to be the correct Ram... type: DatalogUtils.cpp:184: t << (RamUnsigned) inst.immediateOffset << (RamUnsigned) inst.displacementOffset;

However, there are a lot of these errors and I'm hesitant to go through all of them and find that this didn't work for some reason. How about updating the documentation?

Also, when running the configure script for souffle versions 2.0.0, 1.7.0, and 1.6.0, it says: configure: WARNING: unrecognized options: --disable-provenance

aeflores commented 4 years ago

Hi @rjzak, you are right in that the Readme is outdated. It says Souffle 1.7.0 or higher but right now we support 1.7.0 and 1.7.1. Souffle 2.0 introduced a lot of changes in its type system and we still need to makes some changes in Ddisasm to support it.

Let me know if you have any trouble using Souffle 1.7.1.

rjzak commented 4 years ago

I figure it out and was able to get it to compile against Souffle 1.7.1. I couldn't get CMake to find LEIF, even when using GrammaTech's fork of LEIF and making sure the FindLief.cmake file was where it should be. Ultimately I was trying to see if adding PE32 support would be something I could pull off, and I think the answer is no.

aeflores commented 4 years ago

Did you provide the LIEF path to cmake? E.g. if you did installed LIEF using make install in Ubuntu 18 it would the following:

cmake   -DLIEF_ROOT=/usr/

See for example the CI script https://github.com/GrammaTech/ddisasm/blob/master/.ci/gitlab-ci.yml#L48

rjzak commented 4 years ago

No, I didn't know to look for that file. I'm on Ubuntu 20.04, and figured it would find the cmake file. I had LIEF in /usr/ and /usr/local/, neither worked. I also tried to use the sample approach that is used with ehp, to find the specific file names, which seems like a better approach, but also failed.