Open lbwengineer opened 1 year ago
看不出来是什么问题,不过NDK r22b用的LLVM版本是LLVM 11,把LLVM 12移植到r22b上大概率会出问题。OLLVM 9.0.1能移植成功属于是运气好,最好还是同LLVM版本移植。
我在这里找了一个ollvm的pass:https://github.com/o2e/OLLVM-9.0.1 然后我添加-mllvm -fla编译选项,能够编译通过,并且混淆有效,但是这个项目的fla选项就会导致编译失败,你可以看看是什么原因。
我在这里找了一个ollvm的pass:https://github.com/o2e/OLLVM-9.0.1 然后我添加-mllvm -fla编译选项,能够编译通过,并且混淆有效,但是这个项目的fla选项就会导致编译失败,你可以看看是什么原因。
而且我把上面的pass移植到你的项目里编译后可以正常混淆的,原来的fla选项就会编译失败,不知道是什么原因。
好的,我过几天看一下
我也是一样 咋修复?
以下是编译失败日志: [ 75%] Building CXX object memhelper/CMakeFiles/memhelper.dir/src/memory/rwdata.cpp.o [ 76%] Building CXX object memhelper/CMakeFiles/memhelper.dir/src/module/breakpoint.cpp.o [ 77%] Building CXX object memhelper/CMakeFiles/memhelper.dir/src/module/inline_intercept.cpp.o PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script. Stack dump:
0 0x00007fc6addab641 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMSupport.so.12+0x1a6641)
1 0x00007fc6adda9404 llvm::sys::RunSignalHandlers() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMSupport.so.12+0x1a4404)
2 0x00007fc6adda96a1 llvm::sys::CleanupOnSignal(unsigned long) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMSupport.so.12+0x1a46a1)
3 0x00007fc6adcc1718 CrashRecoverySignalHandler(int) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMSupport.so.12+0xbc718)
4 0x00007fc6ad863090 (/lib/x86_64-linux-gnu/libc.so.6+0x43090)
5 0x00007fc6ad776ed4 llvm::DIE::getUnitDie() const (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libLLVMAsmPrinter.so.12+0x6bed4)
6 0x00007fc6ad792d64 llvm::DwarfDebug::finishEntityDefinitions() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libLLVMAsmPrinter.so.12+0x87d64)
7 0x00007fc6ad7acdc9 llvm::DwarfDebug::finalizeModuleInfo() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libLLVMAsmPrinter.so.12+0xa1dc9)
8 0x00007fc6ad7b3d68 llvm::DwarfDebug::endModule() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libLLVMAsmPrinter.so.12+0xa8d68)
9 0x00007fc6ad7544d9 llvm::AsmPrinter::doFinalization(llvm::Module&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libLLVMAsmPrinter.so.12+0x494d9)
10 0x00007fc6ae0f56d5 llvm::FPPassManager::doFinalization(llvm::Module&) (.localalias) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMCore.so.12+0x2006d5)
11 0x00007fc6ae101891 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMCore.so.12+0x20c891)
12 0x00007fc6b0899d65 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::DataLayout const&, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete >) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangCodeGen.so.12+0xe8d65)
13 0x00007fc6b0c0f979 clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangCodeGen.so.12+0x45e979)
14 0x00007fc6abd53f79 clang::ParseAST(clang::Sema&, bool, bool) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/../lib/libclangParse.so.12+0x39f79)
15 0x00007fc6b0c0e656 clang::CodeGenAction::ExecuteAction() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangCodeGen.so.12+0x45d656)
16 0x00007fc6af6c03c1 clang::FrontendAction::Execute() (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangFrontend.so.12+0x11b3c1)
17 0x00007fc6af6549db clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangFrontend.so.12+0xaf9db)
18 0x00007fc6b1657210 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangFrontendTool.so.12+0x5210)
19 0x00007fc6b22cb05d cc1_main(llvm::ArrayRef<char const>, char const, void*) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang+++0x1405d)
20 0x00007fc6b22c883b ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang+++0x1183b)
21 0x00007fc6af3d13f9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool) const::'lambda'()>(long) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangDriver.so.12+0x9e3f9)
22 0x00007fc6adcc1817 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libLLVMSupport.so.12+0xbc817)
23 0x00007fc6af3d1ef6 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >, bool) const (.part.0) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangDriver.so.12+0x9eef6)
24 0x00007fc6af3a29ec clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangDriver.so.12+0x6f9ec)
25 0x00007fc6af3a3409 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangDriver.so.12+0x70409)
26 0x00007fc6af3b14a1 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib/libclangDriver.so.12+0x7e4a1)
27 0x00007fc6b22c69ba main (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang+++0xf9ba)
28 0x00007fc6ad844083 __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:342:3
29 0x00007fc6b22c83ce _start (/home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang+++0x113ce)
clang++: error: clang frontend command failed with exit code 139 (use -v to see invocation) clang version 12.0.1 Target: armv7-none-linux-android21 Thread model: posix InstalledDir: /home/android-ndk-r22b/toolchains/llvm/prebuilt/linux-x86_64/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/breakpoint-856062.cpp clang++: note: diagnostic msg: /tmp/breakpoint-856062.sh clang++: note: diagnostic msg:
对于以上的问题,我没有任何头绪,我只知道ollvm 9.0.1版本移植到r22b是可以正常编译的,编译参数可以随便添加。ollvm12.0.1版本添加任何混淆参数都会报出上面类似的错误,我不知道是不是llvm版本的原因还是pass的原因。