Files
meta-musicians/recipes-musicians/distrho/distrho-ports/0001-Fix-build-with-musl-by-removing-unused-SystemStats-g.patch
Andreas Müller 771dc79d01 distrho-ports: upgrade to latest master
* Least hacky musl patch was applied
* Filipe fixed cross build for pitchedDelay [1]
* GCC 9 patch was applied

[1] 014a55aa40

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
2019-10-09 00:23:27 +02:00

135 lines
4.8 KiB
Diff

From 1a4c189c7c5778951edc57f2840889629ce81135 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
Date: Wed, 3 Apr 2019 23:38:30 +0200
Subject: [PATCH] Fix build with musl by removing unused
SystemStats::getStackBacktrace
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Musl [1] considers itself as the pure POSIX incarnation and unfortunately
there are people liking it.
Since execinfo.h is not part of POSIX but a GNU header [2], musl fails with
| ../source/modules/juce_core/juce_core.cpp:98:12: fatal error: execinfo.h: No such file or directory
| #include <execinfo.h>
| ^~~~~~~~~~~~
| compilation terminated.
Removing SystemStats::getStackBacktrace does not cause any harm because it is
not used.
I am aware that there might be an update of JUCE or other prugins using
getStackBacktrace in the future but till then musl fan boys are happy.
Upstream-Status: Submitted [3]
[1] https://www.musl-libc.org/
[2] https://www.gnu.org/software/gnulib/manual/html_node/execinfo_002eh.html
[3] https://github.com/DISTRHO/DISTRHO-Ports/pull/31
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
.../source/modules/juce_core/juce_core.cpp | 3 --
.../juce_core/system/juce_SystemStats.cpp | 52 -------------------
.../juce_core/system/juce_SystemStats.h | 6 ---
3 files changed, 61 deletions(-)
diff --git a/libs/juce/source/modules/juce_core/juce_core.cpp b/libs/juce/source/modules/juce_core/juce_core.cpp
index 136dd284..06c7d17f 100644
--- a/libs/juce/source/modules/juce_core/juce_core.cpp
+++ b/libs/juce/source/modules/juce_core/juce_core.cpp
@@ -94,9 +94,6 @@
#include <net/if.h>
#include <sys/ioctl.h>
- #if ! JUCE_ANDROID
- #include <execinfo.h>
- #endif
#endif
#if JUCE_MAC || JUCE_IOS
diff --git a/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp b/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp
index c073331b..6f814213 100644
--- a/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp
+++ b/libs/juce/source/modules/juce_core/system/juce_SystemStats.cpp
@@ -118,58 +118,6 @@ bool SystemStats::hasAVX2() noexcept { return getCPUInformation().has
bool SystemStats::hasNeon() noexcept { return getCPUInformation().hasNeon; }
-//==============================================================================
-String SystemStats::getStackBacktrace()
-{
- String result;
-
- #if JUCE_ANDROID || JUCE_MINGW
- jassertfalse; // sorry, not implemented yet!
-
- #elif JUCE_WINDOWS
- HANDLE process = GetCurrentProcess();
- SymInitialize (process, nullptr, TRUE);
-
- void* stack[128];
- int frames = (int) CaptureStackBackTrace (0, numElementsInArray (stack), stack, nullptr);
-
- HeapBlock<SYMBOL_INFO> symbol;
- symbol.calloc (sizeof (SYMBOL_INFO) + 256, 1);
- symbol->MaxNameLen = 255;
- symbol->SizeOfStruct = sizeof (SYMBOL_INFO);
-
- for (int i = 0; i < frames; ++i)
- {
- DWORD64 displacement = 0;
-
- if (SymFromAddr (process, (DWORD64) stack[i], &displacement, symbol))
- {
- result << i << ": ";
-
- IMAGEHLP_MODULE64 moduleInfo;
- zerostruct (moduleInfo);
- moduleInfo.SizeOfStruct = sizeof (moduleInfo);
-
- if (::SymGetModuleInfo64 (process, symbol->ModBase, &moduleInfo))
- result << moduleInfo.ModuleName << ": ";
-
- result << symbol->Name << " + 0x" << String::toHexString ((int64) displacement) << newLine;
- }
- }
-
- #else
- void* stack[128];
- int frames = backtrace (stack, numElementsInArray (stack));
- char** frameStrings = backtrace_symbols (stack, frames);
-
- for (int i = 0; i < frames; ++i)
- result << frameStrings[i] << newLine;
-
- ::free (frameStrings);
- #endif
-
- return result;
-}
//==============================================================================
static SystemStats::CrashHandlerFunction globalCrashHandler = nullptr;
diff --git a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h
index 89d3854e..a99d830a 100644
--- a/libs/juce/source/modules/juce_core/system/juce_SystemStats.h
+++ b/libs/juce/source/modules/juce_core/system/juce_SystemStats.h
@@ -186,12 +186,6 @@ public:
static int getPageSize();
//==============================================================================
- /** Returns a backtrace of the current call-stack.
- The usefulness of the result will depend on the level of debug symbols
- that are available in the executable.
- */
- static String getStackBacktrace();
-
/** A function type for use in setApplicationCrashHandler(). The parameter will contain
platform-specific data about the crash.
*/
--
2.20.1