rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin
GNU Lesser General Public License v3.0
818 stars 86 forks source link

failed to build on gentoo #340

Open rpolasek opened 8 months ago

rpolasek commented 8 months ago

using gcc 13.2.1

[ 35%] Built target ghidra_libdecomp
[ 36%] Building CXX object CMakeFiles/core_ghidra.dir/src/core_ghidra.cpp.o
[ 36%] Building CXX object CMakeFiles/core_ghidra.dir/src/RizinArchitecture.cpp.o
[ 37%] Building CXX object CMakeFiles/core_ghidra.dir/src/RizinLoadImage.cpp.o
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp: In lambda function:
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:47:69: error: no matching function for call to ‘rz_pvector_foreach_cpp<RzBinSection>(RzList*&, RizinLoadImage::getReadonly(ghidra::RangeList&) const::<lambda(RzSkylineItem*)>::<lambda(RzBinFile*)>::<lambda(RzBinSection*)>)’
   47 |                                 rz_pvector_foreach_cpp<RzBinSection>(bf->o->sections, [&](RzBinSection *sec) {
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   48 |                                         if(!sec->name || !sec->vsize)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   49 |                                                 return true;
      |                                                 ~~~~~~~~~~~~         
   50 |                                         if(strstr(sec->name, "__objc_data") || strstr(sec->name, "__objc_classrefs") || strstr(sec->name, "__objc_msgrefs") ||
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   51 |                                                 strstr(sec->name, "__objc_selrefs") || strstr(sec->name, "__objc_superrefs") || strstr(sec->name, "__objc_protorefs"))
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |                                                 list.insertRange(space, sec->vaddr, sec->vaddr + sec->vsize - 1);
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   53 |                                         return true;
      |                                         ~~~~~~~~~~~~                 
   54 |                                 });
      |                                 ~~                                   
In file included from /usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:6:
/usr/local/src/rz-ghidra/src/RizinUtils.h:39:39: note: candidate: ‘template<class T, class F> bool rz_pvector_foreach_cpp(RzPVector*, const F&)’
   39 | template<typename T, typename F> bool rz_pvector_foreach_cpp(RzPVector *vec, const F &func)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/rz-ghidra/src/RizinUtils.h:39:39: note:   template argument deduction/substitution failed:
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:47:77: note:   cannot convert ‘bf->rz_bin_file_t::o->rz_bin_object_t::sections’ (type ‘RzList*’ {aka ‘rz_list_t*’}) to type ‘RzPVector*’ {aka ‘rz_pvector_t*’}
   47 |                                 rz_pvector_foreach_cpp<RzBinSection>(bf->o->sections, [&](RzBinSection *sec) {
      |                                                                      ~~~~~~~^~~~~~~~
make[2]: *** [CMakeFiles/core_ghidra.dir/build.make:104: CMakeFiles/core_ghidra.dir/src/RizinLoadImage.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:136: CMakeFiles/core_ghidra.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
[  1%] Built target pugixml
[  6%] Built target ghidra_base
[ 29%] Built target ghidra_decompiler
[ 34%] Built target ghidra_sleigh
[ 35%] Built target ghidra_libdecomp
[ 36%] Building CXX object CMakeFiles/core_ghidra.dir/src/RizinLoadImage.cpp.o
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp: In lambda function:
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:47:69: error: no matching function for call to ‘rz_pvector_foreach_cpp<RzBinSection>(RzList*&, RizinLoadImage::getReadonly(ghidra::RangeList&) const::<lambda(RzSkylineItem*)>::<lambda(RzBinFile*)>::<lambda(RzBinSection*)>)’
   47 |                                 rz_pvector_foreach_cpp<RzBinSection>(bf->o->sections, [&](RzBinSection *sec) {
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   48 |                                         if(!sec->name || !sec->vsize)
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   49 |                                                 return true;
      |                                                 ~~~~~~~~~~~~         
   50 |                                         if(strstr(sec->name, "__objc_data") || strstr(sec->name, "__objc_classrefs") || strstr(sec->name, "__objc_msgrefs") ||
      |                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   51 |                                                 strstr(sec->name, "__objc_selrefs") || strstr(sec->name, "__objc_superrefs") || strstr(sec->name, "__objc_protorefs"))
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |                                                 list.insertRange(space, sec->vaddr, sec->vaddr + sec->vsize - 1);
      |                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   53 |                                         return true;
      |                                         ~~~~~~~~~~~~                 
   54 |                                 });
      |                                 ~~                                   
In file included from /usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:6:
/usr/local/src/rz-ghidra/src/RizinUtils.h:39:39: note: candidate: ‘template<class T, class F> bool rz_pvector_foreach_cpp(RzPVector*, const F&)’
   39 | template<typename T, typename F> bool rz_pvector_foreach_cpp(RzPVector *vec, const F &func)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~
/usr/local/src/rz-ghidra/src/RizinUtils.h:39:39: note:   template argument deduction/substitution failed:
/usr/local/src/rz-ghidra/src/RizinLoadImage.cpp:47:77: note:   cannot convert ‘bf->rz_bin_file_t::o->rz_bin_object_t::sections’ (type ‘RzList*’ {aka ‘rz_list_t*’}) to type ‘RzPVector*’ {aka ‘rz_pvector_t*’}
   47 |                                 rz_pvector_foreach_cpp<RzBinSection>(bf->o->sections, [&](RzBinSection *sec) {
      |                                                                      ~~~~~~~^~~~~~~~
make[2]: *** [CMakeFiles/core_ghidra.dir/build.make:104: CMakeFiles/core_ghidra.dir/src/RizinLoadImage.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:136: CMakeFiles/core_ghidra.dir/all] Error 2
make: *** [Makefile:136: all] Error 2
XVilka commented 8 months ago

Thanks for reporting this! It is because we refactored and continue to refactor some of the Rizin APIs:

We will update rz-ghidra code once this refactoring is complete to avoid double work. We plan the release soon, so stay tuned!