rizinorg / rz-ghidra

Deep ghidra decompiler and sleigh disassembler integration for rizin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug] - rz-ghidra build error on latest

re-fox opened this issue · comments

Rizin Version (built on fedora:latest)

# rizin -v
rizin 0.5.0 @ linux-x86-64
commit: 87c850e43100b46c8641ed24e463293f30bbd271

When building rz-ghidra (pulling from master) the following error is produced

/rz-ghidra/src/analysis_ghidra.cpp: In functionint archinfo(RzAnalysis*, int)’:
/rz-ghidra/src/analysis_ghidra.cpp:39:21: error: ‘RZ_ANALYSIS_ARCHINFO_ALIGNwas not declared in this scope; did you meanRZ_ANALYSIS_ARCHINFO_TEXT_ALIGN’?
   39 |         if(query == RZ_ANALYSIS_ARCHINFO_ALIGN)
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     RZ_ANALYSIS_ARCHINFO_TEXT_ALIGN
/rz-ghidra/src/analysis_ghidra.cpp: At global scope:
/rz-ghidra/src/analysis_ghidra.cpp:3290:27: error: invalid conversion fromint (*)(RzAnalysis*, int)’ {akaint (*)(rz_analysis_t*, int)’} toint (*)(RzAnalysis*, RzAnalysisInfoType)’ {akaint (*)(rz_analysis_t*, rz_analysis_arch_info_type_t)’} [-fpermissive]
 3290 |         /* .archinfo = */ &archinfo,
      |                           ^~~~~~~~~
      |                           |
      |                           int (*)(RzAnalysis*, int) {aka int (*)(rz_analysis_t*, int)}
/rz-ghidra/src/analysis_ghidra.cpp: In functionint archinfo(RzAnalysis*, int)’:
/rz-ghidra/src/analysis_ghidra.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
   43 | }
      | ^
make[2]: *** [CMakeFiles/analysis_ghidra.dir/build.make:118: CMakeFiles/analysis_ghidra.dir/src/analysis_ghidra.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [CMakeFiles/Makefile2:198: CMakeFiles/analysis_ghidra.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Linking CXX shared library asm_ghidra.so
[ 99%] Built target asm_ghidra
make: *** [Makefile:136: all] Error 2

The issue can be replicated using the following Dockerfile

FROM fedora:latest

RUN dnf install -y python3-devel \
                 python3-pip \
                 cmake \
                 gcc-c++ \
                 gcc \
                 meson \
                 ninja-build \
                 git \
                 zlib-devel \
                 openssl \
                 openssl-devel \
                 python3 \
                 autoconf \
                 automake \
                 libtool \
                 python3-pkgconfig \
                 m4 \
                 upx \
                 doxygen \
                 graphviz

RUN git clone https://github.com/rizinorg/rizin.git && \
 cd rizin && \
 meson build && \
 ninja -C build && \
 ninja -C build install 
 
RUN git clone https://github.com/rizinorg/rz-ghidra.git && \
 cd rz-ghidra && \
 git submodule init && \
 git submodule update && \
 mkdir build && cd build && \
 cmake -DCMAKE_INSTALL_PREFIX=~/.local .. && \
 make -j$(nproc) && \
 make install