aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/musl-libc++.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-08-08 13:34:16 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2017-09-15 13:37:11 +0000
commitd183e852a762296b473c33e9ce106f52a4359dae (patch)
tree2f92f891d7ff1fc4b4aa0551bd7b28218b30b9d3 /community/chromium/musl-libc++.patch
parent0d4667363c89e53a83538d90acdc612739d061db (diff)
downloadaports-d183e852a762296b473c33e9ce106f52a4359dae.tar.bz2
aports-d183e852a762296b473c33e9ce106f52a4359dae.tar.xz
community/chromium: upgrade to 61.0.3163.79
to fix tab crashes, use patch from https://github.com/lluixhi/musl-extras/issues/10#issuecomment-328272349 use various patches from fedora
Diffstat (limited to 'community/chromium/musl-libc++.patch')
-rw-r--r--community/chromium/musl-libc++.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/community/chromium/musl-libc++.patch b/community/chromium/musl-libc++.patch
new file mode 100644
index 0000000000..7f179331d0
--- /dev/null
+++ b/community/chromium/musl-libc++.patch
@@ -0,0 +1,68 @@
+diff --git a/buildtools/third_party/libc++/trunk/include/locale b/buildtools/third_party/libc++/trunk/include/locale
+index d29a2dc..53998bc 100644
+--- buildtools/third_party/libc++/trunk/include/locale
++++ buildtools/third_party/libc++/trunk/include/locale
+@@ -11,6 +11,15 @@
+ #ifndef _LIBCPP_LOCALE
+ #define _LIBCPP_LOCALE
+
++// musl doesn't define _l (with locale) variants of functions, as it only supports UTF-8.
++// we can simply make macros that will call the non-localated ones if we're using musl, or rather not-using something that has the _l ones.
++// couldn't find anything glibc #defines when it creates strtoull_l (that it doesn't undefine a few lines later), so let's test against glibc and glibc-likes.
++// almost all glibc-likes define __GNU_LIBRARY__ for compatibility
++#ifndef __GNU_LIBRARY__
++#define strtoull_l(A, B, C, LOC) strtoull(A,B,C)
++#define strtoll_l(A, B, C, LOC) strtoll(A,B,C)
++#endif
++
+ /*
+ locale synopsis
+
+diff --git a/buildtools/third_party/libc++/trunk/src/locale.cpp b/buildtools/third_party/libc++/trunk/src/locale.cpp
+index 4163c2c..3d1902a 100644
+--- a/buildtools/third_party/libc++/trunk/src/locale.cpp
++++ buildtools/third_party/libc++/trunk/src/locale.cpp
+@@ -1028,11 +1028,11 @@ ctype<char>::do_narrow(const char_type* low, const char_type* high, char dfault,
+ return low;
+ }
+
+-#if defined(__EMSCRIPTEN__)
++//#if defined(__EMSCRIPTEN__)
+ extern "C" const unsigned short ** __ctype_b_loc();
+ extern "C" const int ** __ctype_tolower_loc();
+ extern "C" const int ** __ctype_toupper_loc();
+-#endif
++//#endif
+
+ #ifdef _LIBCPP_PROVIDES_DEFAULT_RUNE_TABLE
+ const ctype<char>::mask*
+@@ -1136,12 +1136,10 @@ ctype<char>::classic_table() _NOEXCEPT
+ #elif defined(_AIX)
+ return (const unsigned int *)__lc_ctype_ptr->obj->mask;
+ #else
+- // Platform not supported: abort so the person doing the port knows what to
+- // fix
+-# warning ctype<char>::classic_table() is not implemented
+- printf("ctype<char>::classic_table() is not implemented\n");
+- abort();
+- return NULL;
++// not sure any other libc like this exists, but there is no way to differentiate musl as of right now
++// to be fair, with the change above, this should always work
++// also, #warning is a gcc extension
++ return (const unsigned long *)*__ctype_b_loc();
+ #endif
+ }
+ #endif
+diff --git a/buildtools/third_party/libc++/trunk/src/system_error.cpp b/buildtools/third_party/libc++/trunk/src/system_error.cpp
+index cbbbb5d..8761e65 100644
+--- buildtools/third_party/libc++/trunk/src/system_error.cpp
++++ buildtools/third_party/libc++/trunk/src/system_error.cpp
+@@ -73,7 +73,7 @@ string do_strerror_r(int ev) {
+ std::snprintf(buffer, strerror_buff_size, "unknown error %d", ev);
+ return string(buffer);
+ }
+-#elif defined(__linux__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \
++#elif defined(__GLIBC__) && !defined(_LIBCPP_HAS_MUSL_LIBC) && \
+ (!defined(__ANDROID__) || __ANDROID_API__ >= 23)
+ // GNU Extended version
+ string do_strerror_r(int ev) {