eshard / obfuscator-llvm

Other
223 stars 42 forks source link

CommandLine Error: Option 'enable-fs-discriminator' registered more than once! #7

Closed tonitick closed 1 year ago

tonitick commented 1 year ago

Hello, I got the following error while applying the passes with clang,

zhong@noodle:\~/proj/hello_world$ /usr/lib/llvm-14/bin/clang -fno-legacy-pass-manager -fpass-plugin=/home/zhong/proj/obfuscator-llvm/build/libLLVMObfuscator.so hello_world.c -o hello_world clang (LLVM option parsing): CommandLine Error: Option 'enable-fs-discriminator' registered more than once! fatal error: error in backend: inconsistency in registered CommandLine options clang: error: clang frontend command failed with exit code 70 (use -v to see invocation) Ubuntu clang version 14.0.6-++20220622053131+f28c006a5895-1~exp1~20220622173215.157 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm-14/bin clang: note: diagnostic msg: ****

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: Preprocessed source(s) and associated run script(s) are located at: clang: note: diagnostic msg: /tmp/hello_world-889897.c clang: note: diagnostic msg: /tmp/hello_world-889897.sh clang: note: diagnostic msg:

****

Do have any idea how to solve this? Thanks.

PatriceBlin commented 1 year ago

Hi,

I encountered this in the past, but I don't really remember how. Probably the way your system LLVM libs are linked and linking to both LLVMCore and LLVMSupport is too much.

Could you try removing LLVMCore from target_link_libraries there ?

https://github.com/eshard/obfuscator-llvm/blob/main/CMakeLists.txt#L41

tonitick commented 1 year ago

That works, thank you!