radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.34k stars 2.97k forks source link

PowerPC plugin error during building #21782

Open armdn opened 1 year ago

armdn commented 1 year ago

Environment

Friday, 26 may 2023 11:18:50 (MSK)

radare2 5.8.6 0 @ darwin-x86-64
birth: git.5.8.6 2023-05-05__19:38:15
commit: 5.8.6

Darwin x86_64

Description

When trying to install a plug-in for the PowerPC architecture, the following error is displayed during the build of the plug-in:

Final report:
 - PREFIX = /Users/armdn/.local/share/radare2/prefix
rm -f *.dylib *.o asm_x86_udis.o asm_spc700.o asm_ba2.o asm_x86_olly.o ../arch/x86/ollyasm/disasm.o ../arch/x86/ollyasm/asmserv.o ../arch/x86/ollyasm/assembl.o asm_x86_tab.o asm_armthumb.o ../arch/arm/armthumb.o ../arch/ppc/ppc_disasm/ppc_disasm.o asm_ppc_disasm.o asm_psosvm.o ../arch/psosvm/vmas/vmas.o asm_m68k_net.o ../arch/m68k/m68k_disasm/m68k_disasm.o arch_blackfin.o asm_x86_bea.o ../arch/x86/bea/BeaEngine.o asm_msil.o asm_swf.o ../arch/swf/swfdis.o asm_vc4.o ../arch/vc4/vc4-dis.o ../arch/vc4/vc4-asm.o ../arch/vc4/vc4-desc.o ../arch/vc4/vc4-ibld.o ../arch/vc4/vc4-opc.o ../arch/vc4/cgen-bitset.o ../arch/vc4/cgen-dis.o ../arch/vc4/cgen-asm.o ../arch/vc4/cgen-opc.o ../arch/vc4/libvc4/eval.o ../arch/vc4/libvc4/decode.o ../arch/vc4/libvc4/vc4_decode.o ../arch/vc4/libvc4/vc4_arch.o ../arch/vc4/libvc4/vc4_util.o asm_mc6809.o asm_z80_nc.o asm_x86_zyan.o ../arch/x86/zyan/src/Decoder.o ../arch/x86/zyan/src/Formatter.o ../arch/x86/zyan/src/InstructionTable.o ../arch/x86/zyan/src/Mnemonic.o ../arch/x86/zyan/src/Register.o ../arch/x86/zyan/src/Utils.o ../arch/x86/zyan/src/Zydis.o asm_evm.o ../arch/evm/evm.o asm_atombios.o ../arch/atombios/atombios.o
gcc -I/usr/local/Cellar/radare2/5.8.6/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1   -c -o ../arch/ppc/ppc_disasm/ppc_disasm.o ../arch/ppc/ppc_disasm/ppc_disasm.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
gcc -I/usr/local/Cellar/radare2/5.8.6/include/libr -g -I/shlr -I../../include -I../arch/ -I../arch/include -Wall -shared -fPIC  -DLIL_ENDIAN=1   -c -o asm_ppc_disasm.o asm_ppc_disasm.c
clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
asm_ppc_disasm.c:13:33: error: unknown type name 'RAsmOp'; did you mean 'RAsm'?
static int disassemble(RAsm *a, RAsmOp *aop, const ut8 *buf, int len) {
                                ^~~~~~
                                RAsm
/usr/local/Cellar/radare2/5.8.6/include/libr/r_asm.h:66:3: note: 'RAsm' declared here
} RAsm;
  ^
asm_ppc_disasm.c:29:22: error: no member named 'buf_asm' in 'struct r_asm_t'
        r_strbuf_set (&aop->buf_asm, res);
                       ~~~  ^
asm_ppc_disasm.c:30:7: error: no member named 'size' in 'struct r_asm_t'
        aop->size = 4;
        ~~~  ^
asm_ppc_disasm.c:31:14: error: no member named 'size' in 'struct r_asm_t'
        return aop->size;
               ~~~  ^
asm_ppc_disasm.c:34:1: error: unknown type name 'RAsmPlugin'
RAsmPlugin r_asm_plugin_ppc_disasm = {
^
5 errors generated.
make: *** [asm_ppc_disasm.o] Error 1

Test

On macOS 10.14.6 Mojave. radare2 installed via homebrew;

With command: r2pm -i ppcdisasm

Always reproducible. Tried on different machines with same OS and installation.

trufae commented 1 year ago

R2 ships native support for ppc theres no need to install this old and unmaintained plugin. But in any case. This is an issue in the extras repository where this plugin lives.

The reason why it doesnt compile is because its implemented as an asm plugin which was deprectaed a year ago. Now we only do arch plugins. Its easy to translate them

armdn commented 1 year ago

Oh, thank you!

upintheairsheep commented 1 year ago

Did you post about the AppleInternal apps on BetaArchive?

riptl commented 9 months ago

IMO This issue should be closed (and re-opened in the plugin repo)