bluesadi / Pluto

Obfuscator based on LLVM 14.0.6
824 stars 182 forks source link

Compile error #33

Closed ghost closed 1 year ago

ghost commented 2 years ago

There seems to be error in CodeGenPassBuilder. I could not figure out how to fix this error

FAILED: lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPassBuilder.cpp.obj
E:\llvm-mingw-20220906-ucrt-x86_64\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IE:/Github/Pluto-Obfuscator/build/lib/CodeGen -IE:/Github/Pluto-Obfuscator/llvm/lib/CodeGen -IE:/Github/Pluto-Obfuscator/build/include -IE:/Github/Pluto-Obfuscator/llvm/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -O3 -DNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPassBuilder.cpp.obj -MF lib\CodeGen\CMakeFiles\LLVMCodeGen.dir\CodeGenPassBuilder.cpp.obj.d -o lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPassBuilder.cpp.obj -c E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:14:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h:21:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Analysis/AliasAnalysis.h:40:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:14:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/CodeGenPassBuilder.h:53:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Utils.h:170:1: error: expected function body after function declarator
} // namespace llvm
^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:21:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:131:47: error: use of undeclared identifier 'MachineOutlinerPass'
DUMMY_MACHINE_MODULE_PASS("machine-outliner", MachineOutlinerPass, ())
                                              ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:24:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:137:44: error: use of undeclared identifier 'PrintMIRPass'; did you mean 'PrintLoopPass'?
DUMMY_MACHINE_FUNCTION_PASS("mir-printer", PrintMIRPass, ())
                                           ^~~~~~~~~~~~
                                           PrintLoopPass
E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:23:15: note: expanded from macro 'DUMMY_MACHINE_FUNCTION_PASS'
  AnalysisKey PASS_NAME::Key;
              ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Scalar/LoopPassManager.h:494:7: note: 'PrintLoopPass' declared here
class PrintLoopPass : public PassInfoMixin<PrintLoopPass> {
      ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:24:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:137:1: error: cannot define or redeclare 'Key' here because namespace 'llvm' does not enclose namespace 'PrintLoopPass'
DUMMY_MACHINE_FUNCTION_PASS("mir-printer", PrintMIRPass, ())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:23:26: note: expanded from macro 'DUMMY_MACHINE_FUNCTION_PASS'
  AnalysisKey PASS_NAME::Key;
              ~~~~~~~~~~~^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPassBuilder.cpp:24:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:138:54: error: use of undeclared identifier 'FreeMachineFunctionPass'
DUMMY_MACHINE_FUNCTION_PASS("free-machine-function", FreeMachineFunctionPass, ())
                                                     ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:139:46: error: use of undeclared identifier 'FinalizeISelPass'
DUMMY_MACHINE_FUNCTION_PASS("finalize-isel", FinalizeISelPass, ())
                                             ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:140:48: error: use of undeclared identifier 'LocalStackSlotPass'
DUMMY_MACHINE_FUNCTION_PASS("localstackalloc", LocalStackSlotPass, ())
                                               ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:141:44: error: use of undeclared identifier 'ShrinkWrapPass'
DUMMY_MACHINE_FUNCTION_PASS("shrink-wrap", ShrinkWrapPass, ())
                                           ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:142:45: error: use of undeclared identifier 'PrologEpilogInserterPass'
DUMMY_MACHINE_FUNCTION_PASS("prologepilog", PrologEpilogInserterPass, ())
                                            ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:143:46: error: use of undeclared identifier 'ExpandPostRAPseudosPass'
DUMMY_MACHINE_FUNCTION_PASS("postrapseudos", ExpandPostRAPseudosPass, ())
                                             ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:144:53: error: use of undeclared identifier 'ImplicitNullChecksPass'
DUMMY_MACHINE_FUNCTION_PASS("implicit-null-checks", ImplicitNullChecksPass, ())
                                                    ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:145:44: error: use of undeclared identifier 'PostMachineSchedulerPass'
DUMMY_MACHINE_FUNCTION_PASS("postmisched", PostMachineSchedulerPass, ())
                                           ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:146:50: error: use of undeclared identifier 'MachineSchedulerPass'
DUMMY_MACHINE_FUNCTION_PASS("machine-scheduler", MachineSchedulerPass, ())
                                                 ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:147:43: error: use of undeclared identifier 'MachineCopyPropagationPass'
DUMMY_MACHINE_FUNCTION_PASS("machine-cp", MachineCopyPropagationPass, ())
                                          ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:148:46: error: use of undeclared identifier 'PostRASchedulerPass'
DUMMY_MACHINE_FUNCTION_PASS("post-RA-sched", PostRASchedulerPass, ())
                                             ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:149:46: error: use of undeclared identifier 'FEntryInserterPass'
DUMMY_MACHINE_FUNCTION_PASS("fentry-insert", FEntryInserterPass, ())
                                             ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:150:53: error: use of undeclared identifier 'XRayInstrumentationPass'
DUMMY_MACHINE_FUNCTION_PASS("xray-instrumentation", XRayInstrumentationPass, ())
                                                    ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:151:51: error: use of undeclared identifier 'PatchableFunctionPass'
DUMMY_MACHINE_FUNCTION_PASS("patchable-function", PatchableFunctionPass, ())
                                                  ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachinePassRegistry.def:152:54: error: use of undeclared identifier 'RegUsageInfoPropagationPass'
DUMMY_MACHINE_FUNCTION_PASS("reg-usage-propagation", RegUsageInfoPropagationPass, ())
                                                     ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
[332/4104] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CFIInstrInserter.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CFIInstrInserter.cpp:23:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachineFunctionPass.h:21:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/MachineFunction.h:22:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
[333/4104] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CommandFlags.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CommandFlags.cpp:15:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/CodeGen/CommandFlags.h:18:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Instructions.h:28:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/BasicBlock.h:22:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Instruction.h:22:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/DebugLoc.h:17:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/TrackingMDRef.h:16:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Metadata.h:19:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
[334/4104] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/CodeGenPrepare.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/CodeGen/CodeGenPrepare.cpp:17:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
ninja: build stopped: subcommand failed.
PS E:\Github\Pluto-Obfuscator>
ghost commented 2 years ago

The error above is fixed in latest commit dbce4d8fc9c7a6bc0c75e4ca576400cc5ba622ae, there is one more error left

[887/4104] Building CXX object lib/Transforms/Obfuscation/CMakeFiles/LLVMObfuscation.dir/MBAUtils.cpp.obj
FAILED: lib/Transforms/Obfuscation/CMakeFiles/LLVMObfuscation.dir/MBAUtils.cpp.obj
E:\llvm-mingw-20220906-ucrt-x86_64\bin\c++.exe -DGTEST_HAS_RTTI=0 -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -IE:/Github/Pluto-Obfuscator/build/lib/Transforms/Obfuscation -IE:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation -IE:/Github/Pluto-Obfuscator/build/include -IE:/Github/Pluto-Obfuscator/llvm/include -Wa,-mbig-obj -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wstring-conversion -O3 -DNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MD -MT lib/Transforms/Obfuscation/CMakeFiles/LLVMObfuscation.dir/MBAUtils.cpp.obj -MF lib\Transforms\Obfuscation\CMakeFiles\LLVMObfuscation.dir\MBAUtils.cpp.obj.d -o lib/Transforms/Obfuscation/CMakeFiles/LLVMObfuscation.dir/MBAUtils.cpp.obj -c E:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation/MBAUtils.cpp
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation/MBAUtils.cpp:1:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/MBAUtils.h:2:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/InstrTypes.h:30:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Function.h:20:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseSet.h:16:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation/MBAUtils.cpp:5:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/CryptoUtils.h:40:9: warning: 'UNALIGNED' macro redefined [-Wmacro-redefined]
#define UNALIGNED
        ^
E:/llvm-mingw-20220906-ucrt-x86_64/include/_mingw.h:388:9: note: previous definition is here
#define UNALIGNED __unaligned
        ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation/MBAUtils.cpp:6:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/Utils.h:6:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Support/CommandLine.h:34:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Support/VirtualFileSystem.h:603:25: error: too few arguments provided to function-like macro invocation
          S(std::move(S)) {}
                        ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/CryptoUtils.h:181:9: note: macro 'S' defined here
#define S(x, n) RORc((x), (n))
        ^
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Transforms/Obfuscation/MBAUtils.cpp:6:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/Utils.h:6:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Support/CommandLine.h:34:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Support/VirtualFileSystem.h:604:5: error: expected '{' or ','
    RedirectingDirectoryEntry(StringRef Name, Status S)
    ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Support/VirtualFileSystem.h:605:52: error: too few arguments provided to function-like macro invocation
        : Entry(EK_Directory, Name), S(std::move(S)) {}
                                                   ^
E:/Github/Pluto-Obfuscator/llvm/include/llvm/Transforms/Obfuscation/CryptoUtils.h:181:9: note: macro 'S' defined here
#define S(x, n) RORc((x), (n))
        ^
2 warnings and 3 errors generated.
[888/4104] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/AliasAnalysisSummary.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Analysis/AliasAnalysisSummary.cpp:3:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/InstrTypes.h:30:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Function.h:20:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseSet.h:16:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
[889/4104] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/AliasAnalysis.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Analysis/AliasAnalysis.cpp:26:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Analysis/AliasAnalysis.h:40:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
[890/4104] Building CXX object lib/Analysis/CMakeFiles/LLVMAnalysis.dir/AliasAnalysisEvaluator.cpp.obj
In file included from E:/Github/Pluto-Obfuscator/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp:9:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/Analysis/AliasAnalysisEvaluator.h:27:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/IR/Function.h:20:
In file included from E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseSet.h:16:
E:/Github/Pluto-Obfuscator/llvm/include/llvm/ADT/DenseMap.h:128:16: warning: variable 'NumEntries' set but not used [-Wunused-but-set-variable]
      unsigned NumEntries = getNumEntries();
               ^
1 warning generated.
ninja: build stopped: subcommand failed.
PS E:\Github\Pluto-Obfuscator>
rruipinheiro commented 2 years ago

I'm getting the same error on macOS, can someone help?

ghost commented 2 years ago

@bluesadi can you please take a look? it seems you didn't even tested when you made a commit

bluesadi commented 2 years ago

Sorry for later reply. Seems there was something wrong with the synchronization of main and dev branch. Now it is fixed.

ghost commented 1 year ago

Works now, thanks