summaryrefslogtreecommitdiffstats
path: root/chromium/build/patches/chromium_madv_free.patch
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2017-01-30 16:07:38 +0000
committer Eric Hameleers <alien@slackware.com>2017-01-30 16:07:38 +0000
commita0223af40e00834704acd2897e9385563af2e6e1 (patch)
tree958e83020d5aad4bad950f5ac56bae3c81f5e3e8 /chromium/build/patches/chromium_madv_free.patch
parent7422b54cb0e8463ef37ee41be4a234282b32173c (diff)
downloadasb-a0223af40e00834704acd2897e9385563af2e6e1.tar.gz
asb-a0223af40e00834704acd2897e9385563af2e6e1.tar.xz
chromium: update the MADFREE patch (glibc 2.24)
Diffstat (limited to 'chromium/build/patches/chromium_madv_free.patch')
-rw-r--r--chromium/build/patches/chromium_madv_free.patch33
1 files changed, 18 insertions, 15 deletions
diff --git a/chromium/build/patches/chromium_madv_free.patch b/chromium/build/patches/chromium_madv_free.patch
index 2867c796..b06627ff 100644
--- a/chromium/build/patches/chromium_madv_free.patch
+++ b/chromium/build/patches/chromium_madv_free.patch
@@ -1,15 +1,18 @@
-diff -up chromium-52.0.2743.116/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp.madv_free chromium-52.0.2743.116/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp
---- chromium-52.0.2743.116/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp.madv_free 2016-08-15 13:07:29.279655676 -0400
-+++ chromium-52.0.2743.116/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp 2016-08-15 13:08:38.447317416 -0400
-@@ -41,6 +41,11 @@
- #include <errno.h>
- #include <sys/mman.h>
-
-+#if OS(LINUX) && defined(MADV_FREE)
-+// Added in Linux 4.5, but it breaks the sandbox.
-+#undef MADV_FREE
-+#endif
-+
- #ifndef MADV_FREE
- #define MADV_FREE MADV_DONTNEED
- #endif
+Taken from Gentoo:
+https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-glibc-2.24.patch
+
+--- a/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp.orig 2017-01-05 20:50:56.329369189 +0000
++++ b/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp 2017-01-05 20:51:32.926099779 +0000
+@@ -242,6 +242,12 @@
+ ASSERT(!(len & kSystemPageOffsetMask));
+ #if OS(POSIX)
+ int ret = madvise(addr, len, MADV_FREE);
++ if (ret != 0 && errno == EINVAL) {
++ // MADV_FREE only works on Linux 4.5+ . If request failed,
++ // retry with older MADV_DONTNEED . Note that MADV_FREE
++ // being defined at compile time doesn't imply runtime support.
++ ret = madvise(addr, len, MADV_DONTNEED);
++ }
+ RELEASE_ASSERT(!ret);
+ #else
+ setSystemPagesInaccessible(addr, len);