freecad: fix musl build (patch usage of execinfo)

Closes: #13615 [via git-merge-pr]
Signed-off-by: Jürgen Buchmüller <pullmoll@t-online.de>
This commit is contained in:
Piraty 2018-04-19 11:15:37 +02:00 committed by Jürgen Buchmüller
parent 8a0faaa961
commit e91be7be35
No known key found for this signature in database
GPG key ID: 6764EC32352D0647
3 changed files with 61 additions and 5 deletions

View file

@ -0,0 +1,30 @@
--- src/App/Application.cpp
+++ src/App/Application.cpp
@@ -1063,7 +1063,9 @@
#endif
#if defined(FC_OS_LINUX)
+#ifdef __GLIBC__
#include <execinfo.h>
+#endif
#include <dlfcn.h>
#include <cxxabi.h>
@@ -1075,6 +1077,7 @@
// This function produces a stack backtrace with demangled function & method names.
void printBacktrace(size_t skip=0)
{
+#ifdef __GLIBC__
void *callstack[128];
size_t nMaxFrames = sizeof(callstack) / sizeof(callstack[0]);
size_t nFrames = backtrace(callstack, nMaxFrames);
@@ -1105,6 +1108,9 @@
}
free(symbols);
+#else
+ std::cerr << "sorry, no backtrace on musl libc";
+#endif
}
#endif

View file

@ -0,0 +1,30 @@
--- src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp
+++ src/3rdParty/salomesmesh/src/DriverSTL/Basics_Utils.cpp
@@ -29,7 +29,9 @@
#ifndef WIN32
#include <unistd.h>
#include <sys/stat.h>
+#ifdef __GLIBC__
#include <execinfo.h>
+#endif
#endif
@@ -109,6 +111,7 @@
#ifndef WIN32
void print_traceback()
{
+#ifdef __GLIBC__
void *array[50];
size_t size;
char **strings;
@@ -123,6 +126,9 @@
}
free (strings);
+#else
+ std::cerr << "sorry, no backtrace on musl libc";
+#endif
}
#else
#if (_MSC_VER >= 1400) // Visual Studio 2005

View file

@ -5,7 +5,7 @@
# - python3: freecad code not yet ready for it, probably at 0.18
pkgname=freecad
version=0.17
revision=1
revision=2
wrksrc="FreeCAD-${version}"
build_style=cmake
@ -34,10 +34,6 @@ homepage="https://freecadweb.org/"
distfiles="https://github.com/FreeCAD/FreeCAD/archive/${version}.tar.gz"
checksum=ae017393476b6dc7f1192bcaf91ceedc2f9b791f2495307ce7c45efadb5266fb
case "$XBPS_TARGET_MACHINE" in
*-musl) broken="https://build.voidlinux.eu/builders/x86_64-musl_builder/builds/9439/steps/shell_3/logs/stdio";;
esac
post_install() {
# AppHomePath is computed with binary's realpath:
# do not move binaries but symlink them instead.