构建谷歌Breakpad Android示例错误



ubuntu 14.04 x64; NDK-R10C

当我在"Android/sample_app"上运行ndk-build时,它可以产生libbreakpad_client.a,但是在链接抛出错误时:

[arm64-v8a] Compile++      : test_google_breakpad <= test_breakpad.cpp
[arm64-v8a] Compile++      : breakpad_client <= crash_generation_client.cc
[arm64-v8a] Compile++      : breakpad_client <= exception_handler.cc
[arm64-v8a] Compile++      : breakpad_client <= minidump_descriptor.cc
[arm64-v8a] Compile++      : breakpad_client <= log.cc
[arm64-v8a] Compile++      : breakpad_client <= linux_dumper.cc
[arm64-v8a] Compile++      : breakpad_client <= linux_ptrace_dumper.cc
[arm64-v8a] Compile++      : breakpad_client <= minidump_writer.cc
[arm64-v8a] Compile++      : breakpad_client <= minidump_file_writer.cc
[arm64-v8a] Compile        : breakpad_client <= breakpad_getcontext.S
[arm64-v8a] Compile        : breakpad_client <= convert_UTF.c
[arm64-v8a] Compile++      : breakpad_client <= md5.cc
[arm64-v8a] Compile++      : breakpad_client <= string_conversion.cc
[arm64-v8a] Compile++      : breakpad_client <= elfutils.cc
[arm64-v8a] Compile++      : breakpad_client <= file_id.cc
[arm64-v8a] Compile++      : breakpad_client <= guid_creator.cc
[arm64-v8a] Compile++      : breakpad_client <= linux_libc_support.cc
[arm64-v8a] Compile++      : breakpad_client <= memory_mapped_file.cc
[arm64-v8a] Compile++      : breakpad_client <= safe_readlink.cc
[arm64-v8a] StaticLibrary  : libbreakpad_client.a
[arm64-v8a] Executable     : test_google_breakpad
./obj/local/arm64-v8a/libbreakpad_client.a(minidump_writer.o): In function `WriteThreadListStream':
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:326: undefined reference to `google_breakpad::UContextReader::GetStackPointer(ucontext const*)'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:332: undefined reference to `google_breakpad::UContextReader::GetInstructionPointer(ucontext const*)'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:378: undefined reference to `google_breakpad::UContextReader::FillCPUContext(MDRawContextARM64*, ucontext const*, fpsimd_context const*)'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:383: undefined reference to `google_breakpad::SeccompUnwinder::PopSeccompStackFrame(MDRawContextARM64*, MDRawThread const&, unsigned char*)'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:403: undefined reference to `google_breakpad::ThreadInfo::FillCPUContext(MDRawContextARM64*) const'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:405: undefined reference to `google_breakpad::SeccompUnwinder::PopSeccompStackFrame(MDRawContextARM64*, MDRawThread const&, unsigned char*)'
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/minidump_writer/minidump_writer.cc:413: undefined reference to `google_breakpad::ThreadInfo::GetInstructionPointer() const'
./obj/local/arm64-v8a/libbreakpad_client.a(exception_handler.o): In function `google_breakpad::ExceptionHandler::DoDump(int, void const*, unsigned long)':
/home/freeloop/workspace/androidstudio/trunk/android/sample_app/jni/../../google_breakpad/../../src/client/linux/handler/exception_handler.cc:557: undefined reference to `google_breakpad::WriteMicrodump(int, void const*, unsigned long, std::list<google_breakpad::MappingEntry, std::allocator<google_breakpad::MappingEntry> > const&)'
collect2: error: ld returned 1 exit status
make: *** [obj/local/arm64-v8a/test_google_breakpad] Error 1

如何修复此错误?

我不得不在android/google_breakpad/Android.mk更改Android制作文件并修改LOCAL_SRC_FILES:

# List of client source files, directly taken from Makefile.am
LOCAL_SRC_FILES := 
    src/client/linux/crash_generation/crash_generation_client.cc 
    src/client/linux/handler/exception_handler.cc 
    src/client/linux/handler/minidump_descriptor.cc 
    src/client/linux/log/log.cc 
    src/client/linux/minidump_writer/linux_dumper.cc 
    src/client/linux/minidump_writer/linux_ptrace_dumper.cc 
    src/client/linux/minidump_writer/minidump_writer.cc 
    src/client/linux/microdump_writer/microdump_writer.cc 
    src/client/linux/dump_writer_common/ucontext_reader.cc 
    src/client/linux/dump_writer_common/seccomp_unwinder.cc 
    src/client/linux/dump_writer_common/thread_info.cc 
    src/client/minidump_file_writer.cc 
    src/common/android/breakpad_getcontext.S 
    src/common/convert_UTF.c 
    src/common/md5.cc 
    src/common/string_conversion.cc 
    src/common/linux/elfutils.cc 
    src/common/linux/file_id.cc 
    src/common/linux/guid_creator.cc 
    src/common/linux/linux_libc_support.cc 
    src/common/linux/memory_mapped_file.cc 
    src/common/linux/safe_readlink.cc

它现在正在为我链接。

最新更新