ampotos / dynStruct

Reverse engineering tool for automatic structure recovering and memory use analysis based on DynamoRIO and Capstone
MIT License
314 stars 34 forks source link

Build error #26

Closed Edu4rdSHL closed 5 years ago

Edu4rdSHL commented 5 years ago

Hello,

I'm trying to add dynStruct to BlackArch Linux but I have the following error:

[edu4rdshl@blackarch dynStruct]$ sudo DynamoRIO_DIR=/usr/share/dynamorio ./build.sh 
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 9.1.0
-- The CXX compiler identification is GNU 9.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Deprecation Warning at /usr/share/dynamorio/drmemory/drmf/DrMemoryFrameworkConfig.cmake:28 (cmake_policy):
  The OLD behavior for policy CMP0024 will be removed from a future version
  of CMake.

  The cmake-policies(7) manual explains that the OLD behaviors of all
  policies are deprecated and that a policy should be set to OLD only under
  specific short-term circumstances.  Projects should be ported to the NEW
  behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
  /usr/share/dynamorio/cmake/DynamoRIOConfig.cmake:1475 (find_package)
  CMakeLists.txt:4 (find_package)

-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/dynStruct/build
Scanning dependencies of target dynStruct
[  7%] Building C object CMakeFiles/dynStruct.dir/src/dynStruct.c.o
[ 14%] Building C object CMakeFiles/dynStruct.dir/src/utils.c.o
[ 21%] Building C object CMakeFiles/dynStruct.dir/src/block_utils.c.o
[ 28%] Building C object CMakeFiles/dynStruct.dir/src/allocs.c.o
[ 35%] Building C object CMakeFiles/dynStruct.dir/src/rw.c.o
[ 42%] Building C object CMakeFiles/dynStruct.dir/src/out.c.o
[ 50%] Building C object CMakeFiles/dynStruct.dir/src/call.c.o
[ 57%] Building C object CMakeFiles/dynStruct.dir/src/sym.c.o
[ 64%] Building C object CMakeFiles/dynStruct.dir/src/tree.c.o
[ 71%] Building C object CMakeFiles/dynStruct.dir/src/elf.c.o
[ 78%] Building C object CMakeFiles/dynStruct.dir/src/args.c.o
/tmp/dynStruct/src/args.c: In function ‘parse_arg’:
/tmp/dynStruct/src/args.c:321:4: warning: this statement may fall through [-Wimplicit-fallthrough=]
  321 |    dr_printf("Bad arg %s\n", argv[ct]);
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/tmp/dynStruct/src/args.c:322:2: note: here
  322 |  case 'h':
      |  ^~~~
[ 85%] Building C object CMakeFiles/dynStruct.dir/src/out_json.c.o
[ 92%] Building C object CMakeFiles/dynStruct.dir/src/custom_alloc.c.o
make[2]: *** No rule to make target '/dynamorio_package/ext/drsyms/libelftc/lib64/libdwarf.a', needed by 'libdynStruct.so'.  Stop.
make[1]: *** [CMakeFiles/Makefile2:76: CMakeFiles/dynStruct.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

Can you explain what's happening there? Because DynamoRIO_DIR is correclty setted.

ampotos commented 5 years ago

Hi, I've never seen this error before. Maybe it's due to some changes in DynamoRIO, can you tell which version you are trying to build with ? I'll try to take a look today to see if I can reproduce.

Edu4rdSHL commented 5 years ago

I'm using the latest DynamoRIO master version. Thank you.

ampotos commented 5 years ago

I have the same issue with the latest release, I'm trying to find a fix.

ampotos commented 5 years ago

The issue seems similar to https://github.com/DynamoRIO/dynamorio/pull/3476. A fix was merge in master the 9 of April. So the last release will not work (released 22 of Februrary). You need to wait a new release or use a more recent of their cronbuild (https://github.com/DynamoRIO/dynamorio/releases). I'm tested to build with the latest cronbuild in 5 mins

EDIT: I just build successfully using the lastest cronbuild https://github.com/DynamoRIO/dynamorio/releases/tag/cronbuild-7.91.18109

Edu4rdSHL commented 5 years ago

Thank you for the heads up. I will switch to git version for that package and see if it works.

Can you leave the issue open still I test today with the latest master commit of Dynamorio and see what happens? It the build end success I will close it issue.

ampotos commented 5 years ago

No problem I let you close it when you confirmed that it's working on your side as well.

Edu4rdSHL commented 5 years ago

Worked with latest cronbuild, thanks!

Edit:

I will add dynStruct to our BlackArch distro when a new dynamorio release will be added.