diff options
author | Khem Raj <raj.khem@gmail.com> | 2015-09-26 16:03:23 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-24 09:40:28 +0000 |
commit | 68da3901c9a778c30c174e85f029d27fc1c7b4ed (patch) | |
tree | 9231ac71eee1f3dd6bf8a7945651d63292c4f123 /meta/recipes-sato | |
parent | da8163504d70de66381db50e5078794a1b61dad4 (diff) | |
download | poky-68da3901c9a778c30c174e85f029d27fc1c7b4ed.tar.gz |
webkitgtk: Fix build with clang/musl
backtrace is glibc only feature on linux so check for glibc before using
it
Clangs clear_cache has different signature than gcc provided builtin
make it compatible for both
(From OE-Core rev: c3dc346d44c8c5485b3eb1a97f32ba2ed2e76ece)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-sato')
4 files changed, 128 insertions, 0 deletions
diff --git a/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch b/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch new file mode 100644 index 0000000000..d7e4ef6263 --- /dev/null +++ b/meta/recipes-sato/webkit/webkitgtk/0001-Enable-backtrace-on-linux-when-using-glibc.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From 0b68ad206d2d90df78d91cad4da19152084014cf Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 16 Sep 2015 05:15:04 +0000 | ||
4 | Subject: [PATCH] Enable backtrace on linux when using glibc | ||
5 | |||
6 | We dont have backtrace() implemented on non-glibc libc's on linux | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | --- | ||
10 | Upstream-Status: Accepted | ||
11 | |||
12 | Source/WTF/wtf/Assertions.cpp | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/Source/WTF/wtf/Assertions.cpp b/Source/WTF/wtf/Assertions.cpp | ||
16 | index 191d53f..a4d86b5 100644 | ||
17 | --- a/Source/WTF/wtf/Assertions.cpp | ||
18 | +++ b/Source/WTF/wtf/Assertions.cpp | ||
19 | @@ -68,7 +68,7 @@ | ||
20 | #include <unistd.h> | ||
21 | #endif | ||
22 | |||
23 | -#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__)) | ||
24 | +#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) | ||
25 | #include <cxxabi.h> | ||
26 | #include <dlfcn.h> | ||
27 | #include <execinfo.h> | ||
28 | @@ -225,7 +225,7 @@ void WTFReportArgumentAssertionFailure(const char* file, int line, const char* f | ||
29 | |||
30 | void WTFGetBacktrace(void** stack, int* size) | ||
31 | { | ||
32 | -#if OS(DARWIN) || (OS(LINUX) && !defined(__UCLIBC__)) | ||
33 | +#if OS(DARWIN) || (OS(LINUX) && defined(__GLIBC__) && !defined(__UCLIBC__)) | ||
34 | *size = backtrace(stack, *size); | ||
35 | #elif OS(WINDOWS) | ||
36 | // The CaptureStackBackTrace function is available in XP, but it is not defined | ||
37 | -- | ||
38 | 2.5.2 | ||
39 | |||
diff --git a/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch b/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch new file mode 100644 index 0000000000..77ebf37efa --- /dev/null +++ b/meta/recipes-sato/webkit/webkitgtk/0001-Fix-build-with-non-glibc-libraries-on-linux.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 30e2ef302a329850ba55c7c458c98cbf396186ec Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 31 Dec 2015 21:47:34 +0000 | ||
4 | Subject: [PATCH] Fix build with non-glibc libraries on linux | ||
5 | |||
6 | qualify isnan() calls with std namespace | ||
7 | malloc_trim is glibc specific API so guard it with __GLIBC__ | ||
8 | let ctype be used on non-glibc ( musl ) C library | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | Upstream-Status: Accepted | ||
13 | |||
14 | Source/JavaScriptCore/runtime/Options.cpp | 2 +- | ||
15 | Source/WTF/wtf/DisallowCType.h | 2 +- | ||
16 | Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | 2 ++ | ||
17 | 3 files changed, 4 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/Source/JavaScriptCore/runtime/Options.cpp b/Source/JavaScriptCore/runtime/Options.cpp | ||
20 | index fe830b4..c49aade 100644 | ||
21 | --- a/Source/JavaScriptCore/runtime/Options.cpp | ||
22 | +++ b/Source/JavaScriptCore/runtime/Options.cpp | ||
23 | @@ -610,7 +610,7 @@ bool Option::operator==(const Option& other) const | ||
24 | case Options::Type::unsignedType: | ||
25 | return m_entry.unsignedVal == other.m_entry.unsignedVal; | ||
26 | case Options::Type::doubleType: | ||
27 | - return (m_entry.doubleVal == other.m_entry.doubleVal) || (isnan(m_entry.doubleVal) && isnan(other.m_entry.doubleVal)); | ||
28 | + return (m_entry.doubleVal == other.m_entry.doubleVal) || (std::isnan(m_entry.doubleVal) && std::isnan(other.m_entry.doubleVal)); | ||
29 | case Options::Type::int32Type: | ||
30 | return m_entry.int32Val == other.m_entry.int32Val; | ||
31 | case Options::Type::optionRangeType: | ||
32 | diff --git a/Source/WTF/wtf/DisallowCType.h b/Source/WTF/wtf/DisallowCType.h | ||
33 | index d85e767..dc6bcab 100644 | ||
34 | --- a/Source/WTF/wtf/DisallowCType.h | ||
35 | +++ b/Source/WTF/wtf/DisallowCType.h | ||
36 | @@ -40,7 +40,7 @@ | ||
37 | // are used from wx headers. On GTK+ for Mac many GTK+ files include <libintl.h> | ||
38 | // or <glib/gi18n-lib.h>, which in turn include <xlocale/_ctype.h> which uses | ||
39 | // isacii(). | ||
40 | -#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) | ||
41 | +#if !(OS(DARWIN) && PLATFORM(GTK)) && !PLATFORM(EFL) && !defined(_LIBCPP_VERSION) && defined(__GLIBC__) | ||
42 | |||
43 | #include <ctype.h> | ||
44 | |||
45 | diff --git a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | ||
46 | index ea61909..1495642 100644 | ||
47 | --- a/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | ||
48 | +++ b/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp | ||
49 | @@ -202,7 +202,9 @@ void MemoryPressureHandler::respondToMemoryPressure(Critical critical, Synchrono | ||
50 | void MemoryPressureHandler::platformReleaseMemory(Critical) | ||
51 | { | ||
52 | ReliefLogger log("Run malloc_trim"); | ||
53 | +#ifdef __GLIBC__ | ||
54 | malloc_trim(0); | ||
55 | +#endif | ||
56 | } | ||
57 | |||
58 | void MemoryPressureHandler::ReliefLogger::platformLog() | ||
59 | -- | ||
60 | 2.6.4 | ||
61 | |||
diff --git a/meta/recipes-sato/webkit/webkitgtk/clang.patch b/meta/recipes-sato/webkit/webkitgtk/clang.patch new file mode 100644 index 0000000000..e5267138bf --- /dev/null +++ b/meta/recipes-sato/webkit/webkitgtk/clang.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Clang's builtin for clear_cache accepts char* and errors out when using void*, | ||
2 | using char* work on both gcc and clang since char* is auto-converted to void* in gcc case | ||
3 | |||
4 | Source/JavaScriptCore/assembler/ARM64Assembler.h:2857:33: error: cannot initialize a parameter of type 'char *' with an rvalue of type 'void *' | ||
5 | __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end)); | ||
6 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
7 | 1 error generated. | ||
8 | |||
9 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
10 | |||
11 | Upstream-Status: Accepted | ||
12 | |||
13 | Index: webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h | ||
14 | =================================================================== | ||
15 | --- webkitgtk-2.8.5.orig/Source/JavaScriptCore/assembler/ARM64Assembler.h | ||
16 | +++ webkitgtk-2.8.5/Source/JavaScriptCore/assembler/ARM64Assembler.h | ||
17 | @@ -2854,7 +2854,7 @@ public: | ||
18 | #if OS(LINUX) && COMPILER(GCC) | ||
19 | static inline void linuxPageFlush(uintptr_t begin, uintptr_t end) | ||
20 | { | ||
21 | - __builtin___clear_cache(reinterpret_cast<void*>(begin), reinterpret_cast<void*>(end)); | ||
22 | + __builtin___clear_cache(reinterpret_cast<char*>(begin), reinterpret_cast<char*>(end)); | ||
23 | } | ||
24 | #endif | ||
25 | |||
diff --git a/meta/recipes-sato/webkit/webkitgtk_2.10.4.bb b/meta/recipes-sato/webkit/webkitgtk_2.10.4.bb index 4d5aeb48eb..098bbbbeef 100644 --- a/meta/recipes-sato/webkit/webkitgtk_2.10.4.bb +++ b/meta/recipes-sato/webkit/webkitgtk_2.10.4.bb | |||
@@ -12,6 +12,9 @@ LIC_FILES_CHKSUM = "file://Source/JavaScriptCore/COPYING.LIB;md5=d0c6d6397a5d842 | |||
12 | 12 | ||
13 | SRC_URI = "\ | 13 | SRC_URI = "\ |
14 | http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \ | 14 | http://www.webkitgtk.org/releases/${BPN}-${PV}.tar.xz \ |
15 | file://clang.patch \ | ||
16 | file://0001-Enable-backtrace-on-linux-when-using-glibc.patch \ | ||
17 | file://0001-Fix-build-with-non-glibc-libraries-on-linux.patch \ | ||
15 | " | 18 | " |
16 | SRC_URI[md5sum] = "fb010031c6f61c3a1a00793b112badb5" | 19 | SRC_URI[md5sum] = "fb010031c6f61c3a1a00793b112badb5" |
17 | SRC_URI[sha256sum] = "dbf8260da5cac0c74de2d3cce1fe7c519da3cd816a2c769cb6c6d56addd2f055" | 20 | SRC_URI[sha256sum] = "dbf8260da5cac0c74de2d3cce1fe7c519da3cd816a2c769cb6c6d56addd2f055" |