Merge pull request #1845 from pullmoll/musl-webkit2gtk

webkit2gtk: unbreak musl
This commit is contained in:
Jürgen Buchmüller 2015-06-17 19:29:57 +02:00
commit d54a677f12
5 changed files with 110 additions and 1 deletions

View File

@ -0,0 +1,11 @@
--- Source/WTF/wtf/DisallowCType.h
+++ Source/WTF/wtf/DisallowCType.h
@@ -40,7 +40,7 @@
// are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h>
// or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses
// isacii().
-#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION)
+#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__)
#include <ctype.h>

View File

@ -0,0 +1,38 @@
There is no execinfo.h in musl. Disable backtrace code if
__GLIBC__ is not defined.
--- Source/WTF/wtf/Assertions.cpp
+++ Source/WTF/wtf/Assertions.cpp
@@ -71,8 +71,10 @@
#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
#include <cxxabi.h>
#include <dlfcn.h>
+#if defined(__GLIBC__)
#include <execinfo.h>
#endif
+#endif
extern "C" {
@@ -225,7 +227,7 @@
void WTFGetBacktrace(void** stack, int* size)
{
-#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__))
+#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__))
*size = backtrace(stack, *size);
#elif OS(WINDOWS)
// The CaptureStackBackTrace function is available in XP, but it is not defined
index 657ced4..ceb9c47 100644
--- Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
+++ Source/JavaScriptCore/inspector/JSGlobalObjectInspectorController.cpp
@@ -46,7 +46,9 @@
#include <cxxabi.h>
#include <dlfcn.h>
+#if defined(__GLIBC__)
#include <execinfo.h>
+#endif
#if ENABLE(REMOTE_INSPECTOR)
#include "JSGlobalObjectDebuggable.h"

View File

@ -0,0 +1,39 @@
Explicitly use std::isnan() for musl libc
--- Source/WTF/wtf/Stopwatch.h
+++ Source/WTF/wtf/Stopwatch.h
@@ -44,7 +44,7 @@
double elapsedTime();
- bool isActive() const { return !isnan(m_lastStartTime); }
+ bool isActive() const { return !std::isnan(m_lastStartTime); }
private:
Stopwatch() { reset(); }
@@ -60,14 +60,14 @@
inline void Stopwatch::start()
{
- ASSERT_WITH_MESSAGE(isnan(m_lastStartTime), "Tried to start the stopwatch, but it is already running.");
+ ASSERT_WITH_MESSAGE(std::isnan(m_lastStartTime), "Tried to start the stopwatch, but it is already running.");
m_lastStartTime = monotonicallyIncreasingTime();
}
inline void Stopwatch::stop()
{
- ASSERT_WITH_MESSAGE(!isnan(m_lastStartTime), "Tried to stop the stopwatch, but it is not running.");
+ ASSERT_WITH_MESSAGE(!std::isnan(m_lastStartTime), "Tried to stop the stopwatch, but it is not running.");
m_elapsedTime += monotonicallyIncreasingTime() - m_lastStartTime;
m_lastStartTime = NAN;
@@ -75,7 +75,7 @@
inline double Stopwatch::elapsedTime()
{
- bool shouldSuspend = !isnan(m_lastStartTime);
+ bool shouldSuspend = !std::isnan(m_lastStartTime);
if (shouldSuspend)
stop();

View File

@ -0,0 +1,15 @@
There is no malloc_trim() in musl libc
--- Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
+++ Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
@@ -206,8 +206,10 @@
void MemoryPressureHandler::platformReleaseMemory(bool)
{
+#if defined(__GLIBC__)
ReliefLogger log("Run malloc_trim");
malloc_trim(0);
+#endif
}
void MemoryPressureHandler::ReliefLogger::platformLog()

View File

@ -1,7 +1,7 @@
# Template file for 'webkit2gtk'
pkgname=webkit2gtk
version=2.8.3
revision=1
revision=2
build_style=cmake
configure_args="-DPORT=GTK -DENABLE_GTKDOC=OFF -DCMAKE_LINKER=${XBPS_CROSS_TRIPLET}-gcc"
short_desc="GTK+3 port of the WebKit2 browser engine"
@ -29,6 +29,11 @@ build_options="gir wayland x11"
build_options_default="wayland x11"
if [ -z "$CROSS_BUILD" ]; then
build_options_default+=" gir"
else
# Make cmake detect Ruby headers in cross base
configure_args+=" -DRUBY_CONFIG_INCLUDE_DIR=${XBPS_CROSS_BASE}/usr/include/ruby-2.2.0"
# Fix non-working target CPU detection
configure_args+=" -DCMAKE_SYSTEM_PROCESSOR=${XBPS_TARGET_MACHINE%-musl}"
fi
if [ "$build_option_gir" ]; then
@ -36,6 +41,7 @@ if [ "$build_option_gir" ]; then
hostmakedepends+=" gobject-introspection"
else
configure_args+=" --disable-introspection"
configure_args+=" -DENABLE_INTROSPECTION=0"
fi
if [ "$build_option_wayland" ]; then