aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium
diff options
context:
space:
mode:
Diffstat (limited to 'community/chromium')
-rw-r--r--community/chromium/APKBUILD254
-rw-r--r--community/chromium/chromium-launcher.sh39
-rw-r--r--community/chromium/chromium-system-jinja-r7.patch35
-rw-r--r--community/chromium/chromium-widevine.patch12
-rw-r--r--community/chromium/chromium.conf5
-rw-r--r--community/chromium/chromium.desktop10
-rw-r--r--community/chromium/google-api.keys10
-rw-r--r--community/chromium/musl-fixes.patch219
-rw-r--r--community/chromium/musl-sandbox.patch66
-rw-r--r--community/chromium/no-execinfo.patch103
-rw-r--r--community/chromium/no-getcontext.patch19
-rw-r--r--community/chromium/no-mallinfo.patch29
-rw-r--r--community/chromium/resolver.patch24
13 files changed, 825 insertions, 0 deletions
diff --git a/community/chromium/APKBUILD b/community/chromium/APKBUILD
new file mode 100644
index 0000000000..8307f5adaa
--- /dev/null
+++ b/community/chromium/APKBUILD
@@ -0,0 +1,254 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
+pkgname=chromium
+pkgver=45.0.2454.101
+pkgrel=0
+pkgdesc="chromium web browser"
+url="http://www.chromium.org/"
+arch="x86_64"
+license="BSD"
+depends="xdg-utils"
+depends_dev="alsa-lib-dev libevent-dev libpng-dev jpeg-dev cairo-dev cups-dev
+ mesa-dev libcap-dev dbus-glib-dev gtk+-dev libxml2-dev freetype-dev
+ jpeg-dev libxslt-dev libxtst-dev icu-dev flac-dev speex-dev
+ hunspell-dev libxinerama-dev ffmpeg-dev nss-dev libwebp-dev bzip2-dev
+ libvpx-dev sqlite-dev libelf-dev libgcrypt-dev zlib-dev
+ gnutls-dev mesa-dev libxcursor-dev libxcomposite-dev krb5-dev
+ libxrandr-dev libxscrnsaver-dev pciutils-dev eudev-dev libexif-dev
+ hwdata-usb ninja libbsd-dev harfbuzz-dev snappy-dev
+ bsd-compat-headers openssl-dev libre2-dev jsoncpp-dev minizip-dev
+ linux-headers"
+makedepends="$depends_dev xdg-utils yasm gperf bison flex perl python bash
+ paxmark findutils"
+install=""
+options=suid
+subpackages="$pkgname-doc $pkgname-chromedriver"
+source="https://commondatastorage.googleapis.com/chromium-browser-official/$pkgname-$pkgver.tar.xz
+ chromium-launcher.sh
+ chromium.conf
+ chromium.desktop
+ google-api.keys
+
+ musl-fixes.patch
+ no-execinfo.patch
+ resolver.patch
+ no-mallinfo.patch
+ no-getcontext.patch
+ musl-sandbox.patch
+
+ chromium-system-jinja-r7.patch
+ chromium-widevine.patch
+ "
+
+_builddir="$srcdir"/$pkgname-$pkgver
+
+case "${CARCH}" in
+ x86_64) target_arch=x64;;
+ x86) target_arch=ia32;;
+ arm) target_arch=arm;;
+esac
+
+prepare() {
+ cd "$_builddir"
+
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+
+ # Remove bundled ICU; its header files appear to get picked up instead of
+ # the system ones, leading to errors during the final link stage.
+ # https://groups.google.com/a/chromium.org/d/topic/chromium-packagers/BNGvJc08B6Q
+ find third_party/icu -type f \! -regex '.*\.\(gyp\|gypi\|isolate\)' -delete
+}
+
+build() {
+ cd "$_builddir"
+
+ # currently does not build with system vpx 1.4
+ # remoting/codec/video_encoder_vpx.cc:308:10: error:
+ # 'vpx_codec_control_VP9E_GET_ACTIVEMAP' was not declared in this scope
+ local vpx=0
+ # reusable system library settings
+ local use_system="
+ -Duse_system_bzip2=1
+ -Duse_system_flac=1
+ -Duse_system_harfbuzz=1
+ -Duse_system_icu=1
+ -Duse_system_jsoncpp=1
+ -Duse_system_libevent=1
+ -Duse_system_libjpeg=1
+ -Duse_system_libpng=1
+ -Duse_system_libvpx=$vpx
+ -Duse_system_libxml=1
+ -Duse_system_snappy=1
+ -Duse_system_xdg_utils=1
+ -Duse_system_yasm=1
+ -Duse_system_nspr=1
+ -Duse_system_re2=1
+ -Duse_system_speex=1
+ -Duse_system_libwebp=1
+ -Duse_system_libxslt=1
+ -Duse_system_zlib=1
+ -Duse_system_minizip=1
+ "
+
+ msg "Replacing gyp files"
+ build/linux/unbundle/replace_gyp_files.py ${use_system} || return 1
+
+ ##############################################################
+ # Please dont use these keys outside of Alpine Linux project #
+ # You can create your own at: #
+ # http://www.chromium.org/developers/how-tos/api-keys #
+ ##############################################################
+ eval "$(base64 -d < $srcdir/google-api.keys)"
+
+ msg "Running gyp_chromium"
+ build/gyp_chromium --depth=. \
+ ${use_system} \
+ -Dgoogle_api_key="$_google_api_key" \
+ -Dgoogle_default_client_id="$_google_default_client_id" \
+ -Dgoogle_default_client_secret="$_google_default_client_secret" \
+ -Dwerror= \
+ -Dclang=0 \
+ -Dpython_ver=2.7 \
+ -Dlinux_link_gsettings=1 \
+ -Dlinux_link_libpci=1 \
+ -Dlinux_link_libspeechd=0 \
+ -Dlinux_strip_binary=1 \
+ -Dlinux_use_bundled_binutils=0 \
+ -Dlinux_use_bundled_gold=0 \
+ -Dlinux_use_gold_flags=0 \
+ -Dicu_use_data_file_flag=0 \
+ -Dlogging_like_official_build=1 \
+ -Dlibspeechd_h_prefix=speech-dispatcher/ \
+ -Dffmpeg_branding=Chrome \
+ -Dproprietary_codecs=1 \
+ -Duse_allocator=none \
+ -Duse_gnome_keyring=0 \
+ -Dusb_ids_path=/usr/share/hwdata/usb.ids \
+ -Duse_mojo=0 \
+ -Duse_gconf=0 \
+ -Duse_pulseaudio=0 \
+ -Denable_hotwording=0 \
+ -Ddisable_fatal_linker_warnings=1 \
+ -Ddisable_glibc=1 \
+ -Ddisable_nacl=1 \
+ -Ddisable_pnacl=1 \
+ -Dtarget_arch="$target_arch" \
+ -Drelease_extra_cflags="$CFLAGS" \
+ -Ddisable_sse2=1 \
+ || return 1
+
+ msg "Ninja turtles GO!"
+ # build mksnapshot and paxmark it
+ ninja -C out/Release mksnapshot || return 1
+ paxmark -m out/Release/mksnapshot || return 1
+
+ # finish rest of the build
+ ninja -C out/Release chrome chrome_sandbox chromedriver || return 1
+ paxmark -m out/Release/chrome || return 1
+}
+
+package() {
+ cd "$_builddir"
+ local bin pak
+
+ for bin in chrome natives_blob.bin snapshot_blob.bin; do
+ install -Dm755 out/Release/$bin \
+ "$pkgdir"/usr/lib/$pkgname/$bin || return 1
+ done
+
+ install -Dm4755 "$_builddir"/out/Release/chrome_sandbox \
+ "$pkgdir"/usr/lib/$pkgname/chrome-sandbox || return 1
+
+ for pak in out/Release/*.pak; do
+ install -Dm644 $pak \
+ "$pkgdir"/usr/lib/$pkgname/${pak##*/} || return 1
+ done
+
+ install -Dm755 "$srcdir"/chromium-launcher.sh \
+ "$pkgdir"/usr/lib/$pkgname/chromium-launcher.sh || return 1
+
+ cp -r out/Release/locales "$pkgdir"/usr/lib/$pkgname/ || return 1
+
+ install -Dm644 out/Release/chrome.1 \
+ "$pkgdir"/usr/share/man/man1/chrome.1 || return 1
+
+ install -Dm644 out/Release/chrome.1 \
+ "$pkgdir"/usr/share/man/man1/chromium.1 || return 1
+
+ # It is important that we name the target "chromium-browser",
+ # xdg-utils expect it; bug #355517.
+ mkdir -p "$pkgdir"/usr/bin || return 1
+ cd "$pkgdir"/usr/bin || return 1
+ ln -sf /usr/lib/$pkgname/chromium-launcher.sh \
+ chromium-browser || return 1
+ ln -sf /usr/lib/$pkgname/chromedriver || return 1
+ cd "$_builddir"
+
+ install -Dm644 "$srcdir"/chromium.conf \
+ "$pkgdir"/etc/chromium/chromium.conf || return 1
+
+ install -Dm644 "$srcdir"/chromium.desktop \
+ "$pkgdir"/usr/share/applications/chromium.desktop
+
+ for size in 22 24 48 64 128 256; do
+ install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ done
+
+ for size in 16 32; do
+ install -Dm644 "chrome/app/theme/default_100_percent/chromium/product_logo_$size.png" \
+ "$pkgdir/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ done
+}
+
+chromedriver() {
+ pkgdesc="WebDriver driver for the Chromium Browser"
+ install -Dm755 "$_builddir"/out/Release/chromedriver \
+ "$subpkgdir"/usr/lib/$pkgname/chromedriver || return 1
+}
+
+md5sums="501bae19c33b3888578a9d92a493a17e chromium-45.0.2454.101.tar.xz
+b6d015c1da85aa65ee21bc974c7fc7d2 chromium-launcher.sh
+c5aa73a87d4b88cce9f1a680ca691bb6 chromium.conf
+2962ac6259e39a797d441daf43aa49c9 chromium.desktop
+2d2ee5f22d65c756871301b4a407f4ca google-api.keys
+4d51f367a9220703f5f7dd962388b5a7 musl-fixes.patch
+00ae59dd9d09c60a116fd0133f9f3a60 no-execinfo.patch
+af047840f31e99aa36be04edc3482afd resolver.patch
+5c69e07f1738f11632e8d9f27cc85826 no-mallinfo.patch
+2c8de771a7c0e5e0e9fc68fa978785f7 no-getcontext.patch
+4f22f0d05448c49d6501386523a081ba musl-sandbox.patch
+97b1578585ab600ed9adef4f341ccd80 chromium-system-jinja-r7.patch
+de717d6430532f34fe161035dfdafcdf chromium-widevine.patch"
+sha256sums="1b682dcaae9c89b2ebfdb192bb2f73c78c5b30a55103e7198fa3c1e21fed85fb chromium-45.0.2454.101.tar.xz
+89f1eb19d1ed998a190045ea173959f01faee3490d58a6a34ca3fe21228e569f chromium-launcher.sh
+b466559340a36998354a0577325fe533d9e6b74c24a15b7599671171506bf128 chromium.conf
+3ae90cea7503d0039de53448ed112b9bc0cb5a09f6b0045506eb777fc23517e5 chromium.desktop
+267ba8ff50574e51d2582c4fca9b9e14f7225c1fa064d135cbceff9cef2324ac google-api.keys
+55150c9f0671789b998d8f858e7c8640e30331b92912dea0a19458c9d0c3f31c musl-fixes.patch
+505a55c28e971e067f189e3a1ce697d711cec82a765d81f78eb49ec1f6df56cf no-execinfo.patch
+f16c63d4188fe56732dc6760307795ba4059452c4cf3de1460cbcb2616011511 resolver.patch
+d746414cde6c7fc1836406cc2f954387dc75c755141b2dd0126eb885ab411638 no-mallinfo.patch
+ea79f9a46116c8b56bbc69d226abd9252e4ae4d946ca695203f2298279cc2211 no-getcontext.patch
+20fcb99022f3a737dceea7349da61e12a85834c0ab65a02009b6f56acb8b0f07 musl-sandbox.patch
+872f5a38d8263b14308bb117828496a4093d0e6ad755d39d2c5e6857314fe071 chromium-system-jinja-r7.patch
+1d1ead77250475228524770e57c17282aff9098c5efc3d7719b0df76229b8874 chromium-widevine.patch"
+sha512sums="cab9566de6d6b582f0b78a3ef2ed591830976fdf838e7780a380eb0caed2d6649ceee50ce2c017406e18ac8bfa92fd6a43a6677f0984a4af8de0723db4d9312b chromium-45.0.2454.101.tar.xz
+b9a810416dd7a8ffc3a5ced85ad9acebda1665bd08a57eec7b189698cc5f74d2c3fd69044e20fcb83297a43214b2772a1312b2c6122ea0eb716abacf39524d60 chromium-launcher.sh
+f6d962b9e4c22dd42183df3db5d3202dab33eccecafb1bf63ca678147289581262db1e5e64cbe8f9c212beefb0a6717bb8d311e497f56b55fe95b8bab2db493f chromium.conf
+e182c998a43d22d1c76a86c561619afd1fca8c2be668265ad5e2f81a3806f7a154272cc027a2f8b370fb69446892c69e5967a4be76082325c14245ee7915234c chromium.desktop
+2d8237a940ea691bd10b08315429677a587f7ef9692a0cca53bfd066eae82998a6c71f402a8669e9de39f94d7f3280745d1628ea6eac5d76ca7116844d4e0dac google-api.keys
+47d2fa2e3cad35e6eca5de9ffad1eacdce7c82e4da4579aa08e7fde0fb5690b9925c8f925b484f012ce1eaf22b18350e2fbdd5f38301c45b390da4393158bf79 musl-fixes.patch
+4f756d3e404033f7a36b38266176b7302f7e2a2e78c9f8b8d362a53a3dbdc675cdaa581393a70c23a29135b34566cf4109513cb13a289dc111bbce65ec065ebd no-execinfo.patch
+987f18d37824676e5d874a6fde1099bcc558920e7781de5f34e612411013e4fac9ca421a3cce1ed5f82401c4d54212b6f47a0a856892a78543b8e400a4bb0489 resolver.patch
+c8ff8d3d2c5948a8c9ae0ccc8625ae6116071af19b1d7d2bc2597b0876084de42565537abcbb96b150176e04de7a288ab7a9116e038fe83dd6816c7c5b2ae235 no-mallinfo.patch
+42d9a6ebea2d95cdc169b921cc1a1b846cf500997059fd3084de09e21f00b63b76e60c6124f4af247d402ff5ca3f4bf8867a6f2c78198c05b4273ca01fb29241 no-getcontext.patch
+cc61407bae55523fd3d0b43be7cf827cd6a648314a81f8d78f830e60cb215ede6c585d8755e9c870bb98955a4d3679205cbefde6f4efcb0e48469169167823eb musl-sandbox.patch
+10bcc6a467b6766d13b5e41e7b7dcdbd62de7c04daad16c83037e88043032a0c118627029f91ef8a2a57faaaebc8b6f4ee16e8d1fecb5921d0d49efd60a27863 chromium-system-jinja-r7.patch
+4a11b46afa8ce84bd23a8c506301b5848ee4291a764f3aed282b8a98706ece16cf9346dec6cc71b1e17812b15f43a5cbc7bc6d38ed4dcc88c12d6fcb03bd9295 chromium-widevine.patch"
diff --git a/community/chromium/chromium-launcher.sh b/community/chromium/chromium-launcher.sh
new file mode 100644
index 0000000000..b001d6fe59
--- /dev/null
+++ b/community/chromium/chromium-launcher.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Allow the user to override command-line flags, bug #357629.
+# This is based on Debian's chromium-browser package, and is intended
+# to be consistent with Debian.
+for f in /etc/chromium/*.conf; do
+ [ -f ${f} ] && . "${f}"
+done
+
+# Prefer user defined CHROMIUM_USER_FLAGS (from env) over system
+# default CHROMIUM_FLAGS (from /etc/chromium/default).
+CHROMIUM_FLAGS=${CHROMIUM_USER_FLAGS:-"$CHROMIUM_FLAGS"}
+
+# Let the wrapped binary know that it has been run through the wrapper
+export CHROME_WRAPPER=$(readlink -f "$0")
+
+PROGDIR=${CHROME_WRAPPER%/*}
+
+case ":$PATH:" in
+ *:$PROGDIR:*)
+ # $PATH already contains $PROGDIR
+ ;;
+ *)
+ # Append $PROGDIR to $PATH
+ export PATH="$PATH:$PROGDIR"
+ ;;
+esac
+
+if [ $(id -u) -eq 0 ] && [ $(stat -c %u -L ${XDG_CONFIG_HOME:-${HOME}}) -eq 0 ]; then
+ # Running as root with HOME owned by root.
+ # Pass --user-data-dir to work around upstream failsafe.
+ CHROMIUM_FLAGS="--user-data-dir=${XDG_CONFIG_HOME:-${HOME}/.config}/chromium
+ ${CHROMIUM_FLAGS}"
+fi
+
+# Set the .desktop file name
+export CHROME_DESKTOP="chromium.desktop"
+
+exec "$PROGDIR/chrome" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"
diff --git a/community/chromium/chromium-system-jinja-r7.patch b/community/chromium/chromium-system-jinja-r7.patch
new file mode 100644
index 0000000000..d8e7464c6e
--- /dev/null
+++ b/community/chromium/chromium-system-jinja-r7.patch
@@ -0,0 +1,35 @@
+--- ./third_party/WebKit/Source/bindings/scripts/scripts.gyp.orig 2014-08-19 09:55:10.330972228 +0000
++++ ./third_party/WebKit/Source/bindings/scripts/scripts.gyp 2014-08-19 09:55:26.387286232 +0000
+@@ -54,7 +54,6 @@
+ 'actions': [{
+ 'action_name': 'cache_jinja_templates',
+ 'inputs': [
+- '<@(jinja_module_files)',
+ 'code_generator_v8.py',
+ '<@(code_generator_template_files)',
+ ],
+--- ./third_party/WebKit/Source/build/scripts/scripts.gypi.orig 2014-08-19 10:00:00.216521733 +0000
++++ ./third_party/WebKit/Source/build/scripts/scripts.gypi 2014-08-19 10:00:11.464735099 +0000
+@@ -2,10 +2,6 @@
+ {
+ 'variables': {
+ 'scripts_for_in_files': [
+- # jinja2/__init__.py contains version string, so sufficient as
+- # dependency for whole jinja2 package
+- '<(DEPTH)/third_party/jinja2/__init__.py',
+- '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ 'hasher.py',
+ 'in_file.py',
+ 'in_generator.py',
+--- ./third_party/WebKit/Source/bindings/scripts/scripts.gypi.orig 2014-08-19 10:53:02.824618979 +0000
++++ ./third_party/WebKit/Source/bindings/scripts/scripts.gypi 2014-08-19 10:53:20.784957370 +0000
+@@ -12,9 +12,6 @@
+ '<(DEPTH)/third_party/markupsafe/__init__.py', # jinja2 dep
+ ],
+ 'idl_lexer_parser_files': [
+- # PLY (Python Lex-Yacc)
+- '<(DEPTH)/third_party/ply/lex.py',
+- '<(DEPTH)/third_party/ply/yacc.py',
+ # Web IDL lexer/parser (base parser)
+ '<(DEPTH)/tools/idl_parser/idl_lexer.py',
+ '<(DEPTH)/tools/idl_parser/idl_node.py',
diff --git a/community/chromium/chromium-widevine.patch b/community/chromium/chromium-widevine.patch
new file mode 100644
index 0000000000..5e78817f07
--- /dev/null
+++ b/community/chromium/chromium-widevine.patch
@@ -0,0 +1,12 @@
+diff -upr chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h
+--- chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 01:18:59.000000000 +0300
++++ chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 09:09:49.157260050 +0300
+@@ -14,4 +14,8 @@
+ // - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available
+ // as a string, e.g., "1.0.123.456").
+
++#include "third_party/widevine/cdm/widevine_cdm_common.h"
++#define WIDEVINE_CDM_AVAILABLE
++#define WIDEVINE_CDM_VERSION_STRING "1.0.000.000"
++
+ #endif // WIDEVINE_CDM_VERSION_H_
diff --git a/community/chromium/chromium.conf b/community/chromium/chromium.conf
new file mode 100644
index 0000000000..a8b8db37f5
--- /dev/null
+++ b/community/chromium/chromium.conf
@@ -0,0 +1,5 @@
+# Default settings for chromium. This file is sourced by /bin/sh from
+# the chromium launcher.
+
+# Options to pass to chromium.
+#CHROMIUM_FLAGS=""
diff --git a/community/chromium/chromium.desktop b/community/chromium/chromium.desktop
new file mode 100644
index 0000000000..e5f549bc02
--- /dev/null
+++ b/community/chromium/chromium.desktop
@@ -0,0 +1,10 @@
+[Desktop Entry]
+Name=Chromium
+GenericName=Web Browser
+Comment=Access the Internet
+Exec=chromium-browser %U
+Terminal=false
+Icon=chromium
+Type=Application
+Categories=GTK;Network;WebBrowser;
+MimeType=text/html;text/xml;application/xhtml+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
diff --git a/community/chromium/google-api.keys b/community/chromium/google-api.keys
new file mode 100644
index 0000000000..8cd0f0ab09
--- /dev/null
+++ b/community/chromium/google-api.keys
@@ -0,0 +1,10 @@
+IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
+IyMjIyMKIyBQbGVhc2UgZG9udCB1c2UgdGhlc2Uga2V5cyBvdXRzaWRlIG9mIEFscGluZSBMaW51
+eCBwcm9qZWN0ICMKIyBZb3UgY2FuIGNyZWF0ZSB5b3VyIG93biBhdDogICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICMKIyBodHRwOi8vd3d3LmNocm9taXVtLm9yZy9kZXZlbG9wZXJzL2hv
+dy10b3MvYXBpLWtleXMgICAgICAgICMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
+IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKX2dvb2dsZV9hcGlfa2V5PSJBSXphU3lDUkk0
+RUdwRHVfQUFISThFMnllbmpWaFdRZHA0RzhpZ2MiCl9nb29nbGVfZGVmYXVsdF9jbGllbnRfaWQ9
+IjQ5NzU1MDYyMjM2Ny11YnRrbWQzYjJwcDVndWxiYTVuNmhhNnNxNG4zNWVoai5hcHBzLmdvb2ds
+ZXVzZXJjb250ZW50LmNvbSIKX2dvb2dsZV9kZWZhdWx0X2NsaWVudF9zZWNyZXQ9Ik5hQ1g4dElJ
+QXBocmpzNTZuM1RwSHhfZSIKCg==
diff --git a/community/chromium/musl-fixes.patch b/community/chromium/musl-fixes.patch
new file mode 100644
index 0000000000..144a008557
--- /dev/null
+++ b/community/chromium/musl-fixes.patch
@@ -0,0 +1,219 @@
+--- ./third_party/lss/linux_syscall_support.h.orig
++++ ./third_party/lss/linux_syscall_support.h
+@@ -1127,6 +1127,12 @@
+ #ifndef __NR_fallocate
+ #define __NR_fallocate 285
+ #endif
++
++#undef __NR_pread
++#define __NR_pread __NR_pread64
++#undef __NR_pwrite
++#define __NR_pwrite __NR_pwrite64
++
+ /* End of x86-64 definitions */
+ #elif defined(__mips__)
+ #if _MIPS_SIM == _MIPS_SIM_ABI32
+--- ./breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc.orig
++++ ./breakpad/src/client/linux/dump_writer_common/ucontext_reader.cc
+@@ -49,7 +49,7 @@
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+- const struct _libc_fpstate* fp) {
++ const struct _fpstate* fp) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_X86_FULL |
+@@ -97,7 +97,7 @@
+ }
+
+ void UContextReader::FillCPUContext(RawContextCPU *out, const ucontext *uc,
+- const struct _libc_fpstate* fpregs) {
++ const struct _fpstate* fpregs) {
+ const greg_t* regs = uc->uc_mcontext.gregs;
+
+ out->context_flags = MD_CONTEXT_AMD64_FULL;
+--- ./breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
++++ ./breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -50,7 +50,7 @@
+ // info: the collection of register structures.
+ #if defined(__i386__) || defined(__x86_64)
+ static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
+- const struct _libc_fpstate* fp);
++ const struct _fpstate* fp);
+ #elif defined(__aarch64__)
+ static void FillCPUContext(RawContextCPU *out, const ucontext *uc,
+ const struct fpsimd_context* fpregs);
+--- ./breakpad/src/client/linux/minidump_writer/minidump_writer.h.orig
++++ ./breakpad/src/client/linux/minidump_writer/minidump_writer.h
+@@ -48,7 +48,7 @@
+ #if defined(__aarch64__)
+ typedef struct fpsimd_context fpstate_t;
+ #elif !defined(__ARM_EABI__) && !defined(__mips__)
+-typedef struct _libc_fpstate fpstate_t;
++typedef struct _fpstate fpstate_t;
+ #endif
+
+ // These entries store a list of memory regions that the client wants included
+--- ./breakpad/src/common/linux/elf_core_dump.h.orig
++++ ./breakpad/src/common/linux/elf_core_dump.h
+@@ -36,6 +36,7 @@
+ #include <elf.h>
+ #include <link.h>
+ #include <stddef.h>
++#include <limits.h>
+
+ #include "common/memory_range.h"
+
+@@ -51,9 +52,9 @@
+ typedef ElfW(Phdr) Phdr;
+ typedef ElfW(Word) Word;
+ typedef ElfW(Addr) Addr;
+-#if __WORDSIZE == 32
++#if ULONG_MAX == 0xffffffff
+ static const int kClass = ELFCLASS32;
+-#elif __WORDSIZE == 64
++#elif ULONG_MAX == 0xffffffffffffffff
+ static const int kClass = ELFCLASS64;
+ #else
+ #error "Unsupported __WORDSIZE for ElfCoreDump."
+--- ./sandbox/linux/suid/process_util.h.orig
++++ ./sandbox/linux/suid/process_util.h
+@@ -11,6 +11,14 @@
+ #include <stdbool.h>
+ #include <sys/types.h>
+
++// Some additional functions
++# define TEMP_FAILURE_RETRY(expression) \
++ (__extension__ \
++ ({ long int __result; \
++ do __result = (long int) (expression); \
++ while (__result == -1L && errno == EINTR); \
++ __result; }))
++
+ // This adjusts /proc/process/oom_score_adj so the Linux OOM killer
+ // will prefer certain process types over others. The range for the
+ // adjustment is [-1000, 1000], with [0, 1000] being user accessible.
+--- ./sandbox/linux/seccomp-bpf/trap.cc.orig
++++ ./sandbox/linux/seccomp-bpf/trap.cc
+@@ -156,7 +156,7 @@
+ // most versions of glibc don't include this information in siginfo_t. So,
+ // we need to explicitly copy it into a arch_sigsys structure.
+ struct arch_sigsys sigsys;
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__si_fields, sizeof(sigsys));
+
+ #if defined(__mips__)
+ // When indirect syscall (syscall(__NR_foo, ...)) is made on Mips, the
+--- ./net/base/dns_reloader.cc.orig
++++ ./net/base/dns_reloader.cc
+@@ -5,7 +5,7 @@
+ #include "net/base/dns_reloader.h"
+
+ #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+- !defined(OS_ANDROID)
++ !defined(OS_ANDROID) && !defined(_GNU_SOURCE)
+
+ #include <resolv.h>
+
+--- ./net/dns/dns_config_service_posix.cc.orig
++++ ./net/dns/dns_config_service_posix.cc
+@@ -116,7 +116,7 @@
+ ConfigParsePosixResult ReadDnsConfig(DnsConfig* config) {
+ ConfigParsePosixResult result;
+ config->unhandled_options = false;
+-#if defined(OS_OPENBSD)
++#if defined(OS_OPENBSD) || defined(_GNU_SOURCE)
+ // Note: res_ninit in glibc always returns 0 and sets RES_INIT.
+ // res_init behaves the same way.
+ memset(&_res, 0, sizeof(_res));
+--- ./third_party/ffmpeg/libavutil/cpu.c.orig
++++ ./third_party/ffmpeg/libavutil/cpu.c
+@@ -38,7 +38,6 @@
+ #include <sys/param.h>
+ #endif
+ #include <sys/types.h>
+-#include <sys/sysctl.h>
+ #endif
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+--- ./third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp.orig
++++ ./third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
+@@ -58,7 +58,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
++#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of webkit_unit_tests).
+ // In this case, this method returns 0 and the caller must handle it.
+@@ -105,7 +105,7 @@
+
+ void* StackFrameDepth::getStackStart()
+ {
+-#if defined(__GLIBC__) || OS(ANDROID) || OS(FREEBSD)
++#if OS(LINUX) || OS(ANDROID) || OS(FREEBSD)
+ pthread_attr_t attr;
+ int error;
+ #if OS(FREEBSD)
+--- ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig
++++ ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -26,7 +26,7 @@
+ #include "ui/events/event_switches.h"
+ #include "ui/gfx/screen.h"
+
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++#if defined(__GLIBC__) && !defined(OS_CHROMEOS)
+ #include <gnu/libc-version.h>
+
+ #include "base/version.h"
+--- ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig
++++ ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -116,7 +116,7 @@
+ }
+
+ void RecordLinuxGlibcVersion() {
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
++#if defined(__GLIBC__) && !defined(OS_CHROMEOS)
+ Version version(gnu_get_libc_version());
+
+ UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
+@@ -140,7 +140,7 @@
+ #endif
+ }
+
+-#if defined(USE_X11) && !defined(OS_CHROMEOS)
++#if defined(__GLIBC__) && defined(USE_X11) && !defined(OS_CHROMEOS)
+ UMALinuxWindowManager GetLinuxWindowManager() {
+ switch (ui::GuessWindowManager()) {
+ case ui::WM_UNKNOWN:
+@@ -239,7 +239,7 @@
+
+ void ChromeBrowserMainExtraPartsMetrics::PostBrowserStart() {
+ RecordLinuxGlibcVersion();
+-#if defined(USE_X11) && !defined(OS_CHROMEOS)
++#if defined(__GLIBC__) && defined(USE_X11) && !defined(OS_CHROMEOS)
+ UMA_HISTOGRAM_ENUMERATION("Linux.WindowManager",
+ GetLinuxWindowManager(),
+ UMA_LINUX_WINDOW_MANAGER_COUNT);
+--- ./third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c.orig
++++ ./third_party/ffmpeg/libavutil/autorename_libavutil_cpu.c
+@@ -38,7 +38,6 @@
+ #include <sys/param.h>
+ #endif
+ #include <sys/types.h>
+-#include <sys/sysctl.h>
+ #endif
+ #if HAVE_UNISTD_H
+ #include <unistd.h>
+--- ./device/serial/serial_io_handler_posix.cc.orig
++++ ./device/serial/serial_io_handler_posix.cc
+@@ -6,6 +6,7 @@
+
+ #include <sys/ioctl.h>
+ #include <termios.h>
++#include <asm-generic/ioctls.h>
+
+ #include "base/posix/eintr_wrapper.h"
+
diff --git a/community/chromium/musl-sandbox.patch b/community/chromium/musl-sandbox.patch
new file mode 100644
index 0000000000..3f244f03e6
--- /dev/null
+++ b/community/chromium/musl-sandbox.patch
@@ -0,0 +1,66 @@
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc.cld
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -111,23 +111,13 @@
+ // CLONE_VM, nor CLONE_THREAD, which includes all fork() implementations.
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
++ const int required = CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND |
++ CLONE_THREAD | CLONE_SYSVSEM;
++ const int safe = CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID |
++ CLONE_DETACHED;
++ const BoolExpr thread_clone_ok = (flags&~safe)==required;
+
+- // TODO(mdempsky): Extend DSL to support (flags & ~mask1) == mask2.
+- const uint64_t kAndroidCloneMask = CLONE_VM | CLONE_FS | CLONE_FILES |
+- CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM;
+- const uint64_t kObsoleteAndroidCloneMask = kAndroidCloneMask | CLONE_DETACHED;
+-
+- const uint64_t kGlibcPthreadFlags =
+- CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND | CLONE_THREAD |
+- CLONE_SYSVSEM | CLONE_SETTLS | CLONE_PARENT_SETTID | CLONE_CHILD_CLEARTID;
+- const BoolExpr glibc_test = flags == kGlibcPthreadFlags;
+-
+- const BoolExpr android_test = flags == kAndroidCloneMask ||
+- flags == kObsoleteAndroidCloneMask ||
+- flags == kGlibcPthreadFlags;
+-
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf((flags & (CLONE_VM | CLONE_THREAD)) == 0, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc.orig
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -416,12 +416,12 @@
+ #endif
+ case __NR_epoll_create1:
+ case __NR_epoll_ctl:
++ case __NR_epoll_pwait:
+ return true;
+ default:
+ #if defined(__x86_64__)
+ case __NR_epoll_ctl_old:
+ #endif
+- case __NR_epoll_pwait:
+ #if defined(__x86_64__)
+ case __NR_epoll_wait_old:
+ #endif
+--- ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc.orig
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -494,6 +494,7 @@
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -509,7 +510,6 @@
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
diff --git a/community/chromium/no-execinfo.patch b/community/chromium/no-execinfo.patch
new file mode 100644
index 0000000000..bc5eefcd55
--- /dev/null
+++ b/community/chromium/no-execinfo.patch
@@ -0,0 +1,103 @@
+--- ./base/debug/stack_trace_posix.cc.orig
++++ ./base/debug/stack_trace_posix.cc
+@@ -22,7 +22,7 @@
+ #if defined(__GLIBCXX__)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ #include <execinfo.h>
+ #endif
+
+@@ -73,7 +73,7 @@
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
++#if defined(__GLIBCXX__) && defined(HAVE_BACKTRACE)
+
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+@@ -169,7 +169,7 @@
+
+ handler->HandleOutput("\n");
+ }
+-#elif !defined(__UCLIBC__)
++#elif defined(HAVE_BACKTRACE)
+ bool printed = false;
+
+ // Below part is async-signal unsafe (uses malloc), so execute it only
+@@ -738,7 +738,7 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ count_ = base::saturated_cast<size_t>(backtrace(trace_, arraysize(trace_)));
+@@ -751,13 +751,13 @@
+ // NOTE: This code MUST be async-signal safe (it's used by in-process
+ // stack dumping signal handler). NO malloc or stdio is allowed here.
+
+-#if !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ void StackTrace::OutputToStream(std::ostream* os) const {
+ StreamBacktraceOutputHandler handler(os);
+ ProcessBacktrace(trace_, count_, &handler);
+--- ./third_party/WebKit/Source/wtf/Assertions.cpp.orig
++++ ./third_party/WebKit/Source/wtf/Assertions.cpp
+@@ -61,7 +61,7 @@
+ #define HAVE_ISDEBUGGERPRESENT 1
+ #endif
+
+-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
++#if defined(HAVE_BACKTRACE)
+ #include <cxxabi.h>
+ #include <dlfcn.h>
+ #include <execinfo.h>
+@@ -222,7 +222,7 @@
+
+ void WTFGetBacktrace(void** stack, int* size)
+ {
+-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
++#if defined(HAVE_BACKTRACE)
+ *size = backtrace(stack, *size);
+ #elif OS(WIN)
+ // The CaptureStackBackTrace function is available in XP, but it is not defined
+@@ -260,7 +260,7 @@
+ : m_name(0)
+ , m_cxaDemangled(0)
+ {
+-#if OS(MACOSX) || (OS(LINUX) && !defined(__UCLIBC__))
++#if defined(HAVE_BACKTRACE)
+ Dl_info info;
+ if (!dladdr(addr, &info) || !info.dli_sname)
+ return;
+--- ./third_party/webrtc/base/checks.cc.orig
++++ ./third_party/webrtc/base/checks.cc
+@@ -16,7 +16,7 @@
+ #include <cstdio>
+ #include <cstdlib>
+
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ #include <cxxabi.h>
+ #include <execinfo.h>
+ #endif
+@@ -55,7 +55,7 @@
+ // to get usable symbols on Linux. This is copied from V8. Chromium has a more
+ // advanced stace trace system; also more difficult to copy.
+ void DumpBacktrace() {
+-#if defined(__GLIBCXX__) && !defined(__UCLIBC__)
++#if defined(HAVE_BACKTRACE)
+ void* trace[100];
+ int size = backtrace(trace, sizeof(trace) / sizeof(*trace));
+ char** symbols = backtrace_symbols(trace, size);
diff --git a/community/chromium/no-getcontext.patch b/community/chromium/no-getcontext.patch
new file mode 100644
index 0000000000..4b87c6d170
--- /dev/null
+++ b/community/chromium/no-getcontext.patch
@@ -0,0 +1,19 @@
+--- ./breakpad/src/client/linux/handler/exception_handler.cc.orig
++++ ./breakpad/src/client/linux/handler/exception_handler.cc
+@@ -460,7 +460,6 @@
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ struct ucontext context;
+- getcontext(&context);
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -628,8 +627,6 @@
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
+- int getcontext_result = getcontext(&context.context);
+- if (getcontext_result)
+ return false;
+
+ #if defined(__i386__)
diff --git a/community/chromium/no-mallinfo.patch b/community/chromium/no-mallinfo.patch
new file mode 100644
index 0000000000..6e1063084a
--- /dev/null
+++ b/community/chromium/no-mallinfo.patch
@@ -0,0 +1,29 @@
+--- ./content/child/content_child_helpers.cc.orig
++++ ./content/child/content_child_helpers.cc
+@@ -15,7 +15,7 @@
+
+ namespace content {
+
+-#if defined(OS_LINUX) || defined(OS_ANDROID)
++#if defined(__GLIBC__) || defined(OS_ANDROID)
+ size_t GetMemoryUsageKB() {
+ struct mallinfo minfo = mallinfo();
+ uint64_t mem_usage =
+--- ./base/trace_event/malloc_dump_provider.cc.orig
++++ ./base/trace_event/malloc_dump_provider.cc
+@@ -29,6 +29,7 @@
+ // Called at trace dump point time. Creates a snapshot the memory counters for
+ // the current process.
+ bool MallocDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) {
++#if defined(__GLIBC__)
+ struct mallinfo info = mallinfo();
+ DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
+
+@@ -46,6 +47,7 @@
+ MemoryAllocatorDump* inner_dump = pmd->CreateAllocatorDump(kAllocatedObjects);
+ inner_dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ MemoryAllocatorDump::kUnitsBytes, info.uordblks);
++#endif
+
+ return true;
+ }
diff --git a/community/chromium/resolver.patch b/community/chromium/resolver.patch
new file mode 100644
index 0000000000..fe1141ecbe
--- /dev/null
+++ b/community/chromium/resolver.patch
@@ -0,0 +1,24 @@
+--- ./net/dns/host_resolver_impl.cc.orig
++++ ./net/dns/host_resolver_impl.cc
+@@ -1881,8 +1881,7 @@
+ #endif
+ NetworkChangeNotifier::AddIPAddressObserver(this);
+ NetworkChangeNotifier::AddDNSObserver(this);
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+- !defined(OS_ANDROID)
++#if defined(__GLIBC__)
+ EnsureDnsReloaderInit();
+ #endif
+
+--- ./net/dns/host_resolver_proc.cc.orig
++++ ./net/dns/host_resolver_proc.cc
+@@ -193,8 +193,7 @@
+ // Restrict result set to only this socket type to avoid duplicates.
+ hints.ai_socktype = SOCK_STREAM;
+
+-#if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_OPENBSD) && \
+- !defined(OS_ANDROID)
++#if defined(__GLIBC__)
+ DnsReloaderMaybeReload();
+ #endif
+ int err = getaddrinfo(host.c_str(), NULL, &hints, &ai);