radareorg / r2retdec

RetDec plugin for Radare2
https://retdec.com/
MIT License
124 stars 24 forks source link

Cutter plugin: LLVM ERROR: inconsistency in registered CommandLine options #24

Closed re-fox closed 2 years ago

re-fox commented 4 years ago

After building the Cutter plugin for retdec-r2plugin, Cutter will no longer start and throw the following error:

Setting PYTHONHOME = "/tmp/.mount_CutterWmruTW/usr"  for AppImage.
PYTHONHOME = "/tmp/.mount_CutterWmruTW/usr"
Setting r2 prefix = "/tmp/.mount_CutterWmruTW/usr"  for AppImage.
Setting r2 plugins dir = "/tmp/.mount_CutterWmruTW/usr/share/radare2/plugins"
: for the -W option: cl::alias must have argument name specified!
: CommandLine Error: Option 'bitcode-mdindex-threshold' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
QMutex: destroying locked mutex

I used the following build instructions:

git clone https://github.com/avast/retdec-r2plugin
cd retdec-r2plugin
mkdir build && cd build
cmake .. -DBUILD_CUTTER_PLUGIN=ON -DCMAKE_INSTALL_PREFIX=~/.local/ -DCMAKE_LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/10/
make -j4
make install

After building the plugin I can confirm it is working from the R2 CLI

$ r2 -A /bin/ls
Warning: run r2 with -e io.cache=true to fix relocations in disassembly
[x] Analyze all flags starting with sym. and entry0 (aa)
[x] Analyze function calls (aac)
[x] Analyze len bytes of instructions for references (aar)
[x] Check for vtables
[x] Type matching analysis for all functions (aaft)
[x] Propagate noreturn information
[x] Use -AA or aaaa to perform additional experimental analysis.

[0x000068d0]> pdz?
Usage: pdz   # Native RetDec decompiler plugin.
| pdz      # Show decompilation result of current function.
| pdz*     # Return decompilation of current function to r2 as comment.
| pdza[?]  # Run RetDec analysis.
| pdze     # Show environment variables.
| pdzj     # Dump current decompiled function as JSON.
| pdzo     # Show current decompiled function side by side with offsets.

I am using the latest Cutter AppImage and can confirm when launching Cutter with the --no-plugins options, it will run.

@karliss had some information in this issue -> https://github.com/radareorg/cutter/issues/2430