devel/breakpad: Add port to the tree

Breakpad is a set of client and server components which implement
a crash-reporting system.
This is YET ANOTHER STEP to build Electron.io for FreeBSD.

PR:		221320
Reported by:	Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
Reviewed by:	cpm, lifanov, mat (mentor), mmokhi, ultima
Approved by:	cpm, lifanov, mat (mentor), mmokhi, ultima
Differential Revision:	https://reviews.freebsd.org/D11773
This commit is contained in:
Mahdi Mokhtari 2017-08-24 15:04:51 +00:00
parent 9a07df303c
commit 3941ebc756
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=448689
11 changed files with 356 additions and 0 deletions

View file

@ -207,6 +207,7 @@
SUBDIR += bossa
SUBDIR += bouml-doc
SUBDIR += bpython
SUBDIR += breakpad
SUBDIR += bsdbuild
SUBDIR += bsdcflow
SUBDIR += bsdowl

25
devel/breakpad/Makefile Normal file
View file

@ -0,0 +1,25 @@
# Created by: Luca Pizzamiglio <luca.pizzamiglio@gmail.com>
# $FreeBSD$
PORTNAME= breakpad
DISTVERSION= g20170811
CATEGORIES= devel
MAINTAINER= luca.pizzamiglio@gmail.com
COMMENT= Client/server based crash-reporting system
LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= autoreconf
GNU_CONFIGURE= yes
USE_GITHUB= yes
GH_ACCOUNT= google
GH_TAGNAME= 38cbbfed71efcb28931b5e4a83e3c0d4661f1548
post-extract:
@${MKDIR} ${WRKSRC}/src/third_party/lss
@${CP} ${FILESDIR}/linux_syscall_support.h ${WRKSRC}/src/third_party/lss
.include <bsd.port.mk>

3
devel/breakpad/distinfo Normal file
View file

@ -0,0 +1,3 @@
TIMESTAMP = 1502792874
SHA256 (google-breakpad-g20170811-38cbbfed71efcb28931b5e4a83e3c0d4661f1548_GH0.tar.gz) = 26d5a35d032294a9f14ad4254fee6bdfa7217a4e458ad2957e2632998c30299d
SIZE (google-breakpad-g20170811-38cbbfed71efcb28931b5e4a83e3c0d4661f1548_GH0.tar.gz) = 5256786

View file

@ -0,0 +1,115 @@
--- Makefile.am.orig 2017-07-12 17:53:15 UTC
+++ Makefile.am
@@ -69,7 +69,7 @@ dist_doc_DATA = \
README.md
## Headers
-if LINUX_HOST
+#if LINUX_HOST
includeclhdir = $(includedir)/$(PACKAGE)/client/linux/handler
includeclh_HEADERS = $(top_srcdir)/src/client/linux/handler/*.h
@@ -82,12 +82,14 @@ includeclm_HEADERS = $(top_srcdir)/src/c
includeclcdir = $(includedir)/$(PACKAGE)/client/linux/crash_generation
includeclc_HEADERS = $(top_srcdir)/src/client/linux/crash_generation/*.h
+if LINUX_HOST
includelssdir = $(includedir)/$(PACKAGE)/third_party/lss
includelss_HEADERS = $(top_srcdir)/src/third_party/lss/*.h
+endif
includecldir = $(includedir)/$(PACKAGE)/common/linux
includecl_HEADERS = $(top_srcdir)/src/common/linux/*.h
-endif
+#endif
includegbcdir = $(includedir)/$(PACKAGE)/google_breakpad/common
includegbc_HEADERS = $(top_srcdir)/src/google_breakpad/common/*.h
@@ -344,6 +346,9 @@ bin_PROGRAMS += \
src/processor/minidump_stackwalk
endif !DISABLE_PROCESSOR
+bin_PROGRAMS += \
+ src/tools/linux/dump_syms/dump_syms
+
if LINUX_HOST
EXTRA_PROGRAMS += \
src/client/linux/linux_dumper_unittest_helper
@@ -353,7 +358,6 @@ CLEANFILES += \
if !DISABLE_TOOLS
bin_PROGRAMS += \
src/tools/linux/core2md/core2md \
- src/tools/linux/dump_syms/dump_syms \
src/tools/linux/md2core/minidump-2-core \
src/tools/linux/symupload/minidump_upload \
src/tools/linux/symupload/sym_upload
@@ -448,6 +452,34 @@ else
LOG_DRIVER = $(top_srcdir)/autotools/test-driver
endif
+src_tools_linux_dump_syms_dump_syms_SOURCES = \
+ src/common/dwarf_cfi_to_module.cc \
+ src/common/dwarf_cu_to_module.cc \
+ src/common/dwarf_line_to_module.cc \
+ src/common/language.cc \
+ src/common/module.cc \
+ src/common/stabs_reader.cc \
+ src/common/stabs_to_module.cc \
+ src/common/dwarf/bytereader.cc \
+ src/common/dwarf/dwarf2diehandler.cc \
+ src/common/dwarf/dwarf2reader.cc \
+ src/common/dwarf/elf_reader.cc \
+ src/common/linux/crc32.cc \
+ src/common/linux/dump_symbols.cc \
+ src/common/linux/dump_symbols.h \
+ src/common/linux/elf_symbols_to_module.cc \
+ src/common/linux/elf_symbols_to_module.h \
+ src/common/linux/elfutils.cc \
+ src/common/linux/file_id.cc \
+ src/common/linux/linux_libc_support.cc \
+ src/common/linux/memory_mapped_file.cc \
+ src/common/linux/safe_readlink.cc \
+ src/tools/linux/dump_syms/dump_syms.cc
+src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
+ $(RUST_DEMANGLE_CFLAGS)
+src_tools_linux_dump_syms_dump_syms_LDADD = \
+ $(RUST_DEMANGLE_LIBS)
+
if LINUX_HOST
src_client_linux_linux_dumper_unittest_helper_SOURCES = \
src/client/linux/minidump_writer/linux_dumper_unittest_helper.cc
@@ -562,34 +594,6 @@ src_tools_linux_core2md_core2md_SOURCES
src_tools_linux_core2md_core2md_LDADD = \
src/client/linux/libbreakpad_client.a
-src_tools_linux_dump_syms_dump_syms_SOURCES = \
- src/common/dwarf_cfi_to_module.cc \
- src/common/dwarf_cu_to_module.cc \
- src/common/dwarf_line_to_module.cc \
- src/common/language.cc \
- src/common/module.cc \
- src/common/stabs_reader.cc \
- src/common/stabs_to_module.cc \
- src/common/dwarf/bytereader.cc \
- src/common/dwarf/dwarf2diehandler.cc \
- src/common/dwarf/dwarf2reader.cc \
- src/common/dwarf/elf_reader.cc \
- src/common/linux/crc32.cc \
- src/common/linux/dump_symbols.cc \
- src/common/linux/dump_symbols.h \
- src/common/linux/elf_symbols_to_module.cc \
- src/common/linux/elf_symbols_to_module.h \
- src/common/linux/elfutils.cc \
- src/common/linux/file_id.cc \
- src/common/linux/linux_libc_support.cc \
- src/common/linux/memory_mapped_file.cc \
- src/common/linux/safe_readlink.cc \
- src/tools/linux/dump_syms/dump_syms.cc
-src_tools_linux_dump_syms_dump_syms_CXXFLAGS = \
- $(RUST_DEMANGLE_CFLAGS)
-src_tools_linux_dump_syms_dump_syms_LDADD = \
- $(RUST_DEMANGLE_LIBS)
-
src_tools_linux_md2core_minidump_2_core_SOURCES = \
src/common/linux/memory_mapped_file.cc \
src/tools/linux/md2core/minidump-2-core.cc \

View file

@ -0,0 +1,11 @@
--- src/common/dwarf/elf_reader.cc.orig 2017-07-12 17:53:15 UTC
+++ src/common/dwarf/elf_reader.cc
@@ -56,7 +56,7 @@
#endif
// Map Linux macros to their Apple equivalents.
-#if __APPLE__
+#if __APPLE__ || __FreeBSD__
#ifndef __LITTLE_ENDIAN
#define __LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
#endif // __LITTLE_ENDIAN

View file

@ -0,0 +1,13 @@
--- src/common/linux/dump_symbols.cc.orig 2017-07-12 17:53:15 UTC
+++ src/common/linux/dump_symbols.cc
@@ -53,6 +53,10 @@
#include <utility>
#include <vector>
+#if __FreeBSD__
+#include <libgen.h>
+#endif
+
#include "common/dwarf/bytereader-inl.h"
#include "common/dwarf/dwarf2diehandler.h"
#include "common/dwarf_cfi_to_module.h"

View file

@ -0,0 +1,15 @@
--- src/common/linux/elfutils.cc.orig 2017-07-12 17:53:15 UTC
+++ src/common/linux/elfutils.cc
@@ -35,6 +35,12 @@
#include "common/linux/linux_libc_support.h"
#include "common/linux/elfutils-inl.h"
+#ifndef ElfW
+#define ElfW(type) _ElfW (Elf, __ELF_WORD_SIZE, type)
+#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
+#define _ElfW_1(e,w,t) e##w##t
+#endif
+
namespace google_breakpad {
namespace {

View file

@ -0,0 +1,15 @@
--- src/common/linux/memory_mapped_file.cc.orig 2017-07-12 17:53:15 UTC
+++ src/common/linux/memory_mapped_file.cc
@@ -65,9 +65,10 @@ bool MemoryMappedFile::Map(const char* p
}
#if defined(__x86_64__) || defined(__aarch64__) || \
- (defined(__mips__) && _MIPS_SIM == _ABI64)
+ (defined(__mips__) && _MIPS_SIM == _ABI64) || \
+ defined(__FreeBSD__)
- struct kernel_stat st;
+ struct stat st;
if (sys_fstat(fd, &st) == -1 || st.st_size < 0) {
#else
struct kernel_stat64 st;

View file

@ -0,0 +1,11 @@
--- src/common/memory.h.orig 2017-07-12 17:53:15 UTC
+++ src/common/memory.h
@@ -42,7 +42,7 @@
#include <sanitizer/msan_interface.h>
#endif
-#ifdef __APPLE__
+#if __APPLE__ || __FreeBSD__
#define sys_mmap mmap
#define sys_munmap munmap
#define MAP_ANONYMOUS MAP_ANON

4
devel/breakpad/pkg-descr Normal file
View file

@ -0,0 +1,4 @@
Breakpad is a set of client and server components which implement
a crash-reporting system.
WWW: https://github.com/google/breakpad

143
devel/breakpad/pkg-plist Normal file
View file

@ -0,0 +1,143 @@
bin/dump_syms
bin/microdump_stackwalk
bin/minidump_dump
bin/minidump_stackwalk
include/breakpad/client/linux/crash_generation/client_info.h
include/breakpad/client/linux/crash_generation/crash_generation_client.h
include/breakpad/client/linux/crash_generation/crash_generation_server.h
include/breakpad/client/linux/dump_writer_common/mapping_info.h
include/breakpad/client/linux/dump_writer_common/raw_context_cpu.h
include/breakpad/client/linux/dump_writer_common/thread_info.h
include/breakpad/client/linux/dump_writer_common/ucontext_reader.h
include/breakpad/client/linux/handler/exception_handler.h
include/breakpad/client/linux/handler/microdump_extra_info.h
include/breakpad/client/linux/handler/minidump_descriptor.h
include/breakpad/client/linux/minidump_writer/cpu_set.h
include/breakpad/client/linux/minidump_writer/directory_reader.h
include/breakpad/client/linux/minidump_writer/line_reader.h
include/breakpad/client/linux/minidump_writer/linux_core_dumper.h
include/breakpad/client/linux/minidump_writer/linux_dumper.h
include/breakpad/client/linux/minidump_writer/linux_ptrace_dumper.h
include/breakpad/client/linux/minidump_writer/minidump_writer.h
include/breakpad/client/linux/minidump_writer/minidump_writer_unittest_utils.h
include/breakpad/client/linux/minidump_writer/proc_cpuinfo_reader.h
include/breakpad/common/basictypes.h
include/breakpad/common/byte_cursor.h
include/breakpad/common/convert_UTF.h
include/breakpad/common/dwarf_cfi_to_module.h
include/breakpad/common/dwarf_cu_to_module.h
include/breakpad/common/dwarf_line_to_module.h
include/breakpad/common/language.h
include/breakpad/common/linux/crc32.h
include/breakpad/common/linux/dump_symbols.h
include/breakpad/common/linux/eintr_wrapper.h
include/breakpad/common/linux/elf_core_dump.h
include/breakpad/common/linux/elf_gnu_compat.h
include/breakpad/common/linux/elf_symbols_to_module.h
include/breakpad/common/linux/elfutils-inl.h
include/breakpad/common/linux/elfutils.h
include/breakpad/common/linux/file_id.h
include/breakpad/common/linux/google_crashdump_uploader.h
include/breakpad/common/linux/guid_creator.h
include/breakpad/common/linux/http_upload.h
include/breakpad/common/linux/ignore_ret.h
include/breakpad/common/linux/libcurl_wrapper.h
include/breakpad/common/linux/linux_libc_support.h
include/breakpad/common/linux/memory_mapped_file.h
include/breakpad/common/linux/safe_readlink.h
include/breakpad/common/linux/symbol_upload.h
include/breakpad/common/linux/synth_elf.h
include/breakpad/common/md5.h
include/breakpad/common/memory.h
include/breakpad/common/memory_range.h
include/breakpad/common/minidump_type_helper.h
include/breakpad/common/module.h
include/breakpad/common/scoped_ptr.h
include/breakpad/common/simple_string_dictionary.h
include/breakpad/common/stabs_reader.h
include/breakpad/common/stabs_to_module.h
include/breakpad/common/stdio_wrapper.h
include/breakpad/common/string_conversion.h
include/breakpad/common/symbol_data.h
include/breakpad/common/test_assembler.h
include/breakpad/common/unordered.h
include/breakpad/common/using_std_string.h
include/breakpad/google_breakpad/common/breakpad_types.h
include/breakpad/google_breakpad/common/minidump_cpu_amd64.h
include/breakpad/google_breakpad/common/minidump_cpu_arm.h
include/breakpad/google_breakpad/common/minidump_cpu_arm64.h
include/breakpad/google_breakpad/common/minidump_cpu_mips.h
include/breakpad/google_breakpad/common/minidump_cpu_ppc.h
include/breakpad/google_breakpad/common/minidump_cpu_ppc64.h
include/breakpad/google_breakpad/common/minidump_cpu_sparc.h
include/breakpad/google_breakpad/common/minidump_cpu_x86.h
include/breakpad/google_breakpad/common/minidump_exception_linux.h
include/breakpad/google_breakpad/common/minidump_exception_mac.h
include/breakpad/google_breakpad/common/minidump_exception_ps3.h
include/breakpad/google_breakpad/common/minidump_exception_solaris.h
include/breakpad/google_breakpad/common/minidump_exception_win32.h
include/breakpad/google_breakpad/common/minidump_format.h
include/breakpad/google_breakpad/common/minidump_size.h
include/breakpad/processor/address_map-inl.h
include/breakpad/processor/address_map.h
include/breakpad/processor/basic_code_module.h
include/breakpad/processor/basic_code_modules.h
include/breakpad/processor/basic_source_line_resolver_types.h
include/breakpad/processor/cfi_frame_info-inl.h
include/breakpad/processor/cfi_frame_info.h
include/breakpad/processor/contained_range_map-inl.h
include/breakpad/processor/contained_range_map.h
include/breakpad/processor/disassembler_x86.h
include/breakpad/processor/exploitability_linux.h
include/breakpad/processor/exploitability_win.h
include/breakpad/processor/fast_source_line_resolver_types.h
include/breakpad/processor/linked_ptr.h
include/breakpad/processor/logging.h
include/breakpad/processor/map_serializers-inl.h
include/breakpad/processor/map_serializers.h
include/breakpad/processor/module_comparer.h
include/breakpad/processor/module_factory.h
include/breakpad/processor/module_serializer.h
include/breakpad/processor/pathname_stripper.h
include/breakpad/processor/postfix_evaluator-inl.h
include/breakpad/processor/postfix_evaluator.h
include/breakpad/processor/range_map-inl.h
include/breakpad/processor/range_map.h
include/breakpad/processor/simple_serializer-inl.h
include/breakpad/processor/simple_serializer.h
include/breakpad/processor/simple_symbol_supplier.h
include/breakpad/processor/source_line_resolver_base_types.h
include/breakpad/processor/stackwalk_common.h
include/breakpad/processor/stackwalker_address_list.h
include/breakpad/processor/stackwalker_amd64.h
include/breakpad/processor/stackwalker_arm.h
include/breakpad/processor/stackwalker_arm64.h
include/breakpad/processor/stackwalker_mips.h
include/breakpad/processor/stackwalker_ppc.h
include/breakpad/processor/stackwalker_ppc64.h
include/breakpad/processor/stackwalker_sparc.h
include/breakpad/processor/stackwalker_unittest_utils.h
include/breakpad/processor/stackwalker_x86.h
include/breakpad/processor/static_address_map-inl.h
include/breakpad/processor/static_address_map.h
include/breakpad/processor/static_contained_range_map-inl.h
include/breakpad/processor/static_contained_range_map.h
include/breakpad/processor/static_map-inl.h
include/breakpad/processor/static_map.h
include/breakpad/processor/static_map_iterator-inl.h
include/breakpad/processor/static_map_iterator.h
include/breakpad/processor/static_range_map-inl.h
include/breakpad/processor/static_range_map.h
include/breakpad/processor/symbolic_constants_win.h
include/breakpad/processor/synth_minidump.h
include/breakpad/processor/synth_minidump_unittest_data.h
include/breakpad/processor/tokenize.h
include/breakpad/processor/windows_frame_info.h
lib/libbreakpad.a
libdata/pkgconfig/breakpad.pc
%%PORTDOCS%%%%DOCSDIR%%-0.1/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%-0.1/ChangeLog
%%PORTDOCS%%%%DOCSDIR%%-0.1/INSTALL
%%PORTDOCS%%%%DOCSDIR%%-0.1/LICENSE
%%PORTDOCS%%%%DOCSDIR%%-0.1/NEWS
%%PORTDOCS%%%%DOCSDIR%%-0.1/README.md