xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-devtools/breakpad/breakpad_git.bb (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# Released under the MIT license (see COPYING.MIT for the terms)
2*4882a593Smuzhiyun
3*4882a593Smuzhiyun# Applications using this library needs to add link against libbreakpad_client.a.
4*4882a593Smuzhiyun
5*4882a593SmuzhiyunSUMMARY = "An open-source multi-platform crash reporting system"
6*4882a593SmuzhiyunDESCRIPTION = "Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact \"minidump\" files, send them back to your server, and produce C and C++ stack traces from these minidumps. "
7*4882a593SmuzhiyunHOMEPAGE = "https://code.google.com/p/google-breakpad/"
8*4882a593SmuzhiyunLICENSE = "BSD-3-Clause"
9*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=8bb274ebd1901085fd71a8d8afe8831b"
10*4882a593SmuzhiyunSECTION = "libs"
11*4882a593Smuzhiyun
12*4882a593Smuzhiyuninherit autotools
13*4882a593Smuzhiyun
14*4882a593SmuzhiyunDEPENDS:append:libc-musl = " libucontext"
15*4882a593Smuzhiyun
16*4882a593SmuzhiyunBBCLASSEXTEND = "native"
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunPE = "2"
19*4882a593Smuzhiyun
20*4882a593SmuzhiyunPV = "1.0"
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunSRCREV_FORMAT = "breakpad_gtest_protobuf_lss_gyp"
23*4882a593Smuzhiyun
24*4882a593SmuzhiyunSRCREV_breakpad = "8b22babdf894e5aa98b2dbbe103f7e3856a71944"
25*4882a593Smuzhiyun#v1.10.0
26*4882a593SmuzhiyunSRCREV_gtest = "4fe018038f87675c083d0cfb6a6b57c274fb1753"
27*4882a593SmuzhiyunSRCREV_protobuf = "cb6dd4ef5f82e41e06179dcd57d3b1d9246ad6ac"
28*4882a593SmuzhiyunSRCREV_lss = "fd00dbbd0c06a309c657d89e9430143b179ff6db"
29*4882a593SmuzhiyunSRCREV_gyp = "324dd166b7c0b39d513026fa52d6280ac6d56770"
30*4882a593Smuzhiyun
31*4882a593SmuzhiyunSRC_URI = "git://github.com/google/breakpad;name=breakpad;branch=main;protocol=https \
32*4882a593Smuzhiyun           git://github.com/google/googletest.git;destsuffix=git/src/testing/gtest;name=gtest;branch=main;protocol=https \
33*4882a593Smuzhiyun           git://github.com/protocolbuffers/protobuf.git;destsuffix=git/src/third_party/protobuf/protobuf;name=protobuf;branch=master;protocol=https \
34*4882a593Smuzhiyun           git://chromium.googlesource.com/linux-syscall-support;protocol=https;branch=main;destsuffix=git/src/third_party/lss;name=lss \
35*4882a593Smuzhiyun           git://chromium.googlesource.com/external/gyp;protocol=https;destsuffix=git/src/tools/gyp;name=gyp;branch=master \
36*4882a593Smuzhiyun           file://0001-include-sys-reg.h-to-get-__WORDSIZE-on-musl-libc.patch \
37*4882a593Smuzhiyun           file://0003-Fix-conflict-between-musl-libc-dirent.h-and-lss.patch \
38*4882a593Smuzhiyun           file://0001-Turn-off-sign-compare-for-musl-libc.patch \
39*4882a593Smuzhiyun           file://0003-Dont-include-stab.h.patch \
40*4882a593Smuzhiyun           file://0004-elf_reader.cc-include-sys-reg.h-to-get-__WORDSIZE-on.patch \
41*4882a593Smuzhiyun           file://mcontext.patch \
42*4882a593Smuzhiyun           file://0001-Remove-HAVE_GETCONTEXT-check-to-add-local-implementa.patch \
43*4882a593Smuzhiyun           file://0001-exception_handler.cc-Match-the-types-for-SIGSTKSZ.patch \
44*4882a593Smuzhiyun           file://0001-lss-Match-syscalls-to-match-musl.patch;patchdir=src/third_party/lss \
45*4882a593Smuzhiyun           file://mips_asm_sgidefs.patch;patchdir=src/third_party/lss \
46*4882a593Smuzhiyun           file://0001-Do-not-add-stack-pointer-to-clobber-list.patch;patchdir=src/third_party/lss \
47*4882a593Smuzhiyun"
48*4882a593SmuzhiyunS = "${WORKDIR}/git"
49*4882a593Smuzhiyun
50*4882a593SmuzhiyunCXXFLAGS += "-D_GNU_SOURCE"
51*4882a593SmuzhiyunLDFLAGS:append:libc-musl = " -lucontext"
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunCOMPATIBLE_HOST:powerpc = "null"
54*4882a593SmuzhiyunCOMPATIBLE_HOST:powerpc64 = "null"
55*4882a593SmuzhiyunCOMPATIBLE_HOST:powerpc64le = "null"
56*4882a593SmuzhiyunCOMPATIBLE_HOST:riscv64 = "null"
57*4882a593SmuzhiyunCOMPATIBLE_HOST:riscv32 = "null"
58*4882a593Smuzhiyun
59*4882a593Smuzhiyundo_install:append() {
60*4882a593Smuzhiyun        install -d ${D}${includedir}
61*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad
62*4882a593Smuzhiyun
63*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/client/linux/crash_generation
64*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/crash_generation/crash_generation_client.h  ${D}${includedir}/breakpad/client/linux/crash_generation/crash_generation_client.h
65*4882a593Smuzhiyun
66*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/client/linux/handler/
67*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/handler/exception_handler.h ${D}${includedir}/breakpad/client/linux/handler/exception_handler.h
68*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/handler/minidump_descriptor.h ${D}${includedir}/breakpad/client/linux/handler/minidump_descriptor.h
69*4882a593Smuzhiyun
70*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/client/linux/dump_writer_common
71*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/dump_writer_common/mapping_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/mapping_info.h
72*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/dump_writer_common/thread_info.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/thread_info.h
73*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/dump_writer_common/raw_context_cpu.h ${D}${includedir}/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
74*4882a593Smuzhiyun
75*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/client/linux/minidump_writer
76*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/minidump_writer/linux_dumper.h ${D}${includedir}/breakpad/client/linux/minidump_writer/linux_dumper.h
77*4882a593Smuzhiyun        install -m 0644 ${S}/src/client/linux/minidump_writer/minidump_writer.h ${D}${includedir}/breakpad/client/linux/minidump_writer/minidump_writer.h
78*4882a593Smuzhiyun
79*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/common
80*4882a593Smuzhiyun        install -m 0644 ${S}/src/common/memory_allocator.h ${D}${includedir}/breakpad/common/memory_allocator.h
81*4882a593Smuzhiyun        install -m 0644 ${S}/src/common/scoped_ptr.h ${D}${includedir}/breakpad/common/scoped_ptr.h
82*4882a593Smuzhiyun        install -m 0644 ${S}/src/common/using_std_string.h ${D}${includedir}/breakpad/common/using_std_string.h
83*4882a593Smuzhiyun
84*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/google_breakpad/common
85*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/breakpad_types.h ${D}${includedir}/breakpad/google_breakpad/common/breakpad_types.h
86*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_format.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_format.h
87*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_amd64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_amd64.h
88*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm.h
89*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_arm64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_arm64.h
90*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_mips.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_mips.h
91*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc64.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
92*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_ppc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_ppc.h
93*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_sparc.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_sparc.h
94*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_cpu_x86.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_cpu_x86.h
95*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_linux.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_linux.h
96*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_mac.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_mac.h
97*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_ps3.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_ps3.h
98*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_solaris.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_solaris.h
99*4882a593Smuzhiyun        install -m 0644 ${S}/src/google_breakpad/common/minidump_exception_win32.h ${D}${includedir}/breakpad/google_breakpad/common/minidump_exception_win32.h
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun        install -d ${D}${includedir}/breakpad/third_party/lss
102*4882a593Smuzhiyun        install -m 0644 ${S}/src/third_party/lss/linux_syscall_support.h ${D}${includedir}/breakpad/third_party/lss/linux_syscall_support.h
103*4882a593Smuzhiyun}
104*4882a593Smuzhiyun
105*4882a593SmuzhiyunPACKAGES =+ "${PN}-minidump-upload ${PN}-sym-upload"
106*4882a593Smuzhiyun
107*4882a593SmuzhiyunFILES:${PN}-minidump-upload = "${bindir}/minidump_upload"
108*4882a593SmuzhiyunFILES:${PN}-sym-upload = "${bindir}/sym_upload"
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun
111*4882a593SmuzhiyunSYSROOT_PREPROCESS_FUNCS += "breakpad_populate_sysroot"
112*4882a593Smuzhiyunbreakpad_populate_sysroot() {
113*4882a593Smuzhiyun        sysroot_stage_dir ${D}/usr/include ${SYSROOT_DESTDIR}/usr/include
114*4882a593Smuzhiyun        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
115*4882a593Smuzhiyun        sysroot_stage_dir ${D}/usr/lib ${SYSROOT_DESTDIR}/usr/lib
116*4882a593Smuzhiyun}
117*4882a593Smuzhiyun
118*4882a593Smuzhiyun# Fails to build with thumb-1 (qemuarm)
119*4882a593Smuzhiyun#| {standard input}: Assembler messages:
120*4882a593Smuzhiyun#| {standard input}:2178: Error: selected processor does not support Thumb mode `it ne'
121*4882a593Smuzhiyun#| {standard input}:2179: Error: Thumb does not support conditional execution
122*4882a593Smuzhiyun#| {standard input}:2180: Error: selected processor does not support Thumb mode `it eq'
123*4882a593Smuzhiyun#| {standard input}:2181: Error: Thumb does not support conditional execution
124*4882a593Smuzhiyun#| {standard input}:2183: Error: lo register required -- `str ip,[r1,#-4]!'
125*4882a593Smuzhiyun#| {standard input}:2184: Error: Thumb does not support this addressing mode -- `str r6,[r1,#-4]!'
126*4882a593Smuzhiyun#| {standard input}:2191: Error: lo register required -- `ldr pc,[sp]'
127*4882a593Smuzhiyun#| make: *** [src/client/linux/handler/exception_handler.o] Error 1
128*4882a593SmuzhiyunARM_INSTRUCTION_SET:armv5 = "arm"
129*4882a593SmuzhiyunARM_INSTRUCTION_SET:armv4 = "arm"
130*4882a593Smuzhiyun
131*4882a593SmuzhiyunTOOLCHAIN = "gcc"
132