[Bf-blender-cvs] [07e497db295] fracture_modifier: backported existing crashpad support (win, mac, needs testing) and added breakpad support (linux)

Martin Felke noreply at git.blender.org
Sat Sep 8 02:01:20 CEST 2018


Commit: 07e497db295ebd5bd09eb07c6d2d8aebc7499c65
Author: Martin Felke
Date:   Sat Sep 8 02:00:56 2018 +0200
Branches: fracture_modifier
https://developer.blender.org/rB07e497db295ebd5bd09eb07c6d2d8aebc7499c65

backported existing crashpad support (win, mac, needs testing) and added breakpad support (linux)

===================================================================

M	CMakeLists.txt
M	build_files/build_environment/CMakeLists.txt
A	build_files/build_environment/cmake/breakpad.cmake
M	build_files/build_environment/cmake/harvest.cmake
M	build_files/build_environment/cmake/versions.cmake
A	build_files/build_environment/patches/breakpad.diff
M	build_files/cmake/macros.cmake
M	build_files/cmake/platform/platform_apple.cmake
M	build_files/cmake/platform/platform_unix.cmake
M	build_files/cmake/platform/platform_win32_msvc.cmake
M	source/creator/CMakeLists.txt
M	source/creator/creator.c
A	source/creator/creator_breakpad_linux.cpp
A	source/creator/creator_crashpad_apple.cpp
A	source/creator/creator_crashpad_win.cpp
M	source/creator/creator_intern.h
M	source/creator/creator_signals.c

===================================================================

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6d055fe4f0a..933e3178be0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -376,6 +376,13 @@ mark_as_advanced(WITH_SYSTEM_GLOG)
 # Freestyle
 option(WITH_FREESTYLE     "Enable Freestyle (advanced edges rendering)" ON)
 
+# Crashpad / Breakpad
+option(WITH_CRASHPAD     "Enable crashpad or breakpad (crash reporting)" OFF)
+set(CRASHPAD_URL         "http://127.0.0.1:1234" CACHE STRING "URL to report crash reports to")
+
+mark_as_advanced(WITH_CRASHPAD)
+mark_as_advanced(CRASHPAD_URL)
+
 # Misc
 if(WIN32)
 	option(WITH_INPUT_IME "Enable Input Method Editor (IME) for complex Asian character input" ON)
diff --git a/build_files/build_environment/CMakeLists.txt b/build_files/build_environment/CMakeLists.txt
index f177560c5f6..89d4a9882ca 100644
--- a/build_files/build_environment/CMakeLists.txt
+++ b/build_files/build_environment/CMakeLists.txt
@@ -45,6 +45,11 @@ cmake_minimum_required(VERSION 3.5)
 include(ExternalProject)
 include(cmake/options.cmake)
 include(cmake/versions.cmake)
+
+if(UNIX AND NOT APPLE)
+	include(cmake/breakpad.cmake)
+endif()
+
 include(cmake/zlib.cmake)
 include(cmake/blendthumb.cmake)
 include(cmake/openal.cmake)
diff --git a/build_files/build_environment/cmake/breakpad.cmake b/build_files/build_environment/cmake/breakpad.cmake
new file mode 100644
index 00000000000..d32d2b6aa84
--- /dev/null
+++ b/build_files/build_environment/cmake/breakpad.cmake
@@ -0,0 +1,49 @@
+# ***** BEGIN GPL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ***** END GPL LICENSE BLOCK *****
+
+ExternalProject_Add(external_breakpad
+	GIT_REPOSITORY ${BREAKPAD_URI}
+	DOWNLOAD_DIR ${DOWNLOAD_DIR}
+	URL_HASH MD5=${BREAKPAD_MD5}
+	PREFIX ${BUILD_DIR}/breakpad
+	PATCH_COMMAND ${PATCH_CMD} -p 1 -d ${BUILD_DIR}/breakpad/src/external_breakpad < ${PATCH_DIR}/breakpad.diff
+	UPDATE_COMMAND git -c user.name=test -c user.email=test at test.test stash create
+	CONFIGURE_COMMAND ${CONFIGURE_ENV} && ${BREAKPAD_ENV} cd ${BUILD_DIR}/breakpad/src/external_breakpad/ && aclocal && automake && ${CONFIGURE_COMMAND} --prefix=${LIBDIR}/breakpad
+	BUILD_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/breakpad/src/external_breakpad/ && make -j${MAKE_THREADS}
+	INSTALL_COMMAND ${CONFIGURE_ENV} && cd ${BUILD_DIR}/breakpad/src/external_breakpad/ && make install
+	#INSTALL_DIR ${LIBDIR}/breakpad
+)
+
+#the new file is included in the breakpad.diff now
+
+#set(LSS_URI https://chromium.googlesource.com/linux-syscall-support)
+#set(LSS_HARVEST_COMMAND
+#	cd ${BUILD_DIR} && 
+#	git clone ${LSS_URI} && 
+#	mkdir ${BUILD_DIR}/breakpad/src/external_breakpad/src/third_party/lss &&
+#	cp ${BUILD_DIR}/linux-syscall-support/linux_syscall_support.h ${BUILD_DIR}/breakpad/src/external_breakpad/src/third_party/lss/linux_syscall_support.h)
+
+#set(GIT_ENVIRONMENT COMMAND
+#	export GIT_COMMITTER_NAME="Test" && 
+#	export GIT_COMMITTER_EMAIL="test at test.test")
+
+#ExternalProject_Add_Step(external_breakpad after_patch    
+#	#COMMAND ${LSS_HARVEST_COMMAND}
+#	COMMAND ${GIT_ENVIRONMENT}
+#	DEPENDEES patch #mkdir update patch download configure build install
+#)
diff --git a/build_files/build_environment/cmake/harvest.cmake b/build_files/build_environment/cmake/harvest.cmake
index f76723ca3ce..74898af608b 100644
--- a/build_files/build_environment/cmake/harvest.cmake
+++ b/build_files/build_environment/cmake/harvest.cmake
@@ -227,6 +227,9 @@ harvest(ogg/lib ffmpeg/lib "*.a")
 harvest(openal/include openal/include "*.h")
 if(UNIX AND NOT APPLE)
 	harvest(openal/lib openal/lib "*.a")
+	harvest(breakpad/lib breakpad/lib "*.a")
+	harvest(breakpad/include/breakpad breakpad/include "*.h")
+	harvest(breakpad/bin breakpad/bin "*")
 endif()
 harvest(opencollada/include/opencollada opencollada/include "*.h")
 harvest(opencollada/lib/opencollada opencollada/lib "*.a")
diff --git a/build_files/build_environment/cmake/versions.cmake b/build_files/build_environment/cmake/versions.cmake
index c02c6871440..3aa1d4d0cac 100644
--- a/build_files/build_environment/cmake/versions.cmake
+++ b/build_files/build_environment/cmake/versions.cmake
@@ -16,6 +16,8 @@
 #
 # ***** END GPL LICENSE BLOCK *****
 
+set(BREAKPAD_URI https://chromium.googlesource.com/breakpad/breakpad)
+
 set(ZLIB_VERSION 1.2.8)
 set(ZLIB_URI https://netcologne.dl.sourceforge.net/project/libpng/zlib/${ZLIB_VERSION}/zlib-${ZLIB_VERSION}.tar.gz)
 set(ZLIB_HASH 44d667c142d7cda120332623eab69f40)
@@ -34,6 +36,8 @@ set(JPEG_HASH f9804884c1c41eb7f4febb9353a2cb27)
 
 set(BOOST_VERSION 1.60.0)
 set(BOOST_VERSION_NODOTS 1_60_0)
+#set(BOOST_URI https://dl.bintray.com/boostorg/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_NODOTS}.tar.gz)
+#set(BOOST_MD5 5d8b4503582fffa9eefdb9045359c239)
 set(BOOST_URI http://sourceforge.net/projects/boost/files/boost/${BOOST_VERSION}/boost_${BOOST_VERSION_NODOTS}.tar.bz2/download)
 set(BOOST_MD5 65a840e1a0b13a558ff19eeb2c4f0cbe)
 
@@ -104,11 +108,14 @@ set(OPENCOLORIO_URI https://github.com/imageworks/OpenColorIO/archive/6de971097c
 set(OPENCOLORIO_HASH c9de0fd98f26ce6f2e08d617ca68b8e4)
 
 set(LLVM_VERSION 3.4.2)
-set(LLVM_URI http://releases.llvm.org/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz)
+#set(LLVM_VERSION 6.0.1)
+set(LLVM_URI http://releases.llvm.org/${LLVM_VERSION}/llvm-${LLVM_VERSION}.src.tar.gz) #3.4.2 uses tar.gz, same with clang
 set(LLVM_HASH a20669f75967440de949ac3b1bad439c)
+#set(LLVM_HASH c88c98709300ce2c285391f387fecce0)
 
 set(CLANG_URI http://releases.llvm.org/${LLVM_VERSION}/cfe-${LLVM_VERSION}.src.tar.gz)
 set(CLANG_HASH 87945973b7c73038871c5f849a818588)
+#set(CLANG_HASH 4e419bd4e3b55aa06d872320f754bd85)
 
 set(OPENIMAGEIO_VERSION 1.7.15)
 set(OPENIMAGEIO_URI https://github.com/OpenImageIO/oiio/archive/Release-${OPENIMAGEIO_VERSION}.zip)
@@ -128,8 +135,10 @@ set(FLEXBISON_URI http://prdownloads.sourceforge.net/winflexbison//win_flex_biso
 set(FLEXBISON_HASH d87a3938194520d904013abef3df10ce)
 
 set(OSL_VERSION 1.7.5)
+#set(OSL_VERSION 1.9.9)
 set(OSL_URI https://github.com/imageworks/OpenShadingLanguage/archive/Release-${OSL_VERSION}.zip)
 set(OSL_HASH 6924dd5d453159e7b6eb106a08c358cf)
+#set(OSL_HASH 1c34112d8f3cf81f2fc415424bd38ae8)
 
 set(PYTHON_VERSION 3.5.3)
 set(PYTHON_SHORT_VERSION 3.5)
diff --git a/build_files/build_environment/patches/breakpad.diff b/build_files/build_environment/patches/breakpad.diff
new file mode 100644
index 00000000000..d75a44e912d
--- /dev/null
+++ b/build_files/build_environment/patches/breakpad.diff
@@ -0,0 +1,4710 @@
+diff --git a/Makefile.am b/Makefile.am
+index 649db2f3..9479a32f 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -185,7 +185,10 @@ src_client_linux_libbreakpad_client_a_SOURCES = \
+ 	src/common/linux/guid_creator.h \
+ 	src/common/linux/linux_libc_support.cc \
+ 	src/common/linux/memory_mapped_file.cc \
+-	src/common/linux/safe_readlink.cc
++	src/common/linux/safe_readlink.cc \
++	src/common/linux/http_upload.cc \
++	src/common/linux/http_upload.h
++
+ if ANDROID_HOST
+ src_client_linux_libbreakpad_client_a_SOURCES += \
+ 	src/common/android/breakpad_getcontext.S
+diff --git a/src/common/convert_UTF.c b/src/common/convert_UTF.c
+index 12a3c891..a4462027 100644
+--- a/src/common/convert_UTF.c
++++ b/src/common/convert_UTF.c
+@@ -79,7 +79,7 @@ static const UTF32 halfMask = 0x3FFUL;
+ 
+ /* --------------------------------------------------------------------- */
+ 
+-ConversionResult ConvertUTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd,
++ConversionResult Convert_UTF32toUTF16 (const UTF32** sourceStart, const UTF32* sourceEnd,
+                                       UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags) {
+   ConversionResult result = conversionOK;
+   const UTF32* source = *sourceStart;
+@@ -127,7 +127,7 @@ return result;
+ 
+ /* --------------------------------------------------------------------- */
+ 
+-ConversionResult ConvertUTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd,
++ConversionResult Convert_UTF16toUTF32 (const UTF16** sourceStart, const UTF16* sourceEnd,
+                                       UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags) {
+   ConversionResult result = conversionOK;
+   const UTF16* source = *sourceStart;
+@@ -230,7 +230,7 @@ static const UTF8 firstByteMark[7] = { 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC
+ 
+ /* --------------------------------------------------------------------- */
+ 
+-ConversionResult ConvertUTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd,
++ConversionResult Convert_UTF16toUTF8 (const UTF16** sourceStart, const UTF16* sourceEnd,
+                                      UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags) {
+   ConversionResult result = conversionOK;
+   const UTF16* source = *sourceStart;
+@@ -341,7 +341,7 @@ static Boolean isLegalUTF8(const UTF8 *source, int length) {
+  * Exported function to return whether a UTF-8 sequence is legal or not.
+  * This is not used here; it's just exported.
+  */
+-Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
++Boolean isLegal_UTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+   int length = trailingBytesForUTF8[*source]+1;
+   if (source+length > sourceEnd) {
+     return false;
+@@ -351,7 +351,7 @@ Boolean isLegalUTF8Sequence(const UTF8 *source, const UTF8 *sourceEnd) {
+ 
+ /* --------------------------------------------------------------------- */
+ 
+-ConversionResult ConvertUTF8toUTF16 (const UTF8** sourceStart, const UTF8* sourceEnd,
++ConversionResult Convert_UTF8toUTF16 (const UTF8** sou

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list