You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
182 lines
5.6 KiB
182 lines
5.6 KiB
diff -ur qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/process/memory_linux.cc qtwebengine-opensource-src-5.9.0-qtbug-61521/src/3rdparty/chromium/base/process/memory_linux.cc
|
|
--- qtwebengine-opensource-src-5.9.0/src/3rdparty/chromium/base/process/memory_linux.cc 2017-05-18 16:51:44.000000000 +0200
|
|
+++ qtwebengine-opensource-src-5.9.0-qtbug-61521/src/3rdparty/chromium/base/process/memory_linux.cc 2017-06-26 23:15:31.499258482 +0200
|
|
@@ -60,6 +60,7 @@
|
|
#endif
|
|
void* __libc_memalign(size_t alignment, size_t size);
|
|
|
|
+if !defined(TOOLKIT_QT) //QTBUG-61521,QTBUG-60565
|
|
// Overriding the system memory allocation functions:
|
|
//
|
|
// For security reasons, we want malloc failures to be fatal. Too much code
|
|
@@ -129,6 +130,7 @@
|
|
*ptr = memalign(alignment, size);
|
|
return 0;
|
|
}
|
|
+#endif // TOOLKIT_QT
|
|
|
|
} // extern C
|
|
|
|
diff -ur qtwebengine-opensource-src-5.9.0/src/core/api/qtbug-60565.cpp qtwebengine-opensource-src-5.9.0-qtbug-61521/src/core/api/qtbug-60565.cpp
|
|
--- qtwebengine-opensource-src-5.9.0/src/core/api/qtbug-60565.cpp 2017-05-19 06:22:04.000000000 +0200
|
|
+++ qtwebengine-opensource-src-5.9.0-qtbug-61521/src/core/api/qtbug-60565.cpp 2017-06-25 22:33:28.508223362 +0200
|
|
@@ -39,6 +39,8 @@
|
|
|
|
#include <new>
|
|
#include <unistd.h>
|
|
+#include <stdlib.h>
|
|
+#include <malloc.h>
|
|
|
|
#if defined(__LP64__)
|
|
# define SIZE_T_MANGLING "m"
|
|
@@ -47,6 +49,7 @@
|
|
#endif
|
|
|
|
#define SHIM_ALIAS_SYMBOL(fn) __attribute__((weak, alias(#fn)))
|
|
+#define SHIM_HIDDEN __attribute__ ((visibility ("hidden")))
|
|
|
|
extern "C" {
|
|
|
|
@@ -82,26 +85,100 @@
|
|
void __ShimCppDeleteArrayNoThrow(void* address, const std::nothrow_t&) noexcept
|
|
SHIM_ALIAS_SYMBOL(ShimCppDeleteArray);
|
|
|
|
+__asm__(".symver __ShimMalloc, malloc@Qt_5");
|
|
+void* __ShimMalloc(size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimMalloc);
|
|
+
|
|
+__asm__(".symver __ShimCalloc, calloc@Qt_5");
|
|
+void* __ShimCalloc(size_t n, size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimCalloc);
|
|
+
|
|
+__asm__(".symver __ShimRealloc, realloc@Qt_5");
|
|
+void* __ShimRealloc(void* address, size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimRealloc);
|
|
+
|
|
+__asm__(".symver __ShimMemalign, memalign@Qt_5");
|
|
+void* __ShimMemalign(size_t alignment, size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimMemalign);
|
|
+
|
|
+__asm__(".symver __ShimPosixMemalign, posix_memalign@Qt_5");
|
|
+int __ShimPosixMemalign(void** res, size_t alignment, size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimPosixMemalign);
|
|
+
|
|
+__asm__(".symver __ShimValloc, valloc@Qt_5");
|
|
+void* __ShimValloc(size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimValloc);
|
|
+
|
|
+__asm__(".symver __ShimPvalloc, pvalloc@Qt_5");
|
|
+void* __ShimPvalloc(size_t size) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimPvalloc);
|
|
+
|
|
+__asm__(".symver __ShimFree, free@Qt_5");
|
|
+void __ShimFree(void* address) noexcept
|
|
+ SHIM_ALIAS_SYMBOL(ShimFree);
|
|
+
|
|
static void* __shimCppNew(size_t size);
|
|
static void* __shimCppNewArray(size_t size);
|
|
static void __shimCppDelete(void *address);
|
|
static void __shimCppDeleteArray(void *address);
|
|
+static void* __shimMalloc(size_t size) noexcept;
|
|
+static void* __shimCalloc(size_t n, size_t size) noexcept;
|
|
+static void* __shimRealloc(void* address, size_t size) noexcept;
|
|
+static void* __shimMemalign(size_t alignment, size_t size) noexcept;
|
|
+static int __shimPosixMemalign(void** res, size_t alignment, size_t size)
|
|
+ noexcept;
|
|
+static void* __shimValloc(size_t size) noexcept;
|
|
+static void* __shimPvalloc(size_t size) noexcept;
|
|
+static void __shimFree(void* address) noexcept;
|
|
|
|
-static void* ShimCppNew(size_t size) {
|
|
+SHIM_HIDDEN void* ShimCppNew(size_t size) {
|
|
return __shimCppNew(size);
|
|
}
|
|
|
|
-static void* ShimCppNewArray(size_t size) {
|
|
+SHIM_HIDDEN void* ShimCppNewArray(size_t size) {
|
|
return __shimCppNewArray(size);
|
|
}
|
|
|
|
-static void ShimCppDelete(void* address) {
|
|
+SHIM_HIDDEN void ShimCppDelete(void* address) {
|
|
__shimCppDelete(address);
|
|
}
|
|
|
|
-static void ShimCppDeleteArray(void* address) {
|
|
+SHIM_HIDDEN void ShimCppDeleteArray(void* address) {
|
|
__shimCppDeleteArray(address);
|
|
}
|
|
+
|
|
+SHIM_HIDDEN void* ShimMalloc(size_t size) noexcept {
|
|
+ return __shimMalloc(size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void* ShimCalloc(size_t n, size_t size) noexcept {
|
|
+ return __shimCalloc(n, size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void* ShimRealloc(void* address, size_t size) noexcept {
|
|
+ return __shimRealloc(address, size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void* ShimMemalign(size_t alignment, size_t size) noexcept {
|
|
+ return __shimMemalign(alignment, size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN int ShimPosixMemalign(void** res, size_t alignment, size_t size)
|
|
+ noexcept {
|
|
+ return __shimPosixMemalign(res, alignment, size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void* ShimValloc(size_t size) noexcept {
|
|
+ return __shimValloc(size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void* ShimPvalloc(size_t size) noexcept {
|
|
+ return __shimPvalloc(size);
|
|
+}
|
|
+
|
|
+SHIM_HIDDEN void ShimFree(void* address) noexcept {
|
|
+ __shimFree(address);
|
|
+}
|
|
} // extern "C"
|
|
|
|
static void* __shimCppNew(size_t size) {
|
|
@@ -119,3 +196,36 @@
|
|
static void __shimCppDeleteArray(void* address) {
|
|
operator delete[](address);
|
|
}
|
|
+
|
|
+static void* __shimMalloc(size_t size) noexcept {
|
|
+ return malloc(size);
|
|
+}
|
|
+
|
|
+static void* __shimCalloc(size_t n, size_t size) noexcept {
|
|
+ return calloc(n, size);
|
|
+}
|
|
+
|
|
+static void* __shimRealloc(void* address, size_t size) noexcept {
|
|
+ return realloc(address, size);
|
|
+}
|
|
+
|
|
+static void* __shimMemalign(size_t alignment, size_t size) noexcept {
|
|
+ return memalign(alignment, size);
|
|
+}
|
|
+
|
|
+static int __shimPosixMemalign(void** res, size_t alignment, size_t size)
|
|
+ noexcept {
|
|
+ return posix_memalign(res, alignment, size);
|
|
+}
|
|
+
|
|
+static void* __shimValloc(size_t size) noexcept {
|
|
+ return valloc(size);
|
|
+}
|
|
+
|
|
+static void* __shimPvalloc(size_t size) noexcept {
|
|
+ return pvalloc(size);
|
|
+}
|
|
+
|
|
+static void __shimFree(void* address) noexcept {
|
|
+ free(address);
|
|
+}
|