summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-31 11:04:17 +0100
committerdavidovski <david@davidovski.xyz>2022-05-31 11:04:17 +0100
commit871b2b573f01c1b3176a0f65458b3d281b41c437 (patch)
tree1311c682a9307026b039de9ba0e93bd22e35e2f5
parentdfcdf333c80ae1d7171f6fa145fd87fecb8c5b73 (diff)
added pandoc and qt5
-rw-r--r--repo/apps/chromium/chromium-VirtualCursor-standard-layout.patch216
-rw-r--r--repo/apps/chromium/chromium-launcher.sh41
-rw-r--r--repo/apps/chromium/chromium-revert-drop-of-system-java.patch15
-rw-r--r--repo/apps/chromium/chromium-use-alpine-target.patch24
-rw-r--r--repo/apps/chromium/chromium.conf5
-rw-r--r--repo/apps/chromium/chromium.desktop10
-rw-r--r--repo/apps/chromium/chromium.xibuild284
-rw-r--r--repo/apps/chromium/credentials-header.patch11
-rw-r--r--repo/apps/chromium/default-pthread-stacksize.patch45
-rw-r--r--repo/apps/chromium/elf-arm.patch11
-rw-r--r--repo/apps/chromium/enable-GlobalMediaControlsCastStartStop.patch32
-rw-r--r--repo/apps/chromium/fix-narrowing-cast.patch53
-rw-r--r--repo/apps/chromium/fix-unittests-sandbox.patch11
-rw-r--r--repo/apps/chromium/gcc-arm.patch11
-rw-r--r--repo/apps/chromium/gdbinit.patch21
-rw-r--r--repo/apps/chromium/google-api.keys10
-rw-r--r--repo/apps/chromium/media-base.patch10
-rw-r--r--repo/apps/chromium/memory-tagging-arm64.patch18
-rw-r--r--repo/apps/chromium/musl-crashpad.patch25
-rw-r--r--repo/apps/chromium/musl-fixes.patch221
-rw-r--r--repo/apps/chromium/musl-hacks.patch98
-rw-r--r--repo/apps/chromium/musl-sandbox.patch176
-rw-r--r--repo/apps/chromium/musl-stat.patch12
-rw-r--r--repo/apps/chromium/musl-tid-caching.patch81
-rw-r--r--repo/apps/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch22
-rw-r--r--repo/apps/chromium/nasm.patch11
-rw-r--r--repo/apps/chromium/no-execinfo.patch75
-rw-r--r--repo/apps/chromium/no-getcontext.patch26
-rw-r--r--repo/apps/chromium/no-mallinfo.patch83
-rw-r--r--repo/apps/chromium/quiche-arena-size.patch11
-rw-r--r--repo/apps/chromium/remove-strip_binary.patch32
-rw-r--r--repo/apps/chromium/resolver.patch36
-rw-r--r--repo/apps/chromium/revert-use-ffile-compilation-dir.patch48
-rw-r--r--repo/apps/chromium/scoped-file.patch31
-rw-r--r--repo/apps/chromium/sql-make-VirtualCursor-standard-layout-type.patch238
-rw-r--r--repo/apps/chromium/system-opus.patch52
-rw-r--r--repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch12
-rw-r--r--repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch.112
-rw-r--r--repo/apps/chromium/use-deprecated-ffmpeg-api.patch36
-rw-r--r--repo/apps/chromium/use-deprecated-ffmpeg-api.patch.136
-rw-r--r--repo/apps/chromium/use-oauth2-client-switches-as-default.patch17
-rw-r--r--repo/apps/chromium/wayland-egl.patch22
-rw-r--r--repo/apps/chromium/webcodecs-stop-using-AudioOpusEncoder.patch49
-rw-r--r--repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch31
-rw-r--r--repo/apps/gimp/gimp.xibuild2
-rw-r--r--repo/media/gegl/gegl.xibuild1
-rw-r--r--repo/meta/repo-test.sh/repo-test.sh.xibuild5
-rw-r--r--repo/xi/xibuild/xibuild.xibuild2
-rw-r--r--repo/xi/xipkg/xipkg.xibuild2
-rw-r--r--skip/cabal-stage0/cabal-stage0.xibuild29
-rw-r--r--skip/cabal-stage0/depends-for-ghc-9.0.1.patch44
-rw-r--r--skip/cabal-stage0/linux-9.0.1.json1
-rw-r--r--skip/cabal/cabal.project.freeze65
-rw-r--r--skip/cabal/cabal.xibuild40
-rw-r--r--skip/ghc/0000-bootstrap.patch16
-rw-r--r--skip/ghc/0001-Replace-more-autotools-obsolete-macros-19189.patch152
-rw-r--r--skip/ghc/0002-configure-fix-the-use-of-some-obsolete-macros-19189.patch298
-rw-r--r--skip/ghc/0003-llvmGen-Accept-range-of-LLVM-versions.patch484
-rw-r--r--skip/ghc/0004-Fix-autoconf-after-6d6edb1bbb.patch33
-rw-r--r--skip/ghc/0005-Set-min-LLVM-version-to-9-and-make-version-checking-.patch143
-rw-r--r--skip/ghc/0005-buildpath-abi-stability.patch25
-rw-r--r--skip/ghc/0006-Optimiser-Correctly-deal-with-strings-starting-with-unicode.patch132
-rw-r--r--skip/ghc/ghc.xibuild36
-rw-r--r--skip/ghc/skip-tests.patch39
-rw-r--r--skip/ghc/tests-use-iterable-from-collections-abc.patch23
-rw-r--r--skip/icecat/allow-custom-rust-vendor.patch564
-rw-r--r--skip/icecat/avoid-redefinition.patch15
-rw-r--r--skip/icecat/disable-moz-stackwalk.patch18
-rw-r--r--skip/icecat/disable-neon-in-aom.patch39
-rw-r--r--skip/icecat/fix-fortify-system-wrappers.patch13
-rw-r--r--skip/icecat/fix-rust-target.patch31
-rw-r--r--skip/icecat/fix-webrtc-glibcisms.patch20
-rw-r--r--skip/icecat/icecat.desktop77
-rw-r--r--skip/icecat/icecat.xibuild124
-rw-r--r--skip/icecat/mallinfo.patch20
-rw-r--r--skip/icecat/sandbox-fork.patch15
-rw-r--r--skip/icecat/sandbox-largefile.patch17
-rw-r--r--skip/icecat/sandbox-sched_setscheduler.patch16
-rw-r--r--skip/icecat/stab.h71
-rw-r--r--skip/pandoc/cabal.project.freeze249
-rw-r--r--skip/pandoc/pandoc.xibuild38
-rw-r--r--skip/qt5-qtbase/qt-musl-iconv-no-bom.patch11
-rw-r--r--skip/qt5-qtbase/qt5-base-cflags.patch46
-rw-r--r--skip/qt5-qtbase/qt5-base-nostrip.patch13
-rw-r--r--skip/qt5-qtbase/qt5-qtbase.xibuild78
85 files changed, 5365 insertions, 3 deletions
diff --git a/repo/apps/chromium/chromium-VirtualCursor-standard-layout.patch b/repo/apps/chromium/chromium-VirtualCursor-standard-layout.patch
new file mode 100644
index 0000000..721e194
--- /dev/null
+++ b/repo/apps/chromium/chromium-VirtualCursor-standard-layout.patch
@@ -0,0 +1,216 @@
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index 9ecaafe..839318a 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -135,16 +135,25 @@
+ "Move the destructor to the .cc file if it's non-trival");
+ #endif // !DCHECK_IS_ON()
+
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+- : page_id_(db_reader->page_id()),
+- db_reader_(db_reader),
+- cell_count_(ComputeCellCount(db_reader)),
+- next_read_index_(0),
+- last_record_size_(0) {
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++ DCHECK(db_reader);
+ DCHECK(IsOnValidPage(db_reader));
++ page_id_ = db_reader->page_id();
++ db_reader_ = db_reader;
++ cell_count_ = ComputeCellCount(db_reader);
++ next_read_index_ = 0;
++ last_record_size_ = 0;
+ DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+
++void LeafPageDecoder::Reset() {
++ db_reader_ = nullptr;
++ page_id_ = 0;
++ cell_count_ = 0;
++ next_read_index_ = 0;
++ last_record_size_ = 0;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index d76d076..33114b0 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -102,7 +102,7 @@
+ //
+ // |db_reader| must have been used to read an inner page of a table B-tree.
+ // |db_reader| must outlive this instance.
+- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++ explicit LeafPageDecoder() noexcept = default;
+ ~LeafPageDecoder() noexcept = default;
+
+ LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -150,6 +150,15 @@
+ // read as long as CanAdvance() returns true.
+ bool TryAdvance();
+
++ // Initialize with DatabasePageReader
++ void Initialize(DatabasePageReader* db_reader);
++
++ // Reset internal DatabasePageReader
++ void Reset();
++
++ // True if DatabasePageReader is valid
++ bool IsValid() { return (db_reader_ != nullptr); }
++
+ // True if the given reader may point to an inner page in a table B-tree.
+ //
+ // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -163,14 +172,14 @@
+ static int ComputeCellCount(DatabasePageReader* db_reader);
+
+ // The number of the B-tree page this reader is reading.
+- const int64_t page_id_;
++ int64_t page_id_;
+ // Used to read the tree page.
+ //
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the DatabasePageReader outlives this.
+- DatabasePageReader* const db_reader_;
++ DatabasePageReader* db_reader_;
+ // Caches the ComputeCellCount() value for this reader's page.
+- const int cell_count_ = ComputeCellCount(db_reader_);
++ int cell_count_;
+
+ // The reader's cursor state.
+ //
+diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
+index 0029ff9..42548bc 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -26,7 +26,7 @@
+ int VirtualCursor::First() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ inner_decoders_.clear();
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+
+ AppendPageDecoder(table_->root_page_id());
+ return Next();
+@@ -36,18 +36,18 @@
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ record_reader_.Reset();
+
+- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
+- if (leaf_decoder_.get()) {
+- if (!leaf_decoder_->CanAdvance()) {
++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
++ if (leaf_decoder_.IsValid()) {
++ if (!leaf_decoder_.CanAdvance()) {
+ // The leaf has been exhausted. Remove it from the DFS stack.
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+ continue;
+ }
+- if (!leaf_decoder_->TryAdvance())
++ if (!leaf_decoder_.TryAdvance())
+ continue;
+
+- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
+- leaf_decoder_->last_record_offset())) {
++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
++ leaf_decoder_.last_record_offset())) {
+ continue;
+ }
+ if (!record_reader_.Initialize())
+@@ -99,13 +99,13 @@
+ int64_t VirtualCursor::RowId() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(record_reader_.IsInitialized());
+- DCHECK(leaf_decoder_.get());
+- return leaf_decoder_->last_record_rowid();
++ DCHECK(leaf_decoder_.IsValid());
++ return leaf_decoder_.last_record_rowid();
+ }
+
+ void VirtualCursor::AppendPageDecoder(int page_id) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+- DCHECK(leaf_decoder_.get() == nullptr)
++ DCHECK(!leaf_decoder_.IsValid())
+ << __func__
+ << " must only be called when the current path has no leaf decoder";
+
+@@ -113,7 +113,7 @@
+ return;
+
+ if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
+- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
++ leaf_decoder_.Initialize(&db_reader_);
+ return;
+ }
+
+diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
+index afcd690..b15c31d 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -129,7 +129,7 @@
+ std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
+
+ // Decodes the leaf page containing records.
+- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
++ LeafPageDecoder leaf_decoder_;
+
+ SEQUENCE_CHECKER(sequence_checker_);
+ };
+diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
+index 58e75de..5fe9620 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@
+ "ints are not appropriate for representing page IDs");
+
+ DatabasePageReader::DatabasePageReader(VirtualTable* table)
+- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
+- table_(table) {
++ : page_data_(), table_(table) {
+ DCHECK(table != nullptr);
+ DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -57,8 +56,8 @@
+ std::numeric_limits<int64_t>::max(),
+ "The |read_offset| computation above may overflow");
+
+- int sqlite_status =
+- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++ int sqlite_status = RawRead(sqlite_file, read_size, read_offset,
++ const_cast<uint8_t*>(page_data_.data()));
+
+ // |page_id_| needs to be set to kInvalidPageId if the read failed.
+ // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 0e388ddc..99314e3 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -5,6 +5,7 @@
+ #ifndef SQL_RECOVER_MODULE_PAGER_H_
+ #define SQL_RECOVER_MODULE_PAGER_H_
+
++#include <array>
+ #include <cstdint>
+ #include <memory>
+
+@@ -70,7 +71,7 @@
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK_NE(page_id_, kInvalidPageId)
+ << "Successful ReadPage() required before accessing pager state";
+- return page_data_.get();
++ return page_data_.data();
+ }
+
+ // The number of bytes in the page read by the last ReadPage() call.
+@@ -137,7 +138,7 @@
+ int page_id_ = kInvalidPageId;
+ // Stores the bytes of the last page successfully read by ReadPage().
+ // The content is undefined if the last call to ReadPage() did not succeed.
+- const std::unique_ptr<uint8_t[]> page_data_;
++ const std::array<uint8_t, kMaxPageSize> page_data_;
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the VirtualTable outlives this.
+ VirtualTable* const table_;
diff --git a/repo/apps/chromium/chromium-launcher.sh b/repo/apps/chromium/chromium-launcher.sh
new file mode 100644
index 0000000..ceba3f2
--- /dev/null
+++ b/repo/apps/chromium/chromium-launcher.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+export DBUS_SESSION_BUS_ADDRES=unix:path=/run/dbus/system_bus_socket
+
+# 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 -t -L ${XDG_CONFIG_HOME:-${HOME}} | cut -d' ' -f5) -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/chromium" --extra-plugin-dir=/usr/lib/nsbrowser/plugins ${CHROMIUM_FLAGS} "$@"
diff --git a/repo/apps/chromium/chromium-revert-drop-of-system-java.patch b/repo/apps/chromium/chromium-revert-drop-of-system-java.patch
new file mode 100644
index 0000000..117a50f
--- /dev/null
+++ b/repo/apps/chromium/chromium-revert-drop-of-system-java.patch
@@ -0,0 +1,15 @@
+This was dropped for some reason in 6951c37cecd05979b232a39e5c10e6346a0f74ef
+--- a/third_party/closure_compiler/compiler.py 2021-05-20 04:17:53.000000000 +0200
++++ b/third_party/closure_compiler/compiler.py 2021-05-20 04:17:53.000000000 +0200
+@@ -13,8 +13,9 @@
+
+
+ _CURRENT_DIR = os.path.join(os.path.dirname(__file__))
+-_JAVA_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java")
+-assert os.path.isfile(_JAVA_PATH), "java only allowed in android builds"
++_JAVA_BIN = "java"
++_JDK_PATH = os.path.join(_CURRENT_DIR, "..", "jdk", "current", "bin", "java")
++_JAVA_PATH = _JDK_PATH if os.path.isfile(_JDK_PATH) else _JAVA_BIN
+
+ class Compiler(object):
+ """Runs the Closure compiler on given source files to typecheck them
diff --git a/repo/apps/chromium/chromium-use-alpine-target.patch b/repo/apps/chromium/chromium-use-alpine-target.patch
new file mode 100644
index 0000000..8282aca
--- /dev/null
+++ b/repo/apps/chromium/chromium-use-alpine-target.patch
@@ -0,0 +1,24 @@
+--- ./build/config/compiler/BUILD.gn
++++ ./build/config/compiler/BUILD.gn
+@@ -752,8 +752,8 @@
+ }
+ } else if (current_cpu == "arm") {
+ if (is_clang && !is_android && !is_nacl) {
+- cflags += [ "--target=arm-linux-gnueabihf" ]
+- ldflags += [ "--target=arm-linux-gnueabihf" ]
++ cflags += [ "--target=armv7-alpine-linux-musleabihf" ]
++ ldflags += [ "--target=armv7-alpine-linux-musleabihf" ]
+ }
+ if (!is_nacl) {
+ cflags += [
+@@ -766,8 +766,8 @@
+ }
+ } else if (current_cpu == "arm64") {
+ if (is_clang && !is_android && !is_nacl && !is_fuchsia) {
+- cflags += [ "--target=aarch64-linux-gnu" ]
+- ldflags += [ "--target=aarch64-linux-gnu" ]
++ cflags += [ "--target=aarch64-alpine-linux-musl" ]
++ ldflags += [ "--target=aarch64-alpine-linux-musl" ]
+ }
+ } else if (current_cpu == "mipsel" && !is_nacl) {
+ ldflags += [ "-Wl,--hash-style=sysv" ]
diff --git a/repo/apps/chromium/chromium.conf b/repo/apps/chromium/chromium.conf
new file mode 100644
index 0000000..a8b8db3
--- /dev/null
+++ b/repo/apps/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/repo/apps/chromium/chromium.desktop b/repo/apps/chromium/chromium.desktop
new file mode 100644
index 0000000..e5f549b
--- /dev/null
+++ b/repo/apps/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/repo/apps/chromium/chromium.xibuild b/repo/apps/chromium/chromium.xibuild
new file mode 100644
index 0000000..5131239
--- /dev/null
+++ b/repo/apps/chromium/chromium.xibuild
@@ -0,0 +1,284 @@
+#!/bin/sh
+
+NAME="chromium"
+DESC="Chromium webbrowser (ungoogled)"
+
+MAKEDEPS="meson ninja hwids lld pciutils"
+DEPS="alsa-lib at-spi2-atk at-spi2-core atk cairo dbus eudev expat ffmpeg4 flac font-opensans fontconfig freetype2 glib gtk3 harfbuzz lcms2 libdrm libevent libjpeg-turbo libpng pulseaudio libwebp libx11 libxcb libxcomposite libxdamage libxext libxfixes libxkbcommon libxml2 libxrandr libxslt mesa musl nspr nss opus pango re2 snappy wayland xdg-utils nodejs"
+
+PKG_VER=100.0.4896.127
+
+SOURCE="https://commondatastorage.googleapis.com/chromium-browser-official/chromium-$PKG_VER.tar.xz"
+
+fonts_package=cd96fc55dc243f6c6f4cb63ad117cad6cd48dceb
+_launcher_ver=8
+ADDITIONAL="
+https://github.com/Eloston/ungoogled-chromium/archive/$PKG_VER-1.tar.gz
+https://chromium-fonts.storage.googleapis.com/$fonts_package
+
+chromium-VirtualCursor-standard-layout.patch
+chromium-revert-drop-of-system-java.patch
+chromium-use-alpine-target.patch
+chromium.conf
+chromium-launcher.sh
+chromium.desktop
+credentials-header.patch
+default-pthread-stacksize.patch
+elf-arm.patch
+fix-narrowing-cast.patch
+fix-unittests-sandbox.patch
+gcc-arm.patch
+gdbinit.patch
+google-api.keys
+media-base.patch
+memory-tagging-arm64.patch
+musl-crashpad.patch
+musl-fixes.patch
+musl-hacks.patch
+musl-sandbox.patch
+musl-stat.patch
+musl-tid-caching.patch
+musl-v8-monotonic-pthread-cont_timedwait.patch
+nasm.patch
+no-execinfo.patch
+no-getcontext.patch
+no-mallinfo.patch
+quiche-arena-size.patch
+resolver.patch
+revert-use-ffile-compilation-dir.patch
+scoped-file.patch
+system-opus.patch
+use-deprecated-ffmpeg-api.patch
+unbundle-ffmpeg-av_stream_get_first_dts.patch
+use-oauth2-client-switches-as-default.patch
+wayland-egl.patch
+webcodecs-stop-using-AudioOpusEncoder.patch
+"
+
+prepare () {
+ apply_patches
+
+ # Congratulations, you have found a bug! The bug is in the application that uses this internal glibc header
+ files="third_party/libsync/src/include/sync/sync.h
+ third_party/crashpad/crashpad/compat/linux/sys/ptrace.h
+ base/allocator/allocator_shim_internals.h"
+ for f in $files; do
+ sed -i "s/__BEGIN_DECLS/#ifdef __cplusplus\nextern \"C\" {\n#endif/g" $f
+ sed -i "s/__END_DECLS/#ifdef __cplusplus\n}\n#endif/g" $f
+ sed -i "s,#include <sys/cdefs.h>,," $f
+ done
+
+ # prevent annoying errors when regenerating gni
+ sed -i 's,^update_readme$,#update_readme,' \
+ third_party/libvpx/generate_gni.sh
+
+ # allow system dependencies in "official builds"
+ sed -i 's/OFFICIAL_BUILD/GOOGLE_CHROME_BUILD/' \
+ tools/generate_shim_headers/generate_shim_headers.py
+
+
+ tar xf chromium-launcher-$_launcher_ver.tar.gz
+ tar xf $fonts_package
+ tar xf $PKG_VER-1.tar.gz
+ ungoogled_repo="ungoogled-chromium-$PKG_VER-1"
+ utils="${ungoogled_repo}/utils"
+
+ python "$utils/prune_binaries.py" ./ "$ungoogled_repo/pruning.list"
+ python "$utils/patches.py" apply ./ "$ungoogled_repo/patches"
+ python "$utils/domain_substitution.py" apply -r "$ungoogled_repo/domain_regex.list" \
+ -f "$ungoogled_repo/domain_substitution.list" -c domainsubcache.tar.gz ./
+
+ mv test_fonts ./third_party/test_fonts
+
+ sed 's|//third_party/usb_ids/usb.ids|/usr/share/hwdata/usb.ids|g' \
+ -i services/device/public/cpp/usb/BUILD.gn
+
+ mkdir -p third_party/node/linux/node-linux-x64/bin
+ ln -s /usr/bin/node third_party/node/linux/node-linux-x64/bin/
+
+ # Remove bundled libraries for which we will use the system copies; this
+ # *should* do what the remove_bundled_libraries.py script does, with the
+ # added benefit of not having to list all the remaining libraries
+
+ local use_system="
+ ffmpeg
+ flac
+ fontconfig
+ freetype
+ harfbuzz-ng
+ libdrm
+ libevent
+ libjpeg
+ libwebp
+ libxml
+ libxslt
+ opus
+ re2
+ snappy
+ "
+
+ local _lib
+ for _lib in ${use_system}; do
+ for f in $(find "third_party/$_lib/chromium" "third_party/$_lib/google" -type f \( -name "*.gn" -or -name "*.gni" -or -name "*.isolate" \)); do
+ echo "removing $f to use system $_lib"
+ rm $f
+ done
+ done
+
+ python build/linux/unbundle/replace_gn_files.py \
+ --system-libraries ${use_system}
+ python third_party/libaddressinput/chromium/tools/update-strings.py
+}
+
+build () {
+ #export CC=clang
+ #export CXX=clang++
+ #export LD=clang++
+ #export AR=ar
+ #export NM=nm
+ export LDFLAGS="-stdlib=libstdc++"
+
+ flags="
+custom_toolchain=\"//build/toolchain/linux/unbundle:default\"
+host_toolchain=\"//build/toolchain/linux/unbundle:default\"
+enable_nacl=false
+use_sysroot=false
+gold_path=\"/usr/bin/ld.gold\"
+use_custom_libcxx=false
+use_gold=false
+is_debug=false
+blink_symbol_level=0
+symbol_level=0
+icu_use_data_file=true
+use_allocator=\"none\"
+use_allocator_shim=false
+enable_widevine=true
+use_system_harfbuzz=false
+use_system_wayland_scanner=true
+use_cups=false
+use_gnome_keyring=false
+use_vaapi=true
+enable_js_type_check=true
+use_pulseaudio=true
+link_pulseaudio=true
+rtc_use_pipewire=true
+proprietary_codecs=false
+ffmpeg_branding=\"Chrome\"
+fatal_linker_warnings=false
+disable_fieldtrial_testing_config=true
+is_official_build=true
+is_cfi=false
+use_thin_lto=false
+use_cfi_icall=false
+chrome_pgo_phase=0
+ "
+
+ # Append ungoogled chromium flags to _flags array
+ flags="$flags
+ $(cat "ungoogled-chromium-$PKG_VER-1/flags.gn")
+ "
+
+ # Facilitate deterministic builds (taken from build/config/compiler/BUILD.gn)
+ CFLAGS="$CFLAGS -Wno-builtin-macro-redefined"
+ CXXFLAGS="$CXXFLAGS -Wno-builtin-macro-redefined"
+ CPPFLAGS="$CPPFLAGS -D__DATE__= -D__TIME__= -D__TIMESTAMP__="
+
+ # Do not warn about unknown warning options
+ CFLAGS="$CFLAGS -Wno-unknown-warning-option"
+ CXXFLAGS="$CXXFLAGS -Wno-unknown-warning-option"
+
+ python3 tools/gn/bootstrap/bootstrap.py -s -v --skip-generate-buildfiles
+
+ ./out/Release/gn gen out/Release --args="$flags"
+
+ ninja -C out/Release mksnapshot
+ ninja -C out/Release v8_context_snapshot_generator
+
+ ulimit -n 2048
+ ninja -C out/Release chrome chrome_sandbox chromedriver
+}
+
+package () {
+ install -Dm755 chromium-launcher.sh \
+ "$PKG_DEST"/usr/lib/chromium/chromium-launcher.sh
+
+ install -D out/Release/chrome "$PKG_DEST/usr/lib/chromium/chromium"
+ install -D out/Release/chromedriver "$PKG_DEST/usr/bin/chromedriver"
+ install -Dm4755 out/Release/chrome_sandbox "$PKG_DEST/usr/lib/chromium/chrome-sandbox"
+
+ install -Dm644 ../chromium-drirc-disable-10bpc-color-configs.conf \
+ "$PKG_DEST/usr/share/drirc.d/10-chromium.conf"
+
+ install -Dm644 chrome/installer/linux/common/desktop.template \
+ "$PKG_DEST/usr/share/applications/chromium.desktop"
+ install -Dm644 chrome/app/resources/manpage.1.in \
+ "$PKG_DEST/usr/share/man/man1/chromium.1"
+ sed -i \
+ -e 's/@@MENUNAME@@/Chromium/g' \
+ -e 's/@@PACKAGE@@/chromium/g' \
+ -e 's/@@USR_BIN_SYMLINK_NAME@@/chromium/g' \
+ "$PKG_DEST/usr/share/applications/chromium.desktop" \
+ "$PKG_DEST/usr/share/man/man1/chromium.1"
+
+ install -Dm644 chrome/installer/linux/common/chromium-browser/chromium-browser.appdata.xml \
+ "$PKG_DEST/usr/share/metainfo/chromium.appdata.xml"
+ sed -ni \
+ -e 's/chromium-browser\.desktop/chromium.desktop/' \
+ -e '/<update_contact>/d' \
+ -e '/<p>/N;/<p>\n.*\(We invite\|Chromium supports Vorbis\)/,/<\/p>/d' \
+ -e '/^<?xml/,$p' \
+ "$PKG_DEST/usr/share/metainfo/chromium.appdata.xml"
+
+ local toplevel_files="
+chrome_100_percent.pak
+chrome_200_percent.pak
+chrome_crashpad_handler
+resources.pak
+v8_context_snapshot.bin
+snapshot_blob.bin
+xdg-mime
+xdg-settings
+libEGL.so
+libGLESv2.so
+libvk_swiftshader.so
+vk_swiftshader_icd.json
+icudtl.dat
+libvulkan.so.1
+ "
+
+ mkdir -p "$PKG_DEST/usr/lib/chromium"
+ mkdir -p "$PKG_DEST/usr/lib/chromium/locales"
+ mkdir -p "$PKG_DEST/usr/lib/chromium/swiftshader"
+
+ for file in $toplevel_files; do
+ cp out/Release/$file "$PKG_DEST/usr/lib/chromium/"
+ done
+
+ for locale in out/Release/locales/* ; do
+ install -Dm644 $locale "$PKG_DEST/usr/lib/chromium/locales"
+ done
+ for shader in out/Release/swiftshader/*.so; do
+ install -Dm755 $shader "$PKG_DEST/usr/lib/chromium/swiftshader"
+ done
+
+ for size in 24 48 64 128 256; do
+ install -Dm644 "chrome/app/theme/chromium/product_logo_$size.png" \
+ "$PKG_DEST/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" \
+ "$PKG_DEST/usr/share/icons/hicolor/${size}x${size}/apps/chromium.png"
+ done
+
+ install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/chromium/LICENSE"
+
+ mkdir -p "$PKG_DEST"/usr/bin
+ ln -sf /usr/lib/chromium/chromium-launcher.sh "$PKG_DEST"/usr/bin/chromium-browser
+ install -Dm644 chromium.conf \
+ "$PKG_DEST"/etc/chromium/chromium.conf
+
+ install -Dm644 chromium.desktop \
+ "$PKG_DEST"/usr/share/applications/chromium.desktop
+
+}
diff --git a/repo/apps/chromium/credentials-header.patch b/repo/apps/chromium/credentials-header.patch
new file mode 100644
index 0000000..840bd2a
--- /dev/null
+++ b/repo/apps/chromium/credentials-header.patch
@@ -0,0 +1,11 @@
+--- ./sandbox/linux/services/credentials.h.orig
++++ ./sandbox/linux/services/credentials.h
+@@ -14,6 +14,8 @@
+ #include <string>
+ #include <vector>
+
++#include <sys/types.h>
++
+ #include "sandbox/linux/system_headers/capability.h"
+ #include "sandbox/sandbox_export.h"
+
diff --git a/repo/apps/chromium/default-pthread-stacksize.patch b/repo/apps/chromium/default-pthread-stacksize.patch
new file mode 100644
index 0000000..74ebc76
--- /dev/null
+++ b/repo/apps/chromium/default-pthread-stacksize.patch
@@ -0,0 +1,45 @@
+--- ./base/threading/platform_thread_linux.cc
++++ ./base/threading/platform_thread_linux.cc
+@@ -186,7 +186,8 @@
+
+ size_t GetDefaultThreadStackSize(const pthread_attr_t& attributes) {
+ #if !defined(THREAD_SANITIZER)
+- return 0;
++ // use 2mb to avoid running out of space. This is what android uses
++ return 2 * (1 << 20);
+ #else
+ // ThreadSanitizer bloats the stack heavily. Evidence has been that the
+ // default stack size isn't enough for some browser tests.
+--- ./base/threading/platform_thread_unittest.cc.orig
++++ ./base/threading/platform_thread_unittest.cc
+@@ -420,7 +420,7 @@
+ ((BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)) && \
+ !defined(THREAD_SANITIZER)) || \
+ (BUILDFLAG(IS_ANDROID) && !defined(ADDRESS_SANITIZER))
+- EXPECT_EQ(0u, stack_size);
++ EXPECT_EQ(2u << 20, stack_size);
+ #else
+ EXPECT_GT(stack_size, 0u);
+ EXPECT_LT(stack_size, 20u * (1 << 20));
+--- ./chrome/browser/shutdown_signal_handlers_posix.cc
++++ ./chrome/browser/shutdown_signal_handlers_posix.cc
+@@ -187,11 +187,19 @@
+ g_shutdown_pipe_read_fd = pipefd[0];
+ g_shutdown_pipe_write_fd = pipefd[1];
+ #if !defined(ADDRESS_SANITIZER)
++# if defined(__GLIBC__)
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2;
++# else
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 2 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++# endif
+ #else
++# if defined(__GLIBC__)
+ // ASan instrumentation bloats the stack frames, so we need to increase the
+ // stack size to avoid hitting the guard page.
+ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4;
++# else
++ const size_t kShutdownDetectorThreadStackSize = PTHREAD_STACK_MIN * 4 * 8; // match up musls 2k PTHREAD_STACK_MIN with glibcs 16k
++# endif
+ #endif
+ ShutdownDetector* detector = new ShutdownDetector(
+ g_shutdown_pipe_read_fd, std::move(shutdown_callback), task_runner);
diff --git a/repo/apps/chromium/elf-arm.patch b/repo/apps/chromium/elf-arm.patch
new file mode 100644
index 0000000..3799dc9
--- /dev/null
+++ b/repo/apps/chromium/elf-arm.patch
@@ -0,0 +1,11 @@
+--- ./v8/src/base/cpu.cc.orig
++++ ./v8/src/base/cpu.cc
+@@ -16,7 +16,7 @@
+ #if V8_OS_QNX
+ #include <sys/syspage.h> // cpuinfo
+ #endif
+-#if V8_OS_LINUX && (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64)
++#if V8_OS_LINUX && (V8_HOST_ARCH_PPC || V8_HOST_ARCH_PPC64 || V8_HOST_ARCH_ARM)
+ #include <elf.h>
+ #endif
+ #if V8_OS_AIX
diff --git a/repo/apps/chromium/enable-GlobalMediaControlsCastStartStop.patch b/repo/apps/chromium/enable-GlobalMediaControlsCastStartStop.patch
new file mode 100644
index 0000000..e0d4544
--- /dev/null
+++ b/repo/apps/chromium/enable-GlobalMediaControlsCastStartStop.patch
@@ -0,0 +1,32 @@
+From b58f0f2725a8c1a8a131f9984b5fd53b54119dba Mon Sep 17 00:00:00 2001
+From: Muyao Xu <muyaoxu@google.com>
+Date: Thu, 20 Jan 2022 23:46:21 +0000
+Subject: [PATCH] [Zenith] Enable GlobalMediaControlsCastStartStop flag by
+ default
+
+The feature is rolled out to 100% stable through finch for M96+.
+This CL enables it by default and fixes some unit tests failures.
+
+Bug: 1287242, 1287305
+Change-Id: I7e5c9625b77379fef253c41ef292a0dd6fc366fb
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3388416
+Reviewed-by: Takumi Fujimoto <takumif@chromium.org>
+Commit-Queue: Muyao Xu <muyaoxu@google.com>
+Cr-Commit-Position: refs/heads/main@{#961658}
+---
+ chrome/browser/media/router/media_router_feature.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/chrome/browser/media/router/media_router_feature.cc b/chrome/browser/media/router/media_router_feature.cc
+index f28f9b0b802..a8d544f7d6d 100644
+--- a/chrome/browser/media/router/media_router_feature.cc
++++ b/chrome/browser/media/router/media_router_feature.cc
+@@ -33,7 +33,7 @@ const base::Feature kMediaRouter{"MediaRouter",
+ const base::Feature kCastAllowAllIPsFeature{"CastAllowAllIPs",
+ base::FEATURE_DISABLED_BY_DEFAULT};
+ const base::Feature kGlobalMediaControlsCastStartStop{
+- "GlobalMediaControlsCastStartStop", base::FEATURE_DISABLED_BY_DEFAULT};
++ "GlobalMediaControlsCastStartStop", base::FEATURE_ENABLED_BY_DEFAULT};
+ const base::Feature kAllowAllSitesToInitiateMirroring{
+ "AllowAllSitesToInitiateMirroring", base::FEATURE_DISABLED_BY_DEFAULT};
+ const base::Feature kDialMediaRouteProvider{"DialMediaRouteProvider",
diff --git a/repo/apps/chromium/fix-narrowing-cast.patch b/repo/apps/chromium/fix-narrowing-cast.patch
new file mode 100644
index 0000000..afd42a1
--- /dev/null
+++ b/repo/apps/chromium/fix-narrowing-cast.patch
@@ -0,0 +1,53 @@
+--- a/base/files/file_util_linux.cc
++++ b/base/files/file_util_linux.cc
+@@ -23,14 +23,14 @@
+
+ // Not all possible |statfs_buf.f_type| values are in linux/magic.h.
+ // Missing values are copied from the statfs man page.
+- switch (statfs_buf.f_type) {
++ switch (static_cast<uintmax_t>(statfs_buf.f_type)) {
+ case 0:
+ *type = FILE_SYSTEM_0;
+ break;
+ case EXT2_SUPER_MAGIC: // Also ext3 and ext4
+ case MSDOS_SUPER_MAGIC:
+ case REISERFS_SUPER_MAGIC:
+- case static_cast<int>(BTRFS_SUPER_MAGIC):
++ case BTRFS_SUPER_MAGIC:
+ case 0x5346544E: // NTFS
+ case 0x58465342: // XFS
+ case 0x3153464A: // JFS
+@@ -40,14 +40,14 @@
+ *type = FILE_SYSTEM_NFS;
+ break;
+ case SMB_SUPER_MAGIC:
+- case static_cast<int>(0xFF534D42): // CIFS
++ case 0xFF534D42: // CIFS
+ *type = FILE_SYSTEM_SMB;
+ break;
+ case CODA_SUPER_MAGIC:
+ *type = FILE_SYSTEM_CODA;
+ break;
+- case static_cast<int>(HUGETLBFS_MAGIC):
+- case static_cast<int>(RAMFS_MAGIC):
++ case HUGETLBFS_MAGIC:
++ case RAMFS_MAGIC:
+ case TMPFS_MAGIC:
+ *type = FILE_SYSTEM_MEMORY;
+ break;
+--- a/base/system/sys_info_posix.cc
++++ b/base/system/sys_info_posix.cc
+@@ -100,10 +100,10 @@
+ if (HANDLE_EINTR(statfs(path.value().c_str(), &stats)) != 0)
+ return false;
+
+- switch (stats.f_type) {
++ switch (static_cast<uintmax_t>(stats.f_type)) {
+ case TMPFS_MAGIC:
+- case static_cast<int>(HUGETLBFS_MAGIC):
+- case static_cast<int>(RAMFS_MAGIC):
++ case HUGETLBFS_MAGIC:
++ case RAMFS_MAGIC:
+ return true;
+ }
+ return false;
diff --git a/repo/apps/chromium/fix-unittests-sandbox.patch b/repo/apps/chromium/fix-unittests-sandbox.patch
new file mode 100644
index 0000000..e11face
--- /dev/null
+++ b/repo/apps/chromium/fix-unittests-sandbox.patch
@@ -0,0 +1,11 @@
+--- ./sandbox/linux/syscall_broker/broker_file_permission_unittest.cc.orig
++++ ./sandbox/linux/syscall_broker/broker_file_permission_unittest.cc
+@@ -134,7 +134,7 @@
+ #endif
+
+ const int kNumberOfBitsInOAccMode = 2;
+- static_assert(O_ACCMODE == ((1 << kNumberOfBitsInOAccMode) - 1),
++ static_assert(O_ACCMODE == (((1 << kNumberOfBitsInOAccMode) - 1) | O_PATH),
+ "incorrect number of bits");
+ // check every possible flag and act accordingly.
+ // Skipping AccMode bits as they are present in every case.
diff --git a/repo/apps/chromium/gcc-arm.patch b/repo/apps/chromium/gcc-arm.patch
new file mode 100644
index 0000000..9eaa240
--- /dev/null
+++ b/repo/apps/chromium/gcc-arm.patch
@@ -0,0 +1,11 @@
+--- ./third_party/zlib/BUILD.gn.orig
++++ ./third_party/zlib/BUILD.gn
+@@ -21,7 +21,7 @@
+ !(is_win && !is_clang)) {
+ # TODO(richard.townsend@arm.com): Optimizations temporarily disabled for
+ # Windows on Arm MSVC builds, see http://crbug.com/v8/10012.
+- if (arm_use_neon) {
++ if (arm_use_neon && is_clang) {
+ use_arm_neon_optimizations = true
+ }
+ }
diff --git a/repo/apps/chromium/gdbinit.patch b/repo/apps/chromium/gdbinit.patch
new file mode 100644
index 0000000..39d3464
--- /dev/null
+++ b/repo/apps/chromium/gdbinit.patch
@@ -0,0 +1,21 @@
+--- ./tools/gdb/gdbinit.orig
++++ ./tools/gdb/gdbinit
+@@ -50,17 +50,7 @@
+
+ def set_src_dir(compile_dir):
+ global src_dir
+- git = subprocess.Popen(
+- ['git', '-C', compile_dir, 'rev-parse', '--show-toplevel'],
+- stdout=subprocess.PIPE,
+- stderr=subprocess.PIPE)
+- src_dir, _ = git.communicate()
+- if git.returncode:
+- return
+- if isinstance(src_dir, str):
+- src_dir = src_dir.rstrip()
+- else:
+- src_dir = src_dir.decode('utf-8').rstrip()
++ src_dir = os.path.abspath(os.getcwd())
+
+ load_libcxx_pretty_printers(src_dir)
+
diff --git a/repo/apps/chromium/google-api.keys b/repo/apps/chromium/google-api.keys
new file mode 100644
index 0000000..8cd0f0a
--- /dev/null
+++ b/repo/apps/chromium/google-api.keys
@@ -0,0 +1,10 @@
+IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
+IyMjIyMKIyBQbGVhc2UgZG9udCB1c2UgdGhlc2Uga2V5cyBvdXRzaWRlIG9mIEFscGluZSBMaW51
+eCBwcm9qZWN0ICMKIyBZb3UgY2FuIGNyZWF0ZSB5b3VyIG93biBhdDogICAgICAgICAgICAgICAg
+ICAgICAgICAgICAgICAgICMKIyBodHRwOi8vd3d3LmNocm9taXVtLm9yZy9kZXZlbG9wZXJzL2hv
+dy10b3MvYXBpLWtleXMgICAgICAgICMKIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMj
+IyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMKX2dvb2dsZV9hcGlfa2V5PSJBSXphU3lDUkk0
+RUdwRHVfQUFISThFMnllbmpWaFdRZHA0RzhpZ2MiCl9nb29nbGVfZGVmYXVsdF9jbGllbnRfaWQ9
+IjQ5NzU1MDYyMjM2Ny11YnRrbWQzYjJwcDVndWxiYTVuNmhhNnNxNG4zNWVoai5hcHBzLmdvb2ds
+ZXVzZXJjb250ZW50LmNvbSIKX2dvb2dsZV9kZWZhdWx0X2NsaWVudF9zZWNyZXQ9Ik5hQ1g4dElJ
+QXBocmpzNTZuM1RwSHhfZSIKCg==
diff --git a/repo/apps/chromium/media-base.patch b/repo/apps/chromium/media-base.patch
new file mode 100644
index 0000000..99b881f
--- /dev/null
+++ b/repo/apps/chromium/media-base.patch
@@ -0,0 +1,10 @@
+--- ./media/base/subsample_entry.h
++++ ./media/base/subsample_entry.h
+@@ -9,6 +9,7 @@
+ #include <stdint.h>
+
+ #include <vector>
++#include <cstddef>
+
+ #include "media/base/media_export.h"
+
diff --git a/repo/apps/chromium/memory-tagging-arm64.patch b/repo/apps/chromium/memory-tagging-arm64.patch
new file mode 100644
index 0000000..6072698
--- /dev/null
+++ b/repo/apps/chromium/memory-tagging-arm64.patch
@@ -0,0 +1,18 @@
+--- ./base/allocator/partition_allocator/tagging.cc.orig
++++ ./base/allocator/partition_allocator/tagging.cc
+@@ -19,15 +19,6 @@
+ #define PR_GET_TAGGED_ADDR_CTRL 56
+ #define PR_TAGGED_ADDR_ENABLE (1UL << 0)
+
+-#if BUILDFLAG(IS_LINUX)
+-#include <linux/version.h>
+-
+-// Linux headers already provide these since v5.10.
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
+-#define HAS_PR_MTE_MACROS
+-#endif
+-#endif
+-
+ #ifndef HAS_PR_MTE_MACROS
+ #define PR_MTE_TCF_SHIFT 1
+ #define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
diff --git a/repo/apps/chromium/musl-crashpad.patch b/repo/apps/chromium/musl-crashpad.patch
new file mode 100644
index 0000000..387deea
--- /dev/null
+++ b/repo/apps/chromium/musl-crashpad.patch
@@ -0,0 +1,25 @@
+diff --git a/third_party/crashpad/crashpad/util/linux/ptracer.cc b/third_party/crashpad/crashpad/util/linux/ptracer.cc
+index c6c9229..a5336b6 100644
+--- ./third_party/crashpad/crashpad/util/linux/ptracer.cc
++++ ./third_party/crashpad/crashpad/util/linux/ptracer.cc
+@@ -26,6 +26,7 @@
+
+ #if defined(ARCH_CPU_X86_FAMILY)
+ #include <asm/ldt.h>
++#include <asm/ptrace-abi.h>
+ #endif
+
+ namespace crashpad {
+diff --git a/third_party/crashpad/crashpad/util/linux/thread_info.h b/third_party/crashpad/crashpad/util/linux/thread_info.h
+index 5b55c24..08cec52 100644
+--- ./third_party/crashpad/crashpad/util/linux/thread_info.h
++++ ./third_party/crashpad/crashpad/util/linux/thread_info.h
+@@ -273,7 +273,7 @@ union FloatContext {
+ "Size mismatch");
+ #elif defined(ARCH_CPU_ARMEL)
+ static_assert(sizeof(f32_t::fpregs) == sizeof(user_fpregs), "Size mismatch");
+-#if !defined(__GLIBC__)
++#if defined(OS_ANDROID)
+ static_assert(sizeof(f32_t::vfp) == sizeof(user_vfp), "Size mismatch");
+ #endif
+ #elif defined(ARCH_CPU_ARM64)
diff --git a/repo/apps/chromium/musl-fixes.patch b/repo/apps/chromium/musl-fixes.patch
new file mode 100644
index 0000000..da2c115
--- /dev/null
+++ b/repo/apps/chromium/musl-fixes.patch
@@ -0,0 +1,221 @@
+--- ./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
+--- ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h.orig
++++ ./third_party/breakpad/breakpad/src/client/linux/dump_writer_common/ucontext_reader.h
+@@ -37,6 +37,10 @@
+ #include "common/memory.h"
+ #include "google_breakpad/common/minidump_format.h"
+
++#if !defined(__GLIBC__)
++ #define _libc_fpstate _fpstate
++#endif
++
+ namespace google_breakpad {
+
+ // Wraps platform-dependent implementations of accessors to ucontext_t structs.
+--- ./third_party/breakpad/breakpad/src/common/linux/elf_core_dump.h.orig
++++ ./third_party/breakpad/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"
+
+--- ./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 2020-04-12 08:26:40.184159217 -0400
++++ ./sandbox/linux/seccomp-bpf/trap.cc 2020-04-12 08:46:16.737191222 -0400
+@@ -174,7 +174,7 @@
+ // If the version of glibc doesn't include this information in
+ // siginfo_t (older than 2.17), we need to explicitly copy it
+ // into an arch_sigsys structure.
+- memcpy(&sigsys, &info->_sifields, sizeof(sigsys));
++ memcpy(&sigsys, &info->__sifields, sizeof(sigsys));
+ #endif
+
+ #if defined(__mips__)
+diff --git a/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc b/chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+--- ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc.orig
++++ ./chrome/browser/metrics/chrome_browser_main_extra_parts_metrics.cc
+@@ -59,7 +59,9 @@
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+ #if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(__GLIBC__)
+ #include <gnu/libc-version.h>
++#endif
+
+ #include "base/linux_util.h"
+ #include "base/strings/string_split.h"
+@@ -321,7 +323,7 @@
+ void RecordLinuxGlibcVersion() {
+ // TODO(crbug.com/1052397): Revisit the macro expression once build flag switch
+ // of lacros-chrome is complete.
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)
++#if defined(__GLIBC__) || BUILDFLAG(IS_CHROMEOS_LACROS)
+ base::Version version(gnu_get_libc_version());
+
+ UMALinuxGlibcVersion glibc_version_result = UMA_LINUX_GLIBC_NOT_PARSEABLE;
+--- ./services/device/serial/serial_io_handler_posix.cc.orig 2019-07-03 10:57:32.568171835 -0400
++++ ./services/device/serial/serial_io_handler_posix.cc 2019-07-03 10:57:16.867983031 -0400
+@@ -6,6 +6,7 @@
+
+ #include <sys/ioctl.h>
+ #include <termios.h>
++#include <asm-generic/ioctls.h>
+
+ #include <algorithm>
+ #include <utility>
+diff --git a/third_party/ots/include/opentype-sanitiser.h b/third_party/ots/include/opentype-sanitiser.h
+--- ./third_party/ots/src/include/opentype-sanitiser.h
++++ ./third_party/ots/src/include/opentype-sanitiser.h
+@@ -20,6 +20,7 @@ typedef unsigned __int64 uint64_t;
+ #define htonl(x) _byteswap_ulong (x)
+ #define htons(x) _byteswap_ushort (x)
+ #else
++#include <sys/types.h>
+ #include <arpa/inet.h>
+ #include <stdint.h>
+ #endif
+--- ./base/logging.cc.orig
++++ ./base/logging.cc
+@@ -592,8 +592,7 @@
+
+ LogMessage::~LogMessage() {
+ size_t stack_start = stream_.tellp();
+-#if !defined(OFFICIAL_BUILD) && !BUILDFLAG(IS_NACL) && !defined(__UCLIBC__) && \
+- !BUILDFLAG(IS_AIX)
++#if !defined(OFFICIAL_BUILD) && !defined(OS_NACL) && defined(__GLIBC__)
+ if (severity_ == LOGGING_FATAL && !base::debug::BeingDebugged()) {
+ // Include a stack trace on a fatal, unless a debugger is attached.
+ base::debug::StackTrace stack_trace;
+--- ./third_party/blink/renderer/platform/wtf/stack_util.cc.orig
++++ ./third_party/blink/renderer/platform/wtf/stack_util.cc
+@@ -28,7 +28,7 @@
+ // FIXME: On Mac OSX and Linux, this method cannot estimate stack size
+ // correctly for the main thread.
+
+-#elif defined(__GLIBC__) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || \
++#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || \
+ BUILDFLAG(IS_FUCHSIA)
+ // pthread_getattr_np() can fail if the thread is not invoked by
+ // pthread_create() (e.g., the main thread of blink_unittests).
+@@ -96,7 +96,7 @@
+ }
+
+ void* GetStackStart() {
+-#if defined(__GLIBC__) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || \
++#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_ANDROID) || BUILDFLAG(IS_FREEBSD) || \
+ BUILDFLAG(IS_FUCHSIA)
+ pthread_attr_t attr;
+ int error;
+--- ./third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc.orig 2019-06-18 11:51:17.000000000 -0400
++++ ./third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Signals.inc 2019-07-03 12:32:50.938758186 -0400
+@@ -25,7 +25,7 @@
+ #include "llvm/Support/raw_ostream.h"
+ #include <algorithm>
+ #include <string>
+-#if HAVE_EXECINFO_H
++#if HAVE_EXECINFO_H && defined(__GLIBC__)
+ # include <execinfo.h> // For backtrace().
+ #endif
+ #if HAVE_SIGNAL_H
+@@ -52,6 +52,7 @@
+ #include <unwind.h>
+ #else
+ #undef HAVE__UNWIND_BACKTRACE
++#undef HAVE_BACKTRACE
+ #endif
+ #endif
+
+--- ./third_party/nasm/nasmlib/realpath.c.orig 2019-07-03 12:23:05.021949895 -0400
++++ ./third_party/nasm/nasmlib/realpath.c 2019-07-03 12:24:24.246862665 -0400
+@@ -49,7 +49,7 @@
+
+ #include "nasmlib.h"
+
+-#ifdef HAVE_CANONICALIZE_FILE_NAME
++#if defined(__GLIBC__)
+
+ /*
+ * GNU-specific, but avoids the realpath(..., NULL)
+--- ./third_party/perfetto/include/perfetto/ext/base/thread_utils.h
++++ ./third_party/perfetto/include/perfetto/ext/base/thread_utils.h
+@@ -29,7 +29,7 @@
+ #include <algorithm>
+ #endif
+
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if 1
+ #include <sys/prctl.h>
+ #endif
+
+@@ -58,7 +58,7 @@ inline bool MaybeSetThreadName(const std::string& name) {
+
+ inline bool GetThreadName(std::string& out_result) {
+ char buf[16] = {};
+-#if PERFETTO_BUILDFLAG(PERFETTO_OS_ANDROID)
++#if 1
+ if (prctl(PR_GET_NAME, buf) != 0)
+ return false;
+ #else
+--- ./net/dns/public/scoped_res_state.cc.orig
++++ ./net/dns/public/scoped_res_state.cc
+@@ -13,7 +13,7 @@
+ namespace net {
+
+ ScopedResState::ScopedResState() {
+-#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA)
++#if BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_FUCHSIA) || 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));
+@@ -25,16 +25,8 @@
+ }
+
+ ScopedResState::~ScopedResState() {
+-#if !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
+-
+- // Prefer res_ndestroy where available.
+-#if BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+- res_ndestroy(&res_);
+-#else
+- res_nclose(&res_);
+-#endif // BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_FREEBSD)
+-
+-#endif // !BUILDFLAG(IS_OPENBSD) && !BUILDFLAG(IS_FUCHSIA)
++ // musl res_init() doesn't actually do anything
++ // no destruction is necessary as no memory has been allocated
+ }
+
+ bool ScopedResState::IsValid() const {
diff --git a/repo/apps/chromium/musl-hacks.patch b/repo/apps/chromium/musl-hacks.patch
new file mode 100644
index 0000000..93db25a
--- /dev/null
+++ b/repo/apps/chromium/musl-hacks.patch
@@ -0,0 +1,98 @@
+--- ./base/debug/stack_trace.cc
++++ ./base/debug/stack_trace.cc
+@@ -168,7 +168,7 @@
+
+ #if BUILDFLAG(CAN_UNWIND_WITH_FRAME_POINTERS)
+ uintptr_t GetStackEnd() {
+-#if BUILDFLAG(IS_ANDROID)
++#if BUILDFLAG(IS_ANDROID) || (defined(OS_LINUX) && !defined(__GLIBC__))
+ // Bionic reads proc/maps on every call to pthread_getattr_np() when called
+ // from the main thread. So we need to cache end of stack in that case to get
+ // acceptable performance.
+@@ -234,8 +234,10 @@
+ defined(MEMORY_SANITIZER)
+ // Sanitizer configurations (ASan, TSan, MSan) emit unsymbolized stacks.
+ return false;
+-#else
++#elif defined(__GLIBC__)
+ return true;
++#else
++ return false;
+ #endif
+ }
+
+@@ -251,7 +253,9 @@
+ }
+
+ void StackTrace::OutputToStream(std::ostream* os) const {
++#if defined(__GLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(os, nullptr);
++#endif
+ }
+
+ std::string StackTrace::ToString() const {
+@@ -259,7 +263,7 @@
+ }
+ std::string StackTrace::ToStringWithPrefix(const char* prefix_string) const {
+ std::stringstream stream;
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ OutputToStreamWithPrefix(&stream, prefix_string);
+ #endif
+ return stream.str();
+--- ./net/socket/udp_socket_posix.cc
++++ ./net/socket/udp_socket_posix.cc
+@@ -1191,7 +1191,7 @@
+ msg_iov->push_back({const_cast<char*>(buffer->data()), buffer->length()});
+ msgvec->reserve(buffers.size());
+ for (size_t j = 0; j < buffers.size(); j++)
+- msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, nullptr, 0, 0}, 0});
++ msgvec->push_back({{nullptr, 0, &msg_iov[j], 1, 0, 0, 0}, 0});
+ int result = HANDLE_EINTR(Sendmmsg(fd, &msgvec[0], buffers.size(), 0));
+ SendResult send_result(0, 0, std::move(buffers));
+ if (result < 0) {
+--- ./base/debug/elf_reader.cc.orig
++++ ./base/debug/elf_reader.cc
+@@ -149,7 +149,12 @@
+ strtab_addr = static_cast<size_t>(dynamic_iter->d_un.d_ptr) +
+ reinterpret_cast<const char*>(relocation_offset);
+ #else
+- strtab_addr = reinterpret_cast<const char*>(dynamic_iter->d_un.d_ptr);
++ if (dynamic_iter->d_un.d_ptr < relocation_offset) {
++ strtab_addr = static_cast<size_t>(dynamic_iter->d_un.d_ptr) +
++ reinterpret_cast<const char*>(relocation_offset);
++ } else {
++ strtab_addr = reinterpret_cast<const char*>(dynamic_iter->d_un.d_ptr);
++ }
+ #endif
+ } else if (dynamic_iter->d_tag == DT_SONAME) {
+ soname_strtab_offset = dynamic_iter->d_un.d_val;
+--- ./mojo/public/c/system/thunks.cc.orig
++++ ./mojo/public/c/system/thunks.cc
+@@ -100,7 +100,8 @@
+ base::ScopedAllowBlocking allow_blocking;
+ base::NativeLibraryOptions library_options;
+ #if !defined(ADDRESS_SANITIZER) && !defined(THREAD_SANITIZER) && \
+- !defined(MEMORY_SANITIZER) && !defined(LEAK_SANITIZER)
++ !defined(MEMORY_SANITIZER) && !defined(LEAK_SANITIZER) && \
++ defined(RTLD_DEEPBIND)
+ // Sanitizer builds cannnot support RTLD_DEEPBIND, but they also disable
+ // allocator shims, so it's unnecessary there.
+ library_options.prefer_own_symbols = true;
+--- ./base/native_library_unittest.cc.orig
++++ ./base/native_library_unittest.cc
+@@ -121,6 +121,7 @@
+ #if !defined(OS_ANDROID) && !defined(THREAD_SANITIZER) && \
+ !defined(MEMORY_SANITIZER)
+
++#if defined(RTLD_DEEPBIND)
+ // Verifies that the |prefer_own_symbols| option satisfies its guarantee that
+ // a loaded library will always prefer local symbol resolution before
+ // considering global symbols.
+@@ -156,6 +157,7 @@
+ EXPECT_EQ(2, NativeLibraryTestIncrement());
+ EXPECT_EQ(3, NativeLibraryTestIncrement());
+ }
++#endif // defined(RTLD_DEEPBIND)
+
+ #endif // !defined(OS_ANDROID)
diff --git a/repo/apps/chromium/musl-sandbox.patch b/repo/apps/chromium/musl-sandbox.patch
new file mode 100644
index 0000000..4fe0098
--- /dev/null
+++ b/repo/apps/chromium/musl-sandbox.patch
@@ -0,0 +1,176 @@
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+index ff5a1c0..da56b9b 100644
+--- a/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc
+@@ -139,21 +139,11 @@ namespace sandbox {
+ // present (as in newer versions of posix_spawn).
+ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ const Arg<unsigned long> flags(0);
+-
+- // 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 =
+- AnyOf(flags == kAndroidCloneMask, flags == kObsoleteAndroidCloneMask,
+- flags == kGlibcPthreadFlags);
++ 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;
+
+ // The following two flags are the two important flags in any vfork-emulating
+ // clone call. EPERM any clone call that contains both of them.
+@@ -163,7 +153,7 @@ ResultExpr RestrictCloneToThreadsAndEPERMFork() {
+ AnyOf((flags & (CLONE_VM | CLONE_THREAD)) == 0,
+ (flags & kImportantCloneVforkFlags) == kImportantCloneVforkFlags);
+
+- return If(IsAndroid() ? android_test : glibc_test, Allow())
++ return If(thread_clone_ok, Allow())
+ .ElseIf(is_fork_or_clone_vfork, Error(EPERM))
+ .Else(CrashSIGSYSClone());
+ }
+diff --git a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+index d9d1882..0567557 100644
+--- a/sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
++++ ./sandbox/linux/seccomp-bpf-helpers/syscall_sets.cc
+@@ -392,6 +392,7 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__)
+ case __NR_waitpid:
+ #endif
++ case __NR_set_tid_address:
+ return true;
+ case __NR_clone: // Should be parameter-restricted.
+ case __NR_setns: // Privileged.
+@@ -404,7 +405,6 @@ bool SyscallSets::IsAllowedProcessStartOrDeath(int sysno) {
+ #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
+ case __NR_set_thread_area:
+ #endif
+- case __NR_set_tid_address:
+ case __NR_unshare:
+ #if !defined(__mips__) && !defined(__aarch64__)
+ case __NR_vfork:
+@@ -514,6 +514,8 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_mlock:
+ case __NR_munlock:
+ case __NR_munmap:
++ case __NR_mremap:
++ case __NR_membarrier:
+ return true;
+ case __NR_madvise:
+ case __NR_mincore:
+@@ -531,7 +533,6 @@ bool SyscallSets::IsAllowedAddressSpaceAccess(int sysno) {
+ case __NR_modify_ldt:
+ #endif
+ case __NR_mprotect:
+- case __NR_mremap:
+ case __NR_msync:
+ case __NR_munlockall:
+ case __NR_readahead:
+diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+index 59d0eab..7ae7002 100644
+--- a/sandbox/linux/system_headers/arm64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm64_linux_syscalls.h
+@@ -1063,4 +1063,8 @@
+ #define __NR_memfd_create 279
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 283
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h ./sandbox/linux/system_headers/arm_linux_syscalls.h
+index 1addd53..7843b5e 100644
+--- a/sandbox/linux/system_headers/arm_linux_syscalls.h
++++ ./sandbox/linux/system_headers/arm_linux_syscalls.h
+@@ -1385,6 +1385,10 @@
+ #define __NR_memfd_create (__NR_SYSCALL_BASE+385)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_SYSCALL_BASE+389)
++#endif
++
+ // ARM private syscalls.
+ #if !defined(__ARM_NR_BASE)
+ #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
+diff --git a/sandbox/linux/system_headers/linux_syscalls.h ./sandbox/linux/system_headers/linux_syscalls.h
+index 2b78a0c..b6fedb5 100644
+--- a/sandbox/linux/system_headers/linux_syscalls.h
++++ ./sandbox/linux/system_headers/linux_syscalls.h
+@@ -10,6 +10,7 @@
+ #define SANDBOX_LINUX_SYSTEM_HEADERS_LINUX_SYSCALLS_H_
+
+ #include "build/build_config.h"
++#include <sys/syscall.h>
+
+ #if defined(__x86_64__)
+ #include "sandbox/linux/system_headers/x86_64_linux_syscalls.h"
+diff --git a/sandbox/linux/system_headers/mips64_linux_syscalls.h ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+index ec75815..5515270 100644
+--- a/sandbox/linux/system_headers/mips64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips64_linux_syscalls.h
+@@ -1271,4 +1271,8 @@
+ #define __NR_memfd_create (__NR_Linux + 314)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux 318)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS64_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/mips_linux_syscalls.h ./sandbox/linux/system_headers/mips_linux_syscalls.h
+index ddbf97f..ad3d64b 100644
+--- a/sandbox/linux/system_headers/mips_linux_syscalls.h
++++ ./sandbox/linux/system_headers/mips_linux_syscalls.h
+@@ -1433,4 +1433,8 @@
+ #define __NR_memfd_create (__NR_Linux + 354)
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier (__NR_Linux 358)
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_MIPS_LINUX_SYSCALLS_H_
+diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+index b0ae0a2..8b12029 100644
+--- a/sandbox/linux/system_headers/x86_64_linux_syscalls.h
++++ ./sandbox/linux/system_headers/x86_64_linux_syscalls.h
+@@ -1350,5 +1350,9 @@
+ #define __NR_rseq 334
+ #endif
+
++#if !defined(__NR_membarrier)
++#define __NR_membarrier 324
++#endif
++
+ #endif // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
+
+diff --git a/services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc ./services/service_manager/sandbox/linux/bpf_renderer_policy_linux.cc
+index a85c0ea..715aa1e 100644
+--- a/sandbox/policy/linux/bpf_renderer_policy_linux.cc
++++ ./sandbox/policy/linux/bpf_renderer_policy_linux.cc
+@@ -93,11 +93,11 @@
+ case __NR_sysinfo:
+ case __NR_times:
+ case __NR_uname:
+- return Allow();
+- case __NR_sched_getaffinity:
+ case __NR_sched_getparam:
+ case __NR_sched_getscheduler:
+ case __NR_sched_setscheduler:
++ return Allow();
++ case __NR_sched_getaffinity:
+ return RestrictSchedTarget(GetPolicyPid(), sysno);
+ case __NR_prlimit64:
+ // See crbug.com/662450 and setrlimit comment above.
+
diff --git a/repo/apps/chromium/musl-stat.patch b/repo/apps/chromium/musl-stat.patch
new file mode 100644
index 0000000..5a6036a
--- /dev/null
+++ b/repo/apps/chromium/musl-stat.patch
@@ -0,0 +1,12 @@
+--- a/base/files/file.h.orig
++++ b/base/files/file.h
+@@ -19,7 +19,8 @@
+ #include "build/build_config.h"
+
+ #if BUILDFLAG(IS_BSD) || BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_NACL) || \
+- BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21)
++ BUILDFLAG(IS_FUCHSIA) || (BUILDFLAG(IS_ANDROID) && __ANDROID_API__ < 21) || \
++ (defined(OS_LINUX) && !defined(__GLIBC__))
+ struct stat;
+ namespace base {
+ typedef struct stat stat_wrapper_t;
diff --git a/repo/apps/chromium/musl-tid-caching.patch b/repo/apps/chromium/musl-tid-caching.patch
new file mode 100644
index 0000000..bb83038
--- /dev/null
+++ b/repo/apps/chromium/musl-tid-caching.patch
@@ -0,0 +1,81 @@
+--- ./sandbox/linux/services/namespace_sandbox.cc.orig
++++ ./sandbox/linux/services/namespace_sandbox.cc
+@@ -209,6 +209,70 @@
+ return base::LaunchProcess(argv, launch_options_copy);
+ }
+
++#if defined(__aarch64__)
++#define TLS_ABOVE_TP
++#endif
++
++struct musl_pthread
++{
++ /* Part 1 -- these fields may be external or
++ * internal (accessed via asm) ABI. Do not change. */
++ struct pthread *self;
++#ifndef TLS_ABOVE_TP
++ uintptr_t *dtv;
++#endif
++ struct pthread *prev, *next; /* non-ABI */
++ uintptr_t sysinfo;
++#ifndef TLS_ABOVE_TP
++#ifdef CANARY_PAD
++ uintptr_t canary_pad;
++#endif
++ uintptr_t canary;
++#endif
++
++/* Part 2 -- implementation details, non-ABI. */
++ int tid;
++ int errno_val;
++ volatile int detach_state;
++ volatile int cancel;
++ volatile unsigned char canceldisable, cancelasync;
++ unsigned char tsd_used:1;
++ unsigned char dlerror_flag:1;
++ unsigned char *map_base;
++ size_t map_size;
++ void *stack;
++ size_t stack_size;
++ size_t guard_size;
++ void *result;
++ struct __ptcb *cancelbuf;
++ void **tsd;
++ struct {
++ volatile void *volatile head;
++ long off;
++ volatile void *volatile pending;
++ } robust_list;
++ int h_errno_val;
++ volatile int timer_id;
++ locale_t locale;
++ volatile int killlock[1];
++ char *dlerror_buf;
++ void *stdio_locks;
++
++ /* Part 3 -- the positions of these fields relative to
++ * the end of the structure is external and internal ABI. */
++#ifdef TLS_ABOVE_TP
++ uintptr_t canary;
++ uintptr_t *dtv;
++#endif
++};
++
++void MaybeUpdateMuslTidCache()
++{
++ pid_t real_tid = sys_gettid();
++ pid_t* cached_tid_location = &reinterpret_cast<struct musl_pthread*>(pthread_self())->tid;
++ *cached_tid_location = real_tid;
++}
++
+ // static
+ pid_t NamespaceSandbox::ForkInNewPidNamespace(bool drop_capabilities_in_child) {
+ const pid_t pid =
+@@ -226,6 +290,7 @@
+ #if defined(LIBC_GLIBC)
+ MaybeUpdateGlibcTidCache();
+ #endif
++ MaybeUpdateMuslTidCache();
+ return 0;
+ }
+
diff --git a/repo/apps/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch b/repo/apps/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch
new file mode 100644
index 0000000..768027d
--- /dev/null
+++ b/repo/apps/chromium/musl-v8-monotonic-pthread-cont_timedwait.patch
@@ -0,0 +1,22 @@
+Use monotonic clock for pthread_cond_timedwait with musl too.
+
+--- ./v8/src/base/platform/condition-variable.cc
++++ ./v8/src/base/platform/condition-variable.cc
+@@ -16,7 +16,7 @@
+
+ ConditionVariable::ConditionVariable() {
+ #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
+- (V8_OS_LINUX && V8_LIBC_GLIBC))
++ V8_OS_LINUX)
+ // On Free/Net/OpenBSD and Linux with glibc we can change the time
+ // source for pthread_cond_timedwait() to use the monotonic clock.
+ pthread_condattr_t attr;
+@@ -92,7 +92,7 @@
+ &native_handle_, &mutex->native_handle(), &ts);
+ #else
+ #if (V8_OS_FREEBSD || V8_OS_NETBSD || V8_OS_OPENBSD || \
+- (V8_OS_LINUX && V8_LIBC_GLIBC))
++ V8_OS_LINUX)
+ // On Free/Net/OpenBSD and Linux with glibc we can change the time
+ // source for pthread_cond_timedwait() to use the monotonic clock.
+ result = clock_gettime(CLOCK_MONOTONIC, &ts);
diff --git a/repo/apps/chromium/nasm.patch b/repo/apps/chromium/nasm.patch
new file mode 100644
index 0000000..ff22a6f
--- /dev/null
+++ b/repo/apps/chromium/nasm.patch
@@ -0,0 +1,11 @@
+--- ./third_party/nasm/config/config-linux.h
++++ ./third_party/nasm/config/config-linux.h
+@@ -117,7 +117,7 @@
+ #define HAVE_ACCESS 1
+
+ /* Define to 1 if you have the `canonicalize_file_name' function. */
+-#define HAVE_CANONICALIZE_FILE_NAME 1
++// #define HAVE_CANONICALIZE_FILE_NAME 1
+
+ /* Define to 1 if you have the `cpu_to_le16' intrinsic function. */
+ /* #undef HAVE_CPU_TO_LE16 */
diff --git a/repo/apps/chromium/no-execinfo.patch b/repo/apps/chromium/no-execinfo.patch
new file mode 100644
index 0000000..8cb2f79
--- /dev/null
+++ b/repo/apps/chromium/no-execinfo.patch
@@ -0,0 +1,75 @@
+--- ./base/debug/stack_trace_posix.cc
++++ ./base/debug/stack_trace_posix.cc
+@@ -27,7 +27,7 @@
+ #if !defined(USE_SYMBOLIZE)
+ #include <cxxabi.h>
+ #endif
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+
+@@ -89,7 +89,7 @@
+ // Note: code in this function is NOT async-signal safe (std::string uses
+ // malloc internally).
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ std::string::size_type search_from = 0;
+ while (search_from < text->size()) {
+ // Look for the start of a mangled symbol, from search_from.
+@@ -136,7 +136,7 @@
+ virtual ~BacktraceOutputHandler() = default;
+ };
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void OutputPointer(void* pointer, BacktraceOutputHandler* handler) {
+ // This should be more than enough to store a 64-bit number in hex:
+ // 16 hex digits + 1 for null-terminator.
+@@ -839,7 +839,7 @@
+ // If we do not have unwind tables, then try tracing using frame pointers.
+ return base::debug::TraceStackFramePointers(const_cast<const void**>(trace),
+ count, 0);
+-#elif !defined(__UCLIBC__) && !defined(_AIX)
++#elif defined(__GLIBC__) && !defined(_AIX)
+ // Though the backtrace API man page does not list any possible negative
+ // return values, we take no chance.
+ return base::saturated_cast<size_t>(backtrace(trace, count));
+@@ -852,13 +852,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__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ PrintBacktraceOutputHandler handler;
+ ProcessBacktrace(trace_, count_, prefix_string, &handler);
+ #endif
+ }
+
+-#if !defined(__UCLIBC__) && !defined(_AIX)
++#if defined(__GLIBC__) && !defined(_AIX)
+ void StackTrace::OutputToStreamWithPrefix(std::ostream* os,
+ const char* prefix_string) const {
+ StreamBacktraceOutputHandler handler(os);
+--- ./v8/src/codegen/external-reference-table.cc.orig
++++ ./v8/src/codegen/external-reference-table.cc
+@@ -11,7 +11,9 @@
+
+ #if defined(DEBUG) && defined(V8_OS_LINUX) && !defined(V8_OS_ANDROID)
+ #define SYMBOLIZE_FUNCTION
++#if defined(__GLIBC__)
+ #include <execinfo.h>
++#endif
+
+ #include <vector>
+
+@@ -96,7 +98,7 @@
+ }
+
+ const char* ExternalReferenceTable::ResolveSymbol(void* address) {
+-#ifdef SYMBOLIZE_FUNCTION
++#if defined(SYMBOLIZE_FUNCTION) && defined(__GLIBC__)
+ char** names = backtrace_symbols(&address, 1);
+ const char* name = names[0];
+ // The array of names is malloc'ed. However, each name string is static
diff --git a/repo/apps/chromium/no-getcontext.patch b/repo/apps/chromium/no-getcontext.patch
new file mode 100644
index 0000000..71c1e91
--- /dev/null
+++ b/repo/apps/chromium/no-getcontext.patch
@@ -0,0 +1,26 @@
+--- ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
++++ ./third_party/breakpad/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -490,7 +490,9 @@
+ siginfo.si_code = SI_USER;
+ siginfo.si_pid = getpid();
+ ucontext_t context;
++#if defined(__GLIBC__)
+ getcontext(&context);
++#endif
+ return HandleSignal(sig, &siginfo, &context);
+ }
+
+@@ -675,9 +677,13 @@
+ sys_prctl(PR_SET_DUMPABLE, 1, 0, 0, 0);
+
+ CrashContext context;
++#if defined(__GLIBC__)
+ int getcontext_result = getcontext(&context.context);
+ if (getcontext_result)
+ return false;
++#else
++ return false;
++#endif
+
+ #if defined(__i386__)
+ // In CPUFillFromUContext in minidumpwriter.cc the stack pointer is retrieved
diff --git a/repo/apps/chromium/no-mallinfo.patch b/repo/apps/chromium/no-mallinfo.patch
new file mode 100644
index 0000000..23ce40e
--- /dev/null
+++ b/repo/apps/chromium/no-mallinfo.patch
@@ -0,0 +1,83 @@
+--- ./base/trace_event/malloc_dump_provider.cc.orig
++++ ./base/trace_event/malloc_dump_provider.cc
+@@ -212,7 +212,7 @@
+ &allocated_objects_count);
+ #elif defined(OS_FUCHSIA)
+ // TODO(fuchsia): Port, see https://crbug.com/706592.
+-#else
++#elif defined(__GLIBC__)
+ #if defined(__GLIBC__) && defined(__GLIBC_PREREQ)
+ #if __GLIBC_PREREQ(2, 33)
+ #define MALLINFO2_FOUND_IN_LIBC
+--- ./base/process/process_metrics_posix.cc.orig
++++ ./base/process/process_metrics_posix.cc
+@@ -105,7 +105,7 @@
+
+ #endif // !BUILDFLAG(IS_FUCHSIA)
+
+-#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#if (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ namespace {
+
+ size_t GetMallocUsageMallinfo() {
+@@ -123,7 +123,7 @@
+ }
+
+ } // namespace
+-#endif // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) ||
++#endif // (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) ||
+ // BUILDFLAG(IS_ANDROID)
+
+ size_t ProcessMetrics::GetMallocUsage() {
+@@ -131,9 +131,9 @@
+ malloc_statistics_t stats = {0};
+ malloc_zone_statistics(nullptr, &stats);
+ return stats.size_in_use;
+-#elif BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
++#elif (BUILDFLAG(IS_LINUX) && defined(__GLIBC__)) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
+ return GetMallocUsageMallinfo();
+-#elif BUILDFLAG(IS_FUCHSIA)
++#else
+ // TODO(fuchsia): Not currently exposed. https://crbug.com/735087.
+ return 0;
+ #endif
+--- ./third_party/tflite/src/tensorflow/lite/profiling/memory_info.cc.orig
++++ ./third_party/tflite/src/tensorflow/lite/profiling/memory_info.cc
+@@ -35,7 +35,7 @@
+
+ MemoryUsage GetMemoryUsage() {
+ MemoryUsage result;
+-#ifdef __linux__
++#if defined(__linux__) && defined(__GLIBC__)
+ rusage res;
+ if (getrusage(RUSAGE_SELF, &res) == 0) {
+ result.max_rss_kb = res.ru_maxrss;
+--- ./third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc
++++ ./third_party/swiftshader/third_party/llvm-subzero/lib/Support/Unix/Process.inc.orig
+@@ -86,11 +86,11 @@
+ }
+
+ size_t Process::GetMallocUsage() {
+-#if defined(HAVE_MALLINFO2)
++#if defined(HAVE_MALLINFO2) && defined(__GLIBC__)
+ struct mallinfo2 mi;
+ mi = ::mallinfo2();
+ return mi.uordblks;
+-#elif defined(HAVE_MALLINFO)
++#elif defined(HAVE_MALLINFO) && defined(__GLIBC__)
+ struct mallinfo mi;
+ mi = ::mallinfo();
+ return mi.uordblks;
+
+--- ./third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h.orig 2019-09-30 13:03:42.556880537 -0400
++++ ./third_party/swiftshader/third_party/llvm-10.0/configs/linux/include/llvm/Config/config.h 2019-09-30 13:07:27.989821227 -0400
+@@ -122,7 +122,9 @@
+ /* #undef HAVE_MALLCTL */
+
+ /* Define to 1 if you have the `mallinfo' function. */
++#if defined(__GLIBC__)
+ #define HAVE_MALLINFO 1
++#endif
+
+ /* Define to 1 if you have the <malloc.h> header file. */
+ #define HAVE_MALLOC_H 1
diff --git a/repo/apps/chromium/quiche-arena-size.patch b/repo/apps/chromium/quiche-arena-size.patch
new file mode 100644
index 0000000..50abcae
--- /dev/null
+++ b/repo/apps/chromium/quiche-arena-size.patch
@@ -0,0 +1,11 @@
+--- ./net/third_party/quiche/src/quic/core/quic_one_block_arena.h
++++ ./net/third_party/quiche/src/quic/core/quic_one_block_arena.h
+@@ -69,7 +69,7 @@
+
+ // QuicConnections currently use around 1KB of polymorphic types which would
+ // ordinarily be on the heap. Instead, store them inline in an arena.
+-using QuicConnectionArena = QuicOneBlockArena<1152>;
++using QuicConnectionArena = QuicOneBlockArena<1504>;
+
+ } // namespace quic
+
diff --git a/repo/apps/chromium/remove-strip_binary.patch b/repo/apps/chromium/remove-strip_binary.patch
new file mode 100644
index 0000000..8b13c6a
--- /dev/null
+++ b/repo/apps/chromium/remove-strip_binary.patch
@@ -0,0 +1,32 @@
+--- a/chrome/test/chromedriver/BUILD.gn.orig
++++ b/chrome/test/chromedriver/BUILD.gn
+@@ -308,11 +308,7 @@
+ }
+ }
+
+-if (is_linux) {
+- chromedriver_output = "chromedriver.unstripped"
+-} else {
+- chromedriver_output = "chromedriver"
+-}
++chromedriver_output = "chromedriver"
+
+ executable("$chromedriver_output") {
+ testonly = true
+@@ -336,16 +332,6 @@
+ }
+ }
+
+-if (is_linux) {
+- strip_binary("chromedriver") {
+- testonly = true
+- binary_input = "$root_out_dir/$chromedriver_output"
+- symbol_output = "$root_out_dir/chromedriver.debug"
+- stripped_binary_output = "$root_out_dir/chromedriver"
+- deps = [ ":$chromedriver_output" ]
+- }
+-}
+-
+ python_library("chromedriver_py_tests") {
+ testonly = true
+ deps = [
diff --git a/repo/apps/chromium/resolver.patch b/repo/apps/chromium/resolver.patch
new file mode 100644
index 0000000..8dca36a
--- /dev/null
+++ b/repo/apps/chromium/resolver.patch
@@ -0,0 +1,36 @@
+--- ./net/dns/host_resolver_manager.cc.orig
++++ ./net/dns/host_resolver_manager.cc
+@@ -3014,8 +3014,7 @@
+ NetworkChangeNotifier::AddConnectionTypeObserver(this);
+ if (system_dns_config_notifier_)
+ system_dns_config_notifier_->AddObserver(this);
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+- !BUILDFLAG(IS_ANDROID)
++#if defined(__GLIBC__)
+ EnsureDnsReloaderInit();
+ #endif
+
+--- ./net/dns/dns_reloader.cc.orig
++++ ./net/dns/dns_reloader.cc
+@@ -6,8 +6,7 @@
+
+ #include "build/build_config.h"
+
+-#if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_OPENBSD) && \
+- !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_FUCHSIA)
++#if defined(__GLIBC__)
+
+ #include <resolv.h>
+
+--- ./net/dns/host_resolver_proc.cc.orig
++++ ./net/dns/host_resolver_proc.cc
+@@ -176,8 +176,7 @@
+ base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
+ base::BlockingType::WILL_BLOCK);
+
+-#if BUILDFLAG(IS_POSIX) && \
+- !(BUILDFLAG(IS_APPLE) || BUILDFLAG(IS_OPENBSD) || BUILDFLAG(IS_ANDROID))
++#if defined(__GLIBC__)
+ DnsReloaderMaybeReload();
+ #endif
+ absl::optional<AddressInfo> ai;
diff --git a/repo/apps/chromium/revert-use-ffile-compilation-dir.patch b/repo/apps/chromium/revert-use-ffile-compilation-dir.patch
new file mode 100644
index 0000000..f0c110f
--- /dev/null
+++ b/repo/apps/chromium/revert-use-ffile-compilation-dir.patch
@@ -0,0 +1,48 @@
+diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
+index f442166..c325f72 100644
+--- a/build/config/compiler/BUILD.gn
++++ b/build/config/compiler/BUILD.gn
+@@ -1248,19 +1248,12 @@ config("compiler_deterministic") {
+ # different build directory like "out/feature_a" and "out/feature_b" if
+ # we build same files with same compile flag.
+ # Other paths are already given in relative, no need to normalize them.
+- if (is_nacl) {
+- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
+- cflags += [
+- "-Xclang",
+- "-fdebug-compilation-dir",
+- "-Xclang",
+- ".",
+- ]
+- } else {
+- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
+- # and -fcoverage-compilation-dir=.
+- cflags += [ "-ffile-compilation-dir=." ]
+- }
++ cflags += [
++ "-Xclang",
++ "-fdebug-compilation-dir",
++ "-Xclang",
++ ".",
++ ]
+ if (!is_win) {
+ # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
+ asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
+diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
+index 008a386..89e7fdf 100644
+--- a/build/config/compiler/compiler.gni
++++ b/build/config/compiler/compiler.gni
+@@ -238,8 +238,11 @@ declare_args() {
+ # deterministic builds to reduce compile times, so this is less relevant for
+ # official builders.
+ strip_absolute_paths_from_debug_symbols_default =
+- is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
+- is_chromeos || (is_apple && !enable_dsyms)
++ # TODO(crbug.com/1010267): remove '!use_clang_coverage', coverage build has
++ # dependency to absolute path of source files.
++ !use_clang_coverage &&
++ (is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
++ is_chromeos || (is_apple && !enable_dsyms))
+
+ # If the platform uses stripped absolute paths by default, then we don't expose
+ # it as a configuration option. If this is causing problems, please file a bug.
diff --git a/repo/apps/chromium/scoped-file.patch b/repo/apps/chromium/scoped-file.patch
new file mode 100644
index 0000000..34bf6eb
--- /dev/null
+++ b/repo/apps/chromium/scoped-file.patch
@@ -0,0 +1,31 @@
+--- ./base/files/scoped_file_linux.cc.orig
++++ ./base/files/scoped_file_linux.cc
+@@ -7,6 +7,7 @@
+ #include <algorithm>
+ #include <array>
+ #include <atomic>
++#include <dlfcn.h>
+
+ #include "base/compiler_specific.h"
+ #include "base/debug/stack_trace.h"
+@@ -80,9 +81,18 @@
+
+ extern "C" {
+
+-int __close(int);
+-
+ __attribute__((visibility("default"), noinline)) int close(int fd) {
++ static int (*__close)(int) = nullptr;
++
++ if (__close == nullptr) {
++ __close = (int (*)(int))dlsym(RTLD_NEXT, "close");
++
++ if (__close == nullptr) {
++ RAW_LOG(ERROR, "musl close not found\n");
++ IMMEDIATE_CRASH();
++ }
++ }
++
+ if (base::IsFDOwned(fd) && g_is_ownership_enforced)
+ CrashOnFdOwnershipViolation();
+ return __close(fd);
diff --git a/repo/apps/chromium/sql-make-VirtualCursor-standard-layout-type.patch b/repo/apps/chromium/sql-make-VirtualCursor-standard-layout-type.patch
new file mode 100644
index 0000000..3364d41
--- /dev/null
+++ b/repo/apps/chromium/sql-make-VirtualCursor-standard-layout-type.patch
@@ -0,0 +1,238 @@
+From 144479ad7b4287bee4067f95e4218f614798a865 Mon Sep 17 00:00:00 2001
+From: Stephan Hartmann <stha09@googlemail.com>
+Date: Sun, 16 Jan 2022 19:15:26 +0000
+Subject: [PATCH] sql: make VirtualCursor standard layout type
+
+sql::recover::VirtualCursor needs to be a standard layout type, but
+has members of type std::unique_ptr. However, std::unique_ptr is not
+guaranteed to be standard layout. Compiling with clang combined with
+gcc-11 libstdc++ fails because of this.
+
+Bug: 1189788
+Change-Id: Ia6dc388cc5ef1c0f2afc75f8ca45b9f12687ca9c
+---
+ sql/recover_module/btree.cc | 18 ++++++++++++------
+ sql/recover_module/btree.h | 21 +++++++++++++++------
+ sql/recover_module/cursor.cc | 24 ++++++++++++------------
+ sql/recover_module/cursor.h | 2 +-
+ sql/recover_module/pager.cc | 5 ++---
+ sql/recover_module/pager.h | 6 +++---
+ 6 files changed, 45 insertions(+), 31 deletions(-)
+
+diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc
+index cc9420e5c05..f12d8fa32a2 100644
+--- a/sql/recover_module/btree.cc
++++ b/sql/recover_module/btree.cc
+@@ -136,16 +136,22 @@ static_assert(std::is_trivially_destructible<LeafPageDecoder>::value,
+ "Move the destructor to the .cc file if it's non-trival");
+ #endif // !DCHECK_IS_ON()
+
+-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept
+- : page_id_(db_reader->page_id()),
+- db_reader_(db_reader),
+- cell_count_(ComputeCellCount(db_reader)),
+- next_read_index_(0),
+- last_record_size_(0) {
++LeafPageDecoder::LeafPageDecoder() noexcept = default;
++
++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) {
++ page_id_ = db_reader->page_id();
++ db_reader_ = db_reader;
++ cell_count_ = ComputeCellCount(db_reader);
++ next_read_index_ = 0;
++ last_record_size_ = 0;
+ DCHECK(IsOnValidPage(db_reader));
+ DCHECK(DatabasePageReader::IsValidPageId(page_id_));
+ }
+
++void LeafPageDecoder::Reset() {
++ db_reader_ = nullptr;
++}
++
+ bool LeafPageDecoder::TryAdvance() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(CanAdvance());
+diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h
+index eaa087a5c52..df0e0c937c0 100644
+--- a/sql/recover_module/btree.h
++++ b/sql/recover_module/btree.h
+@@ -101,9 +101,7 @@ class LeafPageDecoder {
+ public:
+ // Creates a decoder for a DatabasePageReader's last read page.
+ //
+- // |db_reader| must have been used to read an inner page of a table B-tree.
+- // |db_reader| must outlive this instance.
+- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept;
++ LeafPageDecoder() noexcept;
+ ~LeafPageDecoder() noexcept = default;
+
+ LeafPageDecoder(const LeafPageDecoder&) = delete;
+@@ -151,6 +149,17 @@ class LeafPageDecoder {
+ // read as long as CanAdvance() returns true.
+ bool TryAdvance();
+
++ // Initialize with DatabasePageReader
++ // |db_reader| must have been used to read an inner page of a table B-tree.
++ // |db_reader| must outlive this instance.
++ void Initialize(DatabasePageReader* db_reader);
++
++ // Reset internal DatabasePageReader
++ void Reset();
++
++ // True if DatabasePageReader is valid
++ bool IsValid() { return (db_reader_ != nullptr); }
++
+ // True if the given reader may point to an inner page in a table B-tree.
+ //
+ // The last ReadPage() call on |db_reader| must have succeeded.
+@@ -164,14 +173,14 @@ class LeafPageDecoder {
+ static int ComputeCellCount(DatabasePageReader* db_reader);
+
+ // The number of the B-tree page this reader is reading.
+- const int64_t page_id_;
++ int64_t page_id_;
+ // Used to read the tree page.
+ //
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the DatabasePageReader outlives this.
+- DatabasePageReader* const db_reader_;
++ DatabasePageReader* db_reader_;
+ // Caches the ComputeCellCount() value for this reader's page.
+- const int cell_count_ = ComputeCellCount(db_reader_);
++ int cell_count_;
+
+ // The reader's cursor state.
+ //
+diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc
+index 4f827edf1b4..240de4999fe 100644
+--- a/sql/recover_module/cursor.cc
++++ b/sql/recover_module/cursor.cc
+@@ -28,7 +28,7 @@ VirtualCursor::~VirtualCursor() {
+ int VirtualCursor::First() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ inner_decoders_.clear();
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+
+ AppendPageDecoder(table_->root_page_id());
+ return Next();
+@@ -38,18 +38,18 @@ int VirtualCursor::Next() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ record_reader_.Reset();
+
+- while (!inner_decoders_.empty() || leaf_decoder_.get()) {
+- if (leaf_decoder_.get()) {
+- if (!leaf_decoder_->CanAdvance()) {
++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) {
++ if (leaf_decoder_.IsValid()) {
++ if (!leaf_decoder_.CanAdvance()) {
+ // The leaf has been exhausted. Remove it from the DFS stack.
+- leaf_decoder_ = nullptr;
++ leaf_decoder_.Reset();
+ continue;
+ }
+- if (!leaf_decoder_->TryAdvance())
++ if (!leaf_decoder_.TryAdvance())
+ continue;
+
+- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(),
+- leaf_decoder_->last_record_offset())) {
++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(),
++ leaf_decoder_.last_record_offset())) {
+ continue;
+ }
+ if (!record_reader_.Initialize())
+@@ -101,13 +101,13 @@ int VirtualCursor::ReadColumn(int column_index,
+ int64_t VirtualCursor::RowId() {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK(record_reader_.IsInitialized());
+- DCHECK(leaf_decoder_.get());
+- return leaf_decoder_->last_record_rowid();
++ DCHECK(leaf_decoder_.IsValid());
++ return leaf_decoder_.last_record_rowid();
+ }
+
+ void VirtualCursor::AppendPageDecoder(int page_id) {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+- DCHECK(leaf_decoder_.get() == nullptr)
++ DCHECK(!leaf_decoder_.IsValid())
+ << __func__
+ << " must only be called when the current path has no leaf decoder";
+
+@@ -115,7 +115,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) {
+ return;
+
+ if (LeafPageDecoder::IsOnValidPage(&db_reader_)) {
+- leaf_decoder_ = std::make_unique<LeafPageDecoder>(&db_reader_);
++ leaf_decoder_.Initialize(&db_reader_);
+ return;
+ }
+
+diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h
+index 845b7852648..cc4e85f83f9 100644
+--- a/sql/recover_module/cursor.h
++++ b/sql/recover_module/cursor.h
+@@ -130,7 +130,7 @@ class VirtualCursor {
+ std::vector<std::unique_ptr<InnerPageDecoder>> inner_decoders_;
+
+ // Decodes the leaf page containing records.
+- std::unique_ptr<LeafPageDecoder> leaf_decoder_;
++ LeafPageDecoder leaf_decoder_;
+
+ SEQUENCE_CHECKER(sequence_checker_);
+ };
+diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc
+index 58e75de2704..69d98cef98d 100644
+--- a/sql/recover_module/pager.cc
++++ b/sql/recover_module/pager.cc
+@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits<int>::max(),
+ "ints are not appropriate for representing page IDs");
+
+ DatabasePageReader::DatabasePageReader(VirtualTable* table)
+- : page_data_(std::make_unique<uint8_t[]>(table->page_size())),
+- table_(table) {
++ : page_data_(table->page_size()), table_(table) {
+ DCHECK(table != nullptr);
+ DCHECK(IsValidPageSize(table->page_size()));
+ }
+@@ -58,7 +57,7 @@ int DatabasePageReader::ReadPage(int page_id) {
+ "The |read_offset| computation above may overflow");
+
+ int sqlite_status =
+- RawRead(sqlite_file, read_size, read_offset, page_data_.get());
++ RawRead(sqlite_file, read_size, read_offset, page_data_.data());
+
+ // |page_id_| needs to be set to kInvalidPageId if the read failed.
+ // Otherwise, future ReadPage() calls with the previous |page_id_| value
+diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h
+index 07cac3cb989..d08f0932fab 100644
+--- a/sql/recover_module/pager.h
++++ b/sql/recover_module/pager.h
+@@ -6,8 +6,8 @@
+ #define SQL_RECOVER_MODULE_PAGER_H_
+
+ #include <cstdint>
+-#include <memory>
+ #include <ostream>
++#include <vector>
+
+ #include "base/check_op.h"
+ #include "base/memory/raw_ptr.h"
+@@ -72,7 +72,7 @@ class DatabasePageReader {
+ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ DCHECK_NE(page_id_, kInvalidPageId)
+ << "Successful ReadPage() required before accessing pager state";
+- return page_data_.get();
++ return page_data_.data();
+ }
+
+ // The number of bytes in the page read by the last ReadPage() call.
+@@ -139,7 +139,7 @@ class DatabasePageReader {
+ int page_id_ = kInvalidPageId;
+ // Stores the bytes of the last page successfully read by ReadPage().
+ // The content is undefined if the last call to ReadPage() did not succeed.
+- const std::unique_ptr<uint8_t[]> page_data_;
++ std::vector<uint8_t> page_data_;
+ // Raw pointer usage is acceptable because this instance's owner is expected
+ // to ensure that the VirtualTable outlives this.
+ const raw_ptr<VirtualTable> table_;
diff --git a/repo/apps/chromium/system-opus.patch b/repo/apps/chromium/system-opus.patch
new file mode 100644
index 0000000..dc85e80
--- /dev/null
+++ b/repo/apps/chromium/system-opus.patch
@@ -0,0 +1,52 @@
+Has been upstreamed in Chromium main branch, shouldn't be necessary
+when the commit gets pulled into a new release
+
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf662..40cdaff8d3a00 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+ scoped_refptr<base::SequencedTaskRunner> task_runner) {
+ if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+ return nullptr;
+- // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+- // we'll create a real platform encoder here.
+- auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+- auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+- {base::TaskPriority::USER_BLOCKING});
+- return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+- std::move(encoding_runner),
+- std::move(task_runner));
++ return nullptr;
+ }
+
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch b/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch
new file mode 100644
index 0000000..dae1add
--- /dev/null
+++ b/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch
@@ -0,0 +1,12 @@
+diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
+index 16e20744706..6a079b32221 100644
+--- a/build/linux/unbundle/ffmpeg.gn
++++ b/build/linux/unbundle/ffmpeg.gn
+@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
+ "libavformat",
+ "libavutil",
+ ]
++ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
+ }
+
+ buildflag_header("ffmpeg_features") {
diff --git a/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch.1 b/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch.1
new file mode 100644
index 0000000..dae1add
--- /dev/null
+++ b/repo/apps/chromium/unbundle-ffmpeg-av_stream_get_first_dts.patch.1
@@ -0,0 +1,12 @@
+diff --git a/build/linux/unbundle/ffmpeg.gn b/build/linux/unbundle/ffmpeg.gn
+index 16e20744706..6a079b32221 100644
+--- a/build/linux/unbundle/ffmpeg.gn
++++ b/build/linux/unbundle/ffmpeg.gn
+@@ -12,6 +12,7 @@ pkg_config("system_ffmpeg") {
+ "libavformat",
+ "libavutil",
+ ]
++ defines = [ "av_stream_get_first_dts(stream)=stream->first_dts" ]
+ }
+
+ buildflag_header("ffmpeg_features") {
diff --git a/repo/apps/chromium/use-deprecated-ffmpeg-api.patch b/repo/apps/chromium/use-deprecated-ffmpeg-api.patch
new file mode 100644
index 0000000..f0ec736
--- /dev/null
+++ b/repo/apps/chromium/use-deprecated-ffmpeg-api.patch
@@ -0,0 +1,36 @@
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index ac4713b07268..492a9a37d096 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ scoped_refptr<DecoderBuffer> buffer;
+
+ if (type() == DemuxerStream::TEXT) {
+- size_t id_size = 0;
++ int id_size = 0;
+ uint8_t* id_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+
+- size_t settings_size = 0;
++ int settings_size = 0;
+ uint8_t* settings_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+
+@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+ side_data.data(), side_data.size());
+ } else {
+- size_t side_data_size = 0;
++ int side_data_size = 0;
+ uint8_t* side_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+
+@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ packet->size - data_offset);
+ }
+
+- size_t skip_samples_size = 0;
++ int skip_samples_size = 0;
+ const uint32_t* skip_samples_ptr =
+ reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
diff --git a/repo/apps/chromium/use-deprecated-ffmpeg-api.patch.1 b/repo/apps/chromium/use-deprecated-ffmpeg-api.patch.1
new file mode 100644
index 0000000..f0ec736
--- /dev/null
+++ b/repo/apps/chromium/use-deprecated-ffmpeg-api.patch.1
@@ -0,0 +1,36 @@
+diff --git a/media/filters/ffmpeg_demuxer.cc b/media/filters/ffmpeg_demuxer.cc
+index ac4713b07268..492a9a37d096 100644
+--- a/media/filters/ffmpeg_demuxer.cc
++++ b/media/filters/ffmpeg_demuxer.cc
+@@ -427,11 +427,11 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ scoped_refptr<DecoderBuffer> buffer;
+
+ if (type() == DemuxerStream::TEXT) {
+- size_t id_size = 0;
++ int id_size = 0;
+ uint8_t* id_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_IDENTIFIER, &id_size);
+
+- size_t settings_size = 0;
++ int settings_size = 0;
+ uint8_t* settings_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_WEBVTT_SETTINGS, &settings_size);
+
+@@ -443,7 +443,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ buffer = DecoderBuffer::CopyFrom(packet->data, packet->size,
+ side_data.data(), side_data.size());
+ } else {
+- size_t side_data_size = 0;
++ int side_data_size = 0;
+ uint8_t* side_data = av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_MATROSKA_BLOCKADDITIONAL, &side_data_size);
+
+@@ -504,7 +504,7 @@ void FFmpegDemuxerStream::EnqueuePacket(ScopedAVPacket packet) {
+ packet->size - data_offset);
+ }
+
+- size_t skip_samples_size = 0;
++ int skip_samples_size = 0;
+ const uint32_t* skip_samples_ptr =
+ reinterpret_cast<const uint32_t*>(av_packet_get_side_data(
+ packet.get(), AV_PKT_DATA_SKIP_SAMPLES, &skip_samples_size));
diff --git a/repo/apps/chromium/use-oauth2-client-switches-as-default.patch b/repo/apps/chromium/use-oauth2-client-switches-as-default.patch
new file mode 100644
index 0000000..9d9c57b
--- /dev/null
+++ b/repo/apps/chromium/use-oauth2-client-switches-as-default.patch
@@ -0,0 +1,17 @@
+diff -upr chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc chromium-89.0.4389.58/google_apis/google_api_keys.cc
+--- chromium-89.0.4389.58.orig/google_apis/google_api_keys.cc 2021-02-24 22:37:18.494007649 +0000
++++ chromium-89.0.4389.58/google_apis/google_api_keys.cc 2021-02-24 22:35:00.865777600 +0000
+@@ -154,11 +154,11 @@ class APIKeyCache {
+
+ std::string default_client_id = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_ID,
+- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), nullptr,
++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_ID), ::switches::kOAuth2ClientID,
+ std::string(), environment.get(), command_line, gaia_config);
+ std::string default_client_secret = CalculateKeyValue(
+ GOOGLE_DEFAULT_CLIENT_SECRET,
+- STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), nullptr,
++ STRINGIZE_NO_EXPANSION(GOOGLE_DEFAULT_CLIENT_SECRET), ::switches::kOAuth2ClientSecret,
+ std::string(), environment.get(), command_line, gaia_config);
+
+ // We currently only allow overriding the baked-in values for the
diff --git a/repo/apps/chromium/wayland-egl.patch b/repo/apps/chromium/wayland-egl.patch
new file mode 100644
index 0000000..58a0798
--- /dev/null
+++ b/repo/apps/chromium/wayland-egl.patch
@@ -0,0 +1,22 @@
+--- a/ui/gl/gl_image_native_pixmap.cc 2020-05-18 11:40:06.000000000 -0700
++++ b/ui/gl/gl_image_native_pixmap.cc 2020-05-22 02:07:16.007770442 -0700
+@@ -288,6 +288,8 @@
+ std::move(scoped_fd));
+ }
+
++ handle.planes[0].size = size_.GetArea();
++
+ return handle;
+ #endif // !defined(OS_FUCHSIA)
+ }
+--- a/gpu/command_buffer/service/error_state.cc 2020-05-18 11:39:22.000000000 -0700
++++ b/gpu/command_buffer/service/error_state.cc 2020-05-22 13:43:09.181180388 -0700
+@@ -115,6 +115,8 @@
+ // buffer.
+ error = GL_NO_ERROR;
+ }
++ if (error == GL_INVALID_ENUM)
++ error = GL_NO_ERROR;
+ return error;
+ }
+
diff --git a/repo/apps/chromium/webcodecs-stop-using-AudioOpusEncoder.patch b/repo/apps/chromium/webcodecs-stop-using-AudioOpusEncoder.patch
new file mode 100644
index 0000000..32957d3
--- /dev/null
+++ b/repo/apps/chromium/webcodecs-stop-using-AudioOpusEncoder.patch
@@ -0,0 +1,49 @@
+From 3bd46cb9a51773f103ef52b39d6407740eb0d60a Mon Sep 17 00:00:00 2001
+From: Eugene Zemtsov <eugene@chromium.org>
+Date: Thu, 24 Feb 2022 23:17:20 +0000
+Subject: [PATCH] webcodecs: Stop using AudioOpusEncoder as backed for mojo
+ audio encoder
+
+AudioOpusEncoder was only used here for testing. Let's not let it get
+comfortable. We'll use MF AAC encoder here when we have it. (Soon...)
+
+Bug: 1259883
+Change-Id: Ia1819395c8c8fd6d403d4b8558c12f9a1bf7e761
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3489449
+Commit-Queue: Eugene Zemtsov <eugene@chromium.org>
+Auto-Submit: Eugene Zemtsov <eugene@chromium.org>
+Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
+Commit-Queue: Dale Curtis <dalecurtis@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#974895}
+---
+ media/mojo/services/gpu_mojo_media_client.cc | 10 +---------
+ 1 file changed, 1 insertion(+), 9 deletions(-)
+
+diff --git a/media/mojo/services/gpu_mojo_media_client.cc b/media/mojo/services/gpu_mojo_media_client.cc
+index 8f83a4d6cf6..40cdaff8d3a 100644
+--- a/media/mojo/services/gpu_mojo_media_client.cc
++++ b/media/mojo/services/gpu_mojo_media_client.cc
+@@ -13,7 +13,6 @@
+ #include "build/chromeos_buildflags.h"
+ #include "gpu/ipc/service/gpu_channel.h"
+ #include "media/audio/audio_features.h"
+-#include "media/audio/audio_opus_encoder.h"
+ #include "media/base/audio_decoder.h"
+ #include "media/base/cdm_factory.h"
+ #include "media/base/media_switches.h"
+@@ -119,14 +118,7 @@ std::unique_ptr<AudioEncoder> GpuMojoMediaClient::CreateAudioEncoder(
+ scoped_refptr<base::SequencedTaskRunner> task_runner) {
+ if (!base::FeatureList::IsEnabled(features::kPlatformAudioEncoder))
+ return nullptr;
+- // TODO(crbug.com/1259883) Right now Opus encoder is all we have, later on
+- // we'll create a real platform encoder here.
+- auto opus_encoder = std::make_unique<AudioOpusEncoder>();
+- auto encoding_runner = base::ThreadPool::CreateSequencedTaskRunner(
+- {base::TaskPriority::USER_BLOCKING});
+- return std::make_unique<OffloadingAudioEncoder>(std::move(opus_encoder),
+- std::move(encoding_runner),
+- std::move(task_runner));
++ return nullptr;
+ }
+
+ VideoDecoderType GpuMojoMediaClient::GetDecoderImplementationType() {
diff --git a/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch b/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch
new file mode 100644
index 0000000..0c7e731
--- /dev/null
+++ b/repo/apps/chromium/webrtc-check-existence-of-cursor-metadata.patch
@@ -0,0 +1,31 @@
+From c2cd814cdd8cbf8dda6ccec2266327a5321fbde8 Mon Sep 17 00:00:00 2001
+From: Jan Grulich <grulja@gmail.com>
+Date: Tue, 15 Mar 2022 14:31:55 +0100
+Subject: [PATCH] PipeWire capturer: check existence of cursor metadata
+
+Check whether there are any cursor metadata before we try to validate
+and use them, otherwise we might crash on this.
+
+Bug: webrtc:13429
+Change-Id: I365da59a189b6b974cebafc94fec49d5b942efae
+Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/255601
+Reviewed-by: Alexander Cooper <alcooper@chromium.org>
+Commit-Queue: Alexander Cooper <alcooper@chromium.org>
+Cr-Commit-Position: refs/heads/main@{#36240}
+---
+ .../desktop_capture/linux/wayland/shared_screencast_stream.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+index a8c86e26..9e81df4c 100644
+--- a/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
++++ b/modules/desktop_capture/linux/wayland/shared_screencast_stream.cc
+@@ -650,7 +650,7 @@ void SharedScreenCastStreamPrivate::ProcessBuffer(pw_buffer* buffer) {
+ const struct spa_meta_cursor* cursor =
+ static_cast<struct spa_meta_cursor*>(spa_buffer_find_meta_data(
+ spa_buffer, SPA_META_Cursor, sizeof(*cursor)));
+- if (spa_meta_cursor_is_valid(cursor)) {
++ if (cursor && spa_meta_cursor_is_valid(cursor)) {
+ struct spa_meta_bitmap* bitmap = nullptr;
+
+ if (cursor->bitmap_offset)
diff --git a/repo/apps/gimp/gimp.xibuild b/repo/apps/gimp/gimp.xibuild
index f063a19..b11e920 100644
--- a/repo/apps/gimp/gimp.xibuild
+++ b/repo/apps/gimp/gimp.xibuild
@@ -6,7 +6,7 @@ DESC="GNU Image Manipulation Program"
MAKEDEPS="make gettext"
DEPS="babl cairo fontconfig freetype2 gdk-pixbuf gexiv2 glib gtk2 harfbuzz json-glib lcms2 bzip2 libexecinfo intltool libjpeg-turbo libmypaint mypaint-brushes libpng librsvg libwebp libx11 libxext libxfixes libxmu libxpm musl pango poppler-glib gegl tiff xz zlib python glib-networking poppler-data"
-PKG_VER=2.10.30
+PKG_VER=2.10.28
SOURCE="https://download.gimp.org/pub/gimp/v${PKG_VER%.*}/gimp-$PKG_VER.tar.bz2"
build () {
diff --git a/repo/media/gegl/gegl.xibuild b/repo/media/gegl/gegl.xibuild
index a99fc6f..46f9482 100644
--- a/repo/media/gegl/gegl.xibuild
+++ b/repo/media/gegl/gegl.xibuild
@@ -16,6 +16,7 @@ build () {
cd build &&
export LDFLAGS="$LDFLAGS -lexecinfo"
meson --prefix=/usr \
+ -Ddocs=false \
.. &&
ninja
}
diff --git a/repo/meta/repo-test.sh/repo-test.sh.xibuild b/repo/meta/repo-test.sh/repo-test.sh.xibuild
new file mode 100644
index 0000000..5ef212b
--- /dev/null
+++ b/repo/meta/repo-test.sh/repo-test.sh.xibuild
@@ -0,0 +1,5 @@
+#!/bin/sh
+# This file was automatically generated, do not edit!
+
+DESC="All the the packages available in test.sh"
+DEPS=""
diff --git a/repo/xi/xibuild/xibuild.xibuild b/repo/xi/xibuild/xibuild.xibuild
index 9c4cdaa..c8a3ab0 100644
--- a/repo/xi/xibuild/xibuild.xibuild
+++ b/repo/xi/xibuild/xibuild.xibuild
@@ -1,7 +1,7 @@
#!/bin/sh
MAKEDEPS="make"
-DEPS="xiutils parseconf tar unzip"
+DEPS="xiutils parseconf tar unzip hbar"
PKG_VER=1.3
SOURCE=https://git.davidovski.xyz/xilinux/xibuild.git
diff --git a/repo/xi/xipkg/xipkg.xibuild b/repo/xi/xipkg/xipkg.xibuild
index 31476d5..1d48e38 100644
--- a/repo/xi/xipkg/xipkg.xibuild
+++ b/repo/xi/xipkg/xipkg.xibuild
@@ -1,7 +1,7 @@
#!/bin/sh
MAKEDEPS="make"
-DEPS="openssl curl dash xiutils findutils diffutils sed xichroot grep base64 sort"
+DEPS="openssl curl dash xiutils findutils diffutils sed xichroot grep base64 sort hbar parseconf xiutils"
PKG_VER=1.4.3
SOURCE=https://git.davidovski.xyz/xilinux/xipkg.git
diff --git a/skip/cabal-stage0/cabal-stage0.xibuild b/skip/cabal-stage0/cabal-stage0.xibuild
new file mode 100644
index 0000000..4905da8
--- /dev/null
+++ b/skip/cabal-stage0/cabal-stage0.xibuild
@@ -0,0 +1,29 @@
+#!/bin/sh
+
+NAME="cabal-stage0"
+DESC="Cabal version used for bootstrapping"
+
+MAKEDEPS="make ghc"
+DEPS="gmp libffi musl zlib "
+
+PKG_VER=5b4258cbfa536b6362c4e20578ced51676206ea8
+SOURCE="https://github.com/haskell/cabal"
+BRANCH=$PKG_VER
+
+ADDITIONAL="linux-9.0.1.json depends-for-ghc-9.0.1.patch "
+
+prepare () {
+ apply_patches
+ cp linux-9.0.1.json "bootstrap"
+}
+
+build () {
+ ./bootstrap/bootstrap.py \
+ -d ./bootstrap/linux-9.0.1.json \
+ -w "$(command -v ghc)"
+}
+
+package () {
+ install -m 755 -D _build/bin/cabal "$PKG_DEST/usr/bin/cabal"
+ install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal-stage0/LICENSE"
+}
diff --git a/skip/cabal-stage0/depends-for-ghc-9.0.1.patch b/skip/cabal-stage0/depends-for-ghc-9.0.1.patch
new file mode 100644
index 0000000..90dfae9
--- /dev/null
+++ b/skip/cabal-stage0/depends-for-ghc-9.0.1.patch
@@ -0,0 +1,44 @@
+A lot of packages do not work with GHC 9.0.1 by default since their
+version constraint for packages from the standard library is too
+restrictive. Adjust these version constrains to fix the build.
+
+Only in b: _build
+diff -upr a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py
+--- a/bootstrap/bootstrap.py 2021-11-17 20:24:56.563114540 +0100
++++ b/bootstrap/bootstrap.py 2021-11-17 20:13:30.311479911 +0100
+@@ -147,6 +147,11 @@ def fetch_package(package: PackageName,
+ shutil.copyfileobj(resp, cabal_file.open('wb'))
+ verify_sha256(cabal_sha256, cabal_file)
+
++ if package == "ed25519":
++ subprocess_run(["sed", "-e", "s/ghc-prim ..*/ghc-prim >= 0.1,/", "-i", cabal_file], check=True)
++ elif package == "hackage-security":
++ subprocess_run(["sed", "-e", "s/template-haskell ..*/template-haskell >= 2.7,/", "-i", cabal_file], check=True)
++
+ return (tarball, cabal_file)
+
+ def read_bootstrap_info(path: Path) -> BootstrapInfo:
+diff -upr a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal
+--- a/cabal-install/cabal-install.cabal 2021-11-05 00:16:33.000000000 +0100
++++ b/cabal-install/cabal-install.cabal 2021-11-17 20:17:03.488421095 +0100
+@@ -209,7 +209,7 @@ library
+ edit-distance >= 0.2.2 && < 0.3,
+ exceptions,
+ filepath >= 1.4.0.0 && < 1.5,
+- hashable >= 1.0 && < 1.4,
++ hashable >= 1.0,
+ HTTP >= 4000.1.5 && < 4000.4,
+ mtl >= 2.0 && < 2.3,
+ network-uri >= 2.6.0.2 && < 2.7,
+diff -upr a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal
+--- a/cabal-install-solver/cabal-install-solver.cabal 2021-11-05 00:16:33.000000000 +0100
++++ b/cabal-install-solver/cabal-install-solver.cabal 2021-11-17 19:42:41.703460745 +0100
+@@ -103,7 +103,7 @@ library
+
+ build-depends:
+ , array >=0.4 && <0.6
+- , base >=4.10 && <4.15
++ , base >=4.10
+ , binary >=0.7.3 && <0.9
+ , bytestring >=0.10.6.0 && <0.12
+ , Cabal ^>=3.7
diff --git a/skip/cabal-stage0/linux-9.0.1.json b/skip/cabal-stage0/linux-9.0.1.json
new file mode 100644
index 0000000..99cb1cb
--- /dev/null
+++ b/skip/cabal-stage0/linux-9.0.1.json
@@ -0,0 +1 @@
+{"builtin":[{"package":"rts","version":"1.0"},{"package":"ghc-prim","version":"0.7.0"},{"package":"ghc-bignum","version":"1.0"},{"package":"base","version":"4.15.0.0"},{"package":"array","version":"0.5.4.0"},{"package":"deepseq","version":"1.4.5.0"},{"package":"bytestring","version":"0.10.12.1"},{"package":"containers","version":"0.6.4.1"},{"package":"binary","version":"0.8.8.0"},{"package":"filepath","version":"1.4.2.1"},{"package":"time","version":"1.9.3"},{"package":"unix","version":"2.7.2.2"},{"package":"directory","version":"1.3.6.1"},{"package":"transformers","version":"0.5.6.2"},{"package":"mtl","version":"2.2.2"},{"package":"ghc-boot-th","version":"9.0.1"},{"package":"pretty","version":"1.1.3.6"},{"package":"template-haskell","version":"2.17.0.0"},{"package":"text","version":"1.2.4.1"},{"package":"parsec","version":"3.1.14.0"},{"package":"process","version":"1.6.11.0"},{"package":"stm","version":"2.5.0.0"},{"package":"exceptions","version":"0.10.4"}],"dependencies":[{"cabal_sha256":null,"flags":["-bundled-binary-generic"],"package":"Cabal","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":"714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1","flags":["-optimised-mixer"],"package":"splitmix","revision":0,"source":"hackage","src_sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","version":"0.1.0.4"},{"cabal_sha256":"8bee24dc0c985a90ee78d94c61f8aed21c49633686f0f1c14c5078d818ee43a2","flags":[],"package":"random","revision":0,"source":"hackage","src_sha256":"265c768fc5f2ca53cde6a87e706b4448cad474c3deece933c103f24453661457","version":"1.2.1"},{"cabal_sha256":"eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37","flags":[],"package":"base-orphans","revision":0,"source":"hackage","src_sha256":"20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb","version":"0.8.6"},{"cabal_sha256":"4f6dfb2a191dd3068c2915ba96a1ab3c4b78b4b4e57186698b9ab42007bfa926","flags":[],"package":"ghc-bignum-orphans","revision":0,"source":"hackage","src_sha256":"a4c617c7b90288ba3e24c67633f99e97e11c2367686463b8884d2cd3591241db","version":"0.1.1"},{"cabal_sha256":"2d553c615bfea61a0b0ff7bc208904d009ff57dbd56f211fbae8584c12f432f9","flags":["+containers","+integer-gmp","-random-initial-seed"],"package":"hashable","revision":0,"source":"hackage","src_sha256":"a1af47889e6ddcbe137d625b7d40665930e935eb396aecbf35399862f276e57d","version":"1.4.0.0"},{"cabal_sha256":"b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0","flags":["-bench"],"package":"async","revision":1,"source":"hackage","src_sha256":"484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725","version":"2.2.4"},{"cabal_sha256":"d8699f46b485f105eea9c7158f3d432ca578e6bbe5d68751184e9899a41d430d","flags":["-old-bytestring","-old-time"],"package":"tar","revision":4,"source":"hackage","src_sha256":"b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de","version":"0.5.1.1"},{"cabal_sha256":"433a5e076aaa8eb3e4158abae78fb409c6bd754e9af99bc2e87583d2bcd8404a","flags":["-devel"],"package":"network","revision":0,"source":"hackage","src_sha256":"f223c08e1c67b1bae4e595dfe87c4873e9f8de7d3f92d0c18e44fd1b2ab01851","version":"3.1.2.5"},{"cabal_sha256":"a16dd922947a6877defe52c4c38d1ab48ed3f85a826930f5d1a568741d619993","flags":[],"package":"th-compat","revision":0,"source":"hackage","src_sha256":"6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6","version":"0.1.3"},{"cabal_sha256":"a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d","flags":[],"package":"network-uri","revision":0,"source":"hackage","src_sha256":"57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584","version":"2.6.4.1"},{"cabal_sha256":"6042643c15a0b43e522a6693f1e322f05000d519543a84149cb80aeffee34f71","flags":["-conduit10","-mtl1","+network-uri","-warn-as-error","-warp-tests"],"package":"HTTP","revision":1,"source":"hackage","src_sha256":"d6091c037871ac3d08d021c906206174567499d5a26a6cb804cf530cd590fe2d","version":"4000.3.16"},{"cabal_sha256":"64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a","flags":[],"package":"base16-bytestring","revision":0,"source":"hackage","src_sha256":"1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784","version":"1.0.2.0"},{"cabal_sha256":"50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8","flags":[],"package":"base64-bytestring","revision":0,"source":"hackage","src_sha256":"fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9","version":"1.2.1.0"},{"cabal_sha256":"4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee","flags":[],"package":"edit-distance","revision":1,"source":"hackage","src_sha256":"3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a","version":"0.2.2.1"},{"cabal_sha256":null,"flags":["-debug-conflict-sets","-debug-expensive-assertions","-debug-tracetree"],"package":"cabal-install-solver","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":"188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332","flags":["-exe","+use-cbits"],"package":"cryptohash-sha256","revision":0,"source":"hackage","src_sha256":"73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6","version":"0.11.102.1"},{"cabal_sha256":"ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42","flags":["-example"],"package":"echo","revision":0,"source":"hackage","src_sha256":"c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43","version":"0.1.4"},{"cabal_sha256":"fb98b08de467d51f788f8bd9391f0e9ab9bd4d8dfc264296b895ffea0d822dfa","flags":["+no-donna","+test-doctests","+test-hlint","+test-properties"],"package":"ed25519","revision":3,"source":"hackage","src_sha256":"d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d","version":"0.0.5.0"},{"cabal_sha256":"2db49b6cb6632a46ec446fc51870cd0d49e0a66d1c5d2063f46ae52a100eb856","flags":["+ofd-locking"],"package":"lukko","revision":1,"source":"hackage","src_sha256":"a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f","version":"0.1.1.3"},{"cabal_sha256":"262a93dbf370be59f4ee57f3b1a51b338bc2c309797daa37c14f2262ae61dae4","flags":["-bundled-c-zlib","-non-blocking-ffi","-pkg-config"],"package":"zlib","revision":1,"source":"hackage","src_sha256":"807f6bddf9cb3c517ce5757d991dde3c7e319953a22c86ee03d74534bd5abc88","version":"0.6.2.3"},{"cabal_sha256":"ae6cdda307237c0b7efeebfb0bf23ff8a26c30f5ba295dce5e4f81ef6e63fff6","flags":["+base48","+lukko","-mtl21","-old-directory","+use-network-uri"],"package":"hackage-security","revision":8,"source":"hackage","src_sha256":"9162b473af5a21c1ff32a50b972b9acf51f4c901604a22cf08a2dccac2f82f17","version":"0.6.0.1"},{"cabal_sha256":"2561adac8ce373910948066debe090a22b336b129ba5af18c0332524d16e72ce","flags":[],"package":"regex-base","revision":0,"source":"hackage","src_sha256":"7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1","version":"0.94.0.2"},{"cabal_sha256":"b6421e5356766b0c0a78b6094ae2e3a6259b42c147b717283c03c1cb09163dca","flags":["-_regex-posix-clib"],"package":"regex-posix","revision":0,"source":"hackage","src_sha256":"c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c","version":"0.96.0.1"},{"cabal_sha256":"25c6e802dc342307e78e5e60433f5e20d03aa783b08b009a399100eb9b6ec529","flags":[],"package":"resolv","revision":3,"source":"hackage","src_sha256":"81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671","version":"0.1.2.0"},{"cabal_sha256":null,"flags":["+lukko","+native-dns"],"package":"cabal-install","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":null,"flags":["+lukko","+native-dns"],"package":"cabal-install","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"}]} \ No newline at end of file
diff --git a/skip/cabal/cabal.project.freeze b/skip/cabal/cabal.project.freeze
new file mode 100644
index 0000000..07c927e
--- /dev/null
+++ b/skip/cabal/cabal.project.freeze
@@ -0,0 +1,65 @@
+active-repositories: hackage.haskell.org:merge
+constraints: any.Cabal ==3.6.2.0,
+ Cabal -bundled-binary-generic,
+ any.HTTP ==4000.3.16,
+ HTTP -conduit10 -mtl1 +network-uri -warn-as-error -warp-tests,
+ any.array ==0.5.4.0,
+ any.async ==2.2.4,
+ async -bench,
+ any.base ==4.15.0.0,
+ any.base-orphans ==0.8.6,
+ any.base16-bytestring ==1.0.2.0,
+ any.base64-bytestring ==1.2.1.0,
+ any.binary ==0.8.8.0,
+ any.bytestring ==0.10.12.1,
+ cabal-install -debug-conflict-sets -debug-expensive-assertions -debug-tracetree +lukko +native-dns,
+ any.containers ==0.6.4.1,
+ any.cryptohash-sha256 ==0.11.102.1,
+ cryptohash-sha256 -exe +use-cbits,
+ any.deepseq ==1.4.5.0,
+ any.directory ==1.3.6.1,
+ any.echo ==0.1.4,
+ echo -example,
+ any.ed25519 ==0.0.5.0,
+ ed25519 +no-donna +test-doctests +test-hlint +test-properties,
+ any.edit-distance ==0.2.2.1,
+ any.filepath ==1.4.2.1,
+ any.ghc-bignum ==1.0,
+ any.ghc-bignum-orphans ==0.1.1,
+ any.ghc-boot-th ==9.0.1,
+ any.ghc-prim ==0.7.0,
+ any.hackage-security ==0.6.0.1,
+ hackage-security +base48 +lukko -mtl21 -old-directory +use-network-uri,
+ any.hashable ==1.4.0.0,
+ hashable +containers +integer-gmp -random-initial-seed,
+ any.hsc2hs ==0.68.8,
+ hsc2hs -in-ghc-tree,
+ any.lukko ==0.1.1.3,
+ lukko +ofd-locking,
+ any.mtl ==2.2.2,
+ any.network ==3.1.2.5,
+ network -devel,
+ any.network-uri ==2.6.4.1,
+ any.parsec ==3.1.14.0,
+ any.pretty ==1.1.3.6,
+ any.process ==1.6.11.0,
+ any.random ==1.2.1,
+ any.regex-base ==0.94.0.2,
+ any.regex-posix ==0.96.0.1,
+ regex-posix -_regex-posix-clib,
+ any.resolv ==0.1.2.0,
+ any.rts ==1.0,
+ any.splitmix ==0.1.0.4,
+ splitmix -optimised-mixer,
+ any.stm ==2.5.0.0,
+ any.tar ==0.5.1.1,
+ tar -old-bytestring -old-time,
+ any.template-haskell ==2.17.0.0,
+ any.text ==1.2.4.1,
+ any.th-compat ==0.1.3,
+ any.time ==1.9.3,
+ any.transformers ==0.5.6.2,
+ any.unix ==2.7.2.2,
+ any.zlib ==0.6.2.3,
+ zlib -bundled-c-zlib -non-blocking-ffi -pkg-config
+index-state: hackage.haskell.org 2021-11-17T20:47:55Z
diff --git a/skip/cabal/cabal.xibuild b/skip/cabal/cabal.xibuild
new file mode 100644
index 0000000..501b0e3
--- /dev/null
+++ b/skip/cabal/cabal.xibuild
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+NAME="cabal"
+DESC="The Haskell Cabal"
+
+MAKEDEPS="cabal-stage0"
+DEPS="gmp libffi musl zlib "
+
+PKG_VER=3.6.2.0
+SOURCE="https://hackage.haskell.org/package/cabal-install-$PKG_VER/cabal-install-$PKG_VER.tar.gz"
+ADDITIONAL="cabal.project.freeze "
+
+
+prepare () {
+ export cabal_home="$BUILD_ROOT/dist"
+
+ ln -sf cabal.project.freeze \
+ "cabal.project.freeze"
+}
+
+build () {
+ HOME="$cabal_home" cabal v2-update
+ HOME="$cabal_home" cabal v2-build all \
+ --allow-newer \
+ --jobs=${JOBS:-1} \
+ --prefix=/usr \
+ --docdir=/usr/share/doc/cabal \
+ --sysconfdir=/etc
+}
+
+package () {
+ HOME="$cabal_home" cabal list-bin --allow-newer all:exes | \
+ xargs install -Dm755 -t "$PKG_DEST"/usr/bin
+
+ mkdir -p "$PKG_DEST"/usr/share/man/man1
+ HOME="$cabal_home" cabal man --raw \
+ > "$PKG_DEST"/usr/share/man/man1/cabal.1
+
+ install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal/LICENSE"
+}
diff --git a/skip/ghc/0000-bootstrap.patch b/skip/ghc/0000-bootstrap.patch
new file mode 100644
index 0000000..95a3f5d
--- /dev/null
+++ b/skip/ghc/0000-bootstrap.patch
@@ -0,0 +1,16 @@
+diff --git a/ghc.mk b/ghc.mk
+index 5e4ecc6..a07ff73 100644
+--- a/ghc.mk
++++ b/ghc.mk
+@@ -968,8 +968,8 @@ INSTALLED_PACKAGE_CONF=$(DESTDIR)$(topdir)/package.conf.d
+ # Install packages in the right order, so that ghc-pkg doesn't complain.
+ # Also, install ghc-pkg first.
+ ifeq "$(Windows_Host)" "NO"
+-INSTALLED_GHC_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc
+-INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(ghclibexecdir)/bin/ghc-pkg
++INSTALLED_GHC_REAL=$(CURDIR)/inplace/bin/ghc-stage1
++INSTALLED_GHC_PKG_REAL=$(CURDIR)/utils/ghc-pkg/dist/build/tmp/ghc-pkg
+ else
+ INSTALLED_GHC_REAL=$(DESTDIR)$(bindir)/ghc.exe
+ INSTALLED_GHC_PKG_REAL=$(DESTDIR)$(bindir)/ghc-pkg.exe
+
diff --git a/skip/ghc/0001-Replace-more-autotools-obsolete-macros-19189.patch b/skip/ghc/0001-Replace-more-autotools-obsolete-macros-19189.patch
new file mode 100644
index 0000000..97e81b7
--- /dev/null
+++ b/skip/ghc/0001-Replace-more-autotools-obsolete-macros-19189.patch
@@ -0,0 +1,152 @@
+From d7d136e134a9f98e55da1b9f53aa54d1a9738c20 Mon Sep 17 00:00:00 2001
+From: Sylvain Henry <sylvain@haskus.fr>
+Date: Fri, 12 Feb 2021 16:38:29 +0100
+Subject: [PATCH 1/9] Replace more autotools obsolete macros (#19189)
+
+Backport of 42ab06f793c0164e2b60acc018ca37d91b46999a
+---
+ aclocal.m4 | 4 ++--
+ configure.ac | 3 ---
+ libraries/base/aclocal.m4 | 6 +++---
+ libraries/base/configure.ac | 7 ++-----
+ libraries/ghc-bignum/configure.ac | 10 +++++-----
+ 5 files changed, 12 insertions(+), 18 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index f4d1351aeb..60008fac60 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -658,7 +658,7 @@ AC_DEFUN([FP_SET_CFLAGS_C99],
+ CPPFLAGS="$$3"
+ unset ac_cv_prog_cc_c99
+ dnl perform detection
+- _AC_PROG_CC_C99
++ AC_PROG_CC_C99
+ fp_cc_c99="$ac_cv_prog_cc_c99"
+ case "x$ac_cv_prog_cc_c99" in
+ x) ;; # noop
+@@ -860,7 +860,7 @@ AC_SUBST(ContextDiffCmd, [$fp_cv_context_diff])
+ # is supported in autoconf versions 2.50 up to the actual 2.57, so there is
+ # little risk.
+ AC_DEFUN([FP_COMPUTE_INT],
+-[_AC_COMPUTE_INT([$1], [$2], [$3], [$4])[]dnl
++[AC_COMPUTE_INT([$2], [$1], [$3], [$4])[]dnl
+ ])# FP_COMPUTE_INT
+
+
+diff --git a/configure.ac b/configure.ac
+index f133a26e55..b34db739f5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -954,9 +954,6 @@ dnl --------------------------------------------------
+ dnl * Platform header file and syscall feature tests
+ dnl ### checking the state of the local header files and syscalls ###
+
+-dnl ** check for full ANSI header (.h) files
+-AC_HEADER_STDC
+-
+ dnl ** Enable large file support. NB. do this before testing the type of
+ dnl off_t, because it will affect the result of that test.
+ AC_SYS_LARGEFILE
+diff --git a/libraries/base/aclocal.m4 b/libraries/base/aclocal.m4
+index 528eac5d21..573c635ea2 100644
+--- a/libraries/base/aclocal.m4
++++ b/libraries/base/aclocal.m4
+@@ -1,4 +1,4 @@
+-# FP_COMPUTE_INT(EXPRESSION, VARIABLE, INCLUDES, IF-FAILS)
++# FP_COMPUTE_INT(VARIABLE, EXPRESSION, INCLUDES, IF-FAILS)
+ # --------------------------------------------------------
+ # Assign VARIABLE the value of the compile-time EXPRESSION using INCLUDES for
+ # compilation. Execute IF-FAILS when unable to determine the value. Works for
+@@ -10,7 +10,7 @@
+ # The public AC_COMPUTE_INT macro isn't supported by some versions of
+ # autoconf.
+ AC_DEFUN([FP_COMPUTE_INT],
+-[_AC_COMPUTE_INT([$2], [$1], [$3], [$4])[]dnl
++[AC_COMPUTE_INT([$1], [$2], [$3], [$4])[]dnl
+ ])# FP_COMPUTE_INT
+
+
+@@ -33,7 +33,7 @@ AS_VAR_POPDEF([fp_Cache])[]dnl
+ # ---------------------------------------
+ # autoheader helper for FP_CHECK_CONSTS
+ m4_define([FP_CHECK_CONSTS_TEMPLATE],
+-[AC_FOREACH([fp_Const], [$1],
++[m4_foreach_w([fp_Const], [$1],
+ [AH_TEMPLATE(AS_TR_CPP(CONST_[]fp_Const),
+ [The value of ]fp_Const[.])])[]dnl
+ ])# FP_CHECK_CONSTS_TEMPLATE
+diff --git a/libraries/base/configure.ac b/libraries/base/configure.ac
+index eff986fb96..a71de293dc 100644
+--- a/libraries/base/configure.ac
++++ b/libraries/base/configure.ac
+@@ -26,9 +26,6 @@ AC_MSG_RESULT($WINDOWS)
+ # do we have long longs?
+ AC_CHECK_TYPES([long long])
+
+-dnl ** check for full ANSI header (.h) files
+-AC_HEADER_STDC
+-
+ # check for specific header (.h) files that we are interested in
+ AC_CHECK_HEADERS([ctype.h errno.h fcntl.h inttypes.h limits.h signal.h sys/file.h sys/resource.h sys/select.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/wait.h termios.h time.h unistd.h utime.h windows.h winsock.h langinfo.h poll.h sys/epoll.h sys/event.h sys/eventfd.h sys/socket.h])
+
+@@ -104,13 +101,13 @@ dnl * Deal with arguments telling us iconv is somewhere odd
+ dnl--------------------------------------------------------------------
+
+ AC_ARG_WITH([iconv-includes],
+- [AC_HELP_STRING([--with-iconv-includes],
++ [AS_HELP_STRING([--with-iconv-includes],
+ [directory containing iconv.h])],
+ [ICONV_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval $CPPFLAGS"],
+ [ICONV_INCLUDE_DIRS=])
+
+ AC_ARG_WITH([iconv-libraries],
+- [AC_HELP_STRING([--with-iconv-libraries],
++ [AS_HELP_STRING([--with-iconv-libraries],
+ [directory containing iconv library])],
+ [ICONV_LIB_DIRS=$withval; LDFLAGS="-L$withval $LDFLAGS"],
+ [ICONV_LIB_DIRS=])
+diff --git a/libraries/ghc-bignum/configure.ac b/libraries/ghc-bignum/configure.ac
+index 1c658fdb70..b237978740 100644
+--- a/libraries/ghc-bignum/configure.ac
++++ b/libraries/ghc-bignum/configure.ac
+@@ -16,31 +16,31 @@ dnl * Deal with arguments telling us gmp is somewhere odd
+ dnl--------------------------------------------------------------------
+
+ AC_ARG_WITH([gmp],
+- [AC_HELP_STRING([--with-gmp],
++ [AS_HELP_STRING([--with-gmp],
+ [Enable GMP backend])],
+ [GMP_ENABLED=YES],
+ [GMP_ENABLED=NO])
+
+ AC_ARG_WITH([gmp-includes],
+- [AC_HELP_STRING([--with-gmp-includes],
++ [AS_HELP_STRING([--with-gmp-includes],
+ [directory containing gmp.h])],
+ [GMP_INCLUDE_DIRS=$withval; CPPFLAGS="-I$withval"],
+ [GMP_INCLUDE_DIRS=])
+
+ AC_ARG_WITH([gmp-libraries],
+- [AC_HELP_STRING([--with-gmp-libraries],
++ [AS_HELP_STRING([--with-gmp-libraries],
+ [directory containing gmp library])],
+ [GMP_LIB_DIRS=$withval; LDFLAGS="-L$withval"],
+ [GMP_LIB_DIRS=])
+
+ AC_ARG_WITH([gmp-framework-preferred],
+- [AC_HELP_STRING([--with-gmp-framework-preferred],
++ [AS_HELP_STRING([--with-gmp-framework-preferred],
+ [on OSX, prefer the GMP framework to the gmp lib])],
+ [GMP_PREFER_FRAMEWORK=YES],
+ [GMP_PREFER_FRAMEWORK=NO])
+
+ AC_ARG_WITH([intree-gmp],
+- [AC_HELP_STRING([--with-intree-gmp],
++ [AS_HELP_STRING([--with-intree-gmp],
+ [force using the in-tree GMP])],
+ [GMP_FORCE_INTREE=YES],
+ [GMP_FORCE_INTREE=NO])
+--
+2.33.0
+
diff --git a/skip/ghc/0002-configure-fix-the-use-of-some-obsolete-macros-19189.patch b/skip/ghc/0002-configure-fix-the-use-of-some-obsolete-macros-19189.patch
new file mode 100644
index 0000000..170013b
--- /dev/null
+++ b/skip/ghc/0002-configure-fix-the-use-of-some-obsolete-macros-19189.patch
@@ -0,0 +1,298 @@
+From dd5fcc988eb67dc6f3aaa6e423f3b41acf4302c4 Mon Sep 17 00:00:00 2001
+From: Sylvain Henry <sylvain@haskus.fr>
+Date: Fri, 8 Jan 2021 11:38:32 +0100
+Subject: [PATCH 2/9] configure: fix the use of some obsolete macros (#19189)
+
+(cherry picked from commit 66414bdf40534f07ac730e25f78e591994d2c1e4)
+---
+ aclocal.m4 | 30 +++++++++++++++---------------
+ configure.ac | 40 ++++++++++++++++++++--------------------
+ 2 files changed, 35 insertions(+), 35 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 60008fac60..6f18a9662d 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -917,7 +917,7 @@ AC_DEFUN(
+ [FP_DEFAULT_CHOICE_OVERRIDE_CHECK],
+ [AC_ARG_ENABLE(
+ [$1],
+- [AC_HELP_STRING(
++ [AS_HELP_STRING(
+ [--enable-$1],
+ [$5])],
+ [AS_IF(
+@@ -1857,12 +1857,12 @@ AC_DEFUN([FP_ICONV],
+ dnl environment.
+
+ AC_ARG_WITH([iconv-includes],
+- [AC_HELP_STRING([--with-iconv-includes],
++ [AS_HELP_STRING([--with-iconv-includes],
+ [directory containing iconv.h])],
+ [ICONV_INCLUDE_DIRS=$withval])
+
+ AC_ARG_WITH([iconv-libraries],
+- [AC_HELP_STRING([--with-iconv-libraries],
++ [AS_HELP_STRING([--with-iconv-libraries],
+ [directory containing iconv library])],
+ [ICONV_LIB_DIRS=$withval])
+
+@@ -1879,23 +1879,23 @@ AC_DEFUN([FP_GMP],
+ dnl--------------------------------------------------------------------
+
+ AC_ARG_WITH([gmp-includes],
+- [AC_HELP_STRING([--with-gmp-includes],
++ [AS_HELP_STRING([--with-gmp-includes],
+ [directory containing gmp.h])],
+ [GMP_INCLUDE_DIRS=$withval])
+
+ AC_ARG_WITH([gmp-libraries],
+- [AC_HELP_STRING([--with-gmp-libraries],
++ [AS_HELP_STRING([--with-gmp-libraries],
+ [directory containing gmp library])],
+ [GMP_LIB_DIRS=$withval])
+
+ AC_ARG_WITH([intree-gmp],
+- [AC_HELP_STRING([--with-intree-gmp],
++ [AS_HELP_STRING([--with-intree-gmp],
+ [force using the in-tree GMP])],
+ [GMP_FORCE_INTREE=YES],
+ [GMP_FORCE_INTREE=NO])
+
+ AC_ARG_WITH([gmp-framework-preferred],
+- [AC_HELP_STRING([--with-gmp-framework-preferred],
++ [AS_HELP_STRING([--with-gmp-framework-preferred],
+ [on OSX, prefer the GMP framework to the gmp lib])],
+ [GMP_PREFER_FRAMEWORK=YES],
+ [GMP_PREFER_FRAMEWORK=NO])
+@@ -1915,7 +1915,7 @@ AC_DEFUN([FP_CURSES],
+ dnl--------------------------------------------------------------------
+
+ AC_ARG_WITH([curses-libraries],
+- [AC_HELP_STRING([--with-curses-libraries],
++ [AS_HELP_STRING([--with-curses-libraries],
+ [directory containing curses libraries])],
+ [CURSES_LIB_DIRS=$withval])
+
+@@ -2347,7 +2347,7 @@ AC_DEFUN([FP_CPP_CMD_WITH_ARGS],[
+ dnl ** what cpp to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_WITH(hs-cpp,
+-[AC_HELP_STRING([--with-hs-cpp=ARG],
++[AS_HELP_STRING([--with-hs-cpp=ARG],
+ [Path to the (C) preprocessor for Haskell files [default=autodetect]])],
+ [
+ if test "$HostOS" = "mingw32"
+@@ -2401,7 +2401,7 @@ AC_ARG_WITH(hs-cpp,
+ dnl ** what cpp flags to use?
+ dnl -----------------------------------------------------------
+ AC_ARG_WITH(hs-cpp-flags,
+- [AC_HELP_STRING([--with-hs-cpp-flags=ARG],
++ [AS_HELP_STRING([--with-hs-cpp-flags=ARG],
+ [Flags to the (C) preprocessor for Haskell files [default=autodetect]])],
+ [
+ if test "$HostOS" = "mingw32"
+@@ -2443,7 +2443,7 @@ $2=$HS_CPP_ARGS
+ AC_DEFUN([FP_BFD_SUPPORT], [
+ AC_SUBST([CabalHaveLibbfd], [False])
+ AC_ARG_ENABLE(bfd-debug,
+- [AC_HELP_STRING([--enable-bfd-debug],
++ [AS_HELP_STRING([--enable-bfd-debug],
+ [Enable symbol resolution for -debug rts ('+RTS -Di') via binutils' libbfd [default=no]])],
+ [
+ # don't pollute general LIBS environment
+@@ -2455,8 +2455,8 @@ AC_DEFUN([FP_BFD_SUPPORT], [
+ dnl 'bfd_init' is a rare non-macro in libbfd
+ AC_CHECK_LIB(bfd, bfd_init)
+
+- AC_TRY_LINK([#include <bfd.h>],
+- [
++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <bfd.h>]],
++ [[
+ /* mimic our rts/Printer.c */
+ bfd* abfd;
+ const char * name;
+@@ -2478,7 +2478,7 @@ AC_DEFUN([FP_BFD_SUPPORT], [
+ number_of_symbols = bfd_canonicalize_symtab (abfd, symbol_table);
+ bfd_get_symbol_info(abfd,symbol_table[0],&info);
+ }
+- ],
++ ]])],
+ [AC_SUBST([CabalHaveLibbfd], [True])],dnl bfd seems to work
+ [AC_MSG_ERROR([can't use 'bfd' library])])
+ LIBS="$save_LIBS"
+@@ -2519,7 +2519,7 @@ AC_DEFUN([FP_CC_LINKER_FLAG_TRY], [
+ #
+ AC_DEFUN([FIND_LD],[
+ AC_ARG_ENABLE(ld-override,
+- [AC_HELP_STRING([--disable-ld-override],
++ [AS_HELP_STRING([--disable-ld-override],
+ [Prevent GHC from overriding the default linker used by gcc. If ld-override is enabled GHC will try to tell gcc to use whichever linker is selected by the LD environment variable. [default=override enabled]])],
+ [],
+ [enable_ld_override=yes])
+diff --git a/configure.ac b/configure.ac
+index b34db739f5..d967d90e70 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -93,21 +93,21 @@ AC_ARG_WITH([ghc],
+ AC_SUBST(WithGhc,$GHC)
+
+ AC_ARG_ENABLE(bootstrap-with-devel-snapshot,
+-[AC_HELP_STRING([--enable-bootstrap-with-devel-snapshot],
++[AS_HELP_STRING([--enable-bootstrap-with-devel-snapshot],
+ [Allow bootstrapping using a development snapshot of GHC. This is not guaranteed to work.])],
+ EnableBootstrapWithDevelSnaphost=YES,
+ EnableBootstrapWithDevelSnaphost=NO
+ )
+
+ AC_ARG_ENABLE(tarballs-autodownload,
+-[AC_HELP_STRING([--enable-tarballs-autodownload],
++[AS_HELP_STRING([--enable-tarballs-autodownload],
+ [Automatically download Windows distribution binaries if needed.])],
+ TarballsAutodownload=YES,
+ TarballsAutodownload=NO
+ )
+
+ AC_ARG_ENABLE(distro-toolchain,
+-[AC_HELP_STRING([--enable-distro-toolchain],
++[AS_HELP_STRING([--enable-distro-toolchain],
+ [Do not use bundled Windows toolchain binaries.])],
+ EnableDistroToolchain=YES,
+ EnableDistroToolchain=NO
+@@ -118,7 +118,7 @@ if test "$EnableDistroToolchain" = "YES"; then
+ fi
+
+ AC_ARG_ENABLE(native-io-manager,
+-[AC_HELP_STRING([--enable-native-io-manager],
++[AS_HELP_STRING([--enable-native-io-manager],
+ [Enable the native I/O manager by default.])],
+ EnableNativeIOManager=YES,
+ EnableNativeIOManager=NO
+@@ -875,7 +875,7 @@ AC_PATH_PROG(AutoreconfCmd, autoreconf, autoreconf)
+
+ dnl ** check for dtrace (currently only implemented for Mac OS X)
+ AC_ARG_ENABLE(dtrace,
+- [AC_HELP_STRING([--enable-dtrace],
++ [AS_HELP_STRING([--enable-dtrace],
+ [Enable DTrace])],
+ EnableDtrace=$enableval,
+ EnableDtrace=yes
+@@ -1066,7 +1066,7 @@ dnl ################################################################
+ # system libffi
+
+ AC_ARG_WITH([system-libffi],
+-[AC_HELP_STRING([--with-system-libffi],
++[AS_HELP_STRING([--with-system-libffi],
+ [Use system provided libffi for RTS [default=no]])
+ ])
+
+@@ -1077,7 +1077,7 @@ AS_IF([test "x$with_system_libffi" = "xyes"],
+ AC_SUBST(UseSystemLibFFI)
+
+ AC_ARG_WITH([ffi-includes],
+-[AC_HELP_STRING([--with-ffi-includes=ARG],
++[AS_HELP_STRING([--with-ffi-includes=ARG],
+ [Find includes for libffi in ARG [default=system default]])
+ ],
+ [
+@@ -1092,7 +1092,7 @@ AC_ARG_WITH([ffi-includes],
+ AC_SUBST(FFIIncludeDir)
+
+ AC_ARG_WITH([ffi-libraries],
+-[AC_HELP_STRING([--with-ffi-libraries=ARG],
++[AS_HELP_STRING([--with-ffi-libraries=ARG],
+ [Find libffi in ARG [default=system default]])
+ ],
+ [
+@@ -1165,7 +1165,7 @@ FP_CHECK_TIMER_CREATE
+
+ dnl ** check for Apple's "interesting" long double compatibility scheme
+ AC_MSG_CHECKING(for printf\$LDBLStub)
+-AC_TRY_LINK_FUNC(printf\$LDBLStub,
++AC_LINK_IFELSE([AC_LANG_CALL([], [printf\$LDBLStub])],
+ [
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_PRINTF_LDBLSTUB],[1],
+@@ -1209,12 +1209,12 @@ dnl ** pthread_setname_np is a recent addition to glibc, and OS X has
+ dnl a different single-argument version.
+ AC_CHECK_LIB(pthread, pthread_setname_np)
+ AC_MSG_CHECKING(for pthread_setname_np)
+-AC_TRY_LINK(
+-[
++AC_LINK_IFELSE([AC_LANG_PROGRAM(
++[[
+ #define _GNU_SOURCE
+ #include <pthread.h>
+-],
+-[pthread_setname_np(pthread_self(), "name");],
++]],
++[[pthread_setname_np(pthread_self(), "name");]])],
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_PTHREAD_SETNAME_NP], [1],
+ [Define to 1 if you have the glibc version of pthread_setname_np]),
+@@ -1253,7 +1253,7 @@ dnl VirtualAlloc MEM_RESERVE 1099512676352 bytes failed: The paging file is t
+ dnl
+
+ AC_ARG_ENABLE(large-address-space,
+- [AC_HELP_STRING([--enable-large-address-space],
++ [AS_HELP_STRING([--enable-large-address-space],
+ [Use a single large address space on 64 bit systems (enabled by default on 64 bit platforms)])],
+ EnableLargeAddressSpace=$enableval,
+ EnableLargeAddressSpace=yes
+@@ -1315,7 +1315,7 @@ AC_DEFINE_UNQUOTED([RTS_LINKER_USE_MMAP], [$RtsLinkerUseMmap],
+ dnl ** Have libdw?
+ dnl --------------------------------------------------------------
+ AC_ARG_WITH([libdw-libraries],
+- [AC_HELP_STRING([--with-libdw-libraries=ARG],
++ [AS_HELP_STRING([--with-libdw-libraries=ARG],
+ [Find libraries for libdw in ARG [default=system default]])
+ ],
+ [
+@@ -1326,7 +1326,7 @@ AC_ARG_WITH([libdw-libraries],
+ AC_SUBST(LibdwLibDir)
+
+ AC_ARG_WITH([libdw-includes],
+- [AC_HELP_STRING([--with-libdw-includes=ARG],
++ [AS_HELP_STRING([--with-libdw-includes=ARG],
+ [Find includes for libdw in ARG [default=system default]])
+ ],
+ [
+@@ -1339,7 +1339,7 @@ AC_SUBST(LibdwIncludeDir)
+ UseLibdw=NO
+ USE_LIBDW=0
+ AC_ARG_ENABLE(dwarf-unwind,
+- [AC_HELP_STRING([--enable-dwarf-unwind],
++ [AS_HELP_STRING([--enable-dwarf-unwind],
+ [Enable DWARF unwinding support in the runtime system via elfutils' libdw [default=no]])])
+ if test "$enable_dwarf_unwind" = "yes" ; then
+ CFLAGS2="$CFLAGS"
+@@ -1368,7 +1368,7 @@ AC_DEFINE_UNQUOTED([USE_LIBDW], [$USE_LIBDW], [Set to 1 to use libdw])
+ dnl ** Have libnuma?
+ dnl --------------------------------------------------------------
+ AC_ARG_WITH([libnuma-libraries],
+- [AC_HELP_STRING([--with-libnuma-libraries=ARG],
++ [AS_HELP_STRING([--with-libnuma-libraries=ARG],
+ [Find libraries for libnuma in ARG [default=system default]])
+ ],
+ [
+@@ -1379,7 +1379,7 @@ AC_ARG_WITH([libnuma-libraries],
+ AC_SUBST(LibNumaLibDir)
+
+ AC_ARG_WITH([libnuma-includes],
+- [AC_HELP_STRING([--with-libnuma-includes=ARG],
++ [AS_HELP_STRING([--with-libnuma-includes=ARG],
+ [Find includes for libnuma in ARG [default=system default]])
+ ],
+ [
+@@ -1391,7 +1391,7 @@ AC_SUBST(LibNumaIncludeDir)
+
+ HaveLibNuma=0
+ AC_ARG_ENABLE(numa,
+- [AC_HELP_STRING([--enable-numa],
++ [AS_HELP_STRING([--enable-numa],
+ [Enable NUMA memory policy and thread affinity support in the
+ runtime system via numactl's libnuma [default=auto]])])
+
+--
+2.33.0
+
diff --git a/skip/ghc/0003-llvmGen-Accept-range-of-LLVM-versions.patch b/skip/ghc/0003-llvmGen-Accept-range-of-LLVM-versions.patch
new file mode 100644
index 0000000..6dd309f
--- /dev/null
+++ b/skip/ghc/0003-llvmGen-Accept-range-of-LLVM-versions.patch
@@ -0,0 +1,484 @@
+From c87c63770f06c6b56382858f893977c47683b65f Mon Sep 17 00:00:00 2001
+From: Ben Gamari <ben@smart-cactus.org>
+Date: Tue, 9 Mar 2021 11:37:18 -0500
+Subject: [PATCH 3/9] llvmGen: Accept range of LLVM versions
+
+Previously we would support only one LLVM major version. Here we
+generalize this to accept a range, taking this range to be LLVM 10 to 11,
+as 11 is necessary for Apple M1 support. We also accept 12, as that is
+what apple ships with BigSur on the M1.
+
+(cherry picked from commit 84927818ee68c6826327abc26d4647fb56053fb7)
+---
+ aclocal.m4 | 35 ++++---
+ compiler/GHC/CmmToLlvm.hs | 11 +-
+ compiler/GHC/CmmToLlvm/Base.hs | 12 ++-
+ compiler/GHC/SysTools/Tasks.hs | 9 +-
+ configure.ac | 12 ++-
+ distrib/configure.ac.in | 7 +-
+ ghc.mk | 9 +-
+ hadrian/src/Rules/BinaryDist.hs | 3 +
+ hadrian/src/Rules/SourceDist.hs | 3 +-
+ m4/ax_compare_version.m4 | 177 ++++++++++++++++++++++++++++++++
+ 10 files changed, 243 insertions(+), 35 deletions(-)
+ create mode 100644 m4/ax_compare_version.m4
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index 6f18a9662d..a296dbc243 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -3,6 +3,8 @@
+ # To be a good autoconf citizen, names of local macros have prefixed with FP_ to
+ # ensure we don't clash with any pre-supplied autoconf ones.
+
++m4_include([m4/ax_compare_version.m4])
++
+ # FPTOOLS_WRITE_FILE
+ # ------------------
+ # Write $2 to the file named $1.
+@@ -2231,22 +2233,29 @@ AC_DEFUN([XCODE_VERSION],[
+ #
+ # $1 = the variable to set
+ # $2 = the command to look for
+-# $3 = the version of the command to look for
++# $3 = the lower bound version of the command to look for
++# $4 = the upper bound version of the command to look for.
+ #
+ AC_DEFUN([FIND_LLVM_PROG],[
+ # Test for program with and without version name.
+- AC_CHECK_TOOLS([$1], [$2-$3 $2-$3.0 $2], [:])
+- if test "$$1" != ":"; then
+- AC_MSG_CHECKING([$$1 is version $3])
+- if test `$$1 --version | grep -c "version $3"` -gt 0 ; then
+- AC_MSG_RESULT(yes)
+- else
+- AC_MSG_RESULT(no)
+- $1=""
+- fi
+- else
+- $1=""
+- fi
++ PROG_VERSION_CANDIDATES=$(for llvmVersion in `seq $4 -1 $3`; do echo "$2-$llvmVersion $2-$llvmVersion.0"; done)
++ AC_CHECK_TOOLS([$1], [$PROG_VERSION_CANDIDATES $2], [])
++ AS_IF([test x"$$1" != x],[
++ PROG_VERSION=`$$1 --version | awk '/.*version [[0-9\.]]+/{for(i=1;i<=NF;i++){ if(\$i ~ /^[[0-9\.]]+$/){print \$i}}}'`
++ AS_IF([test x"$PROG_VERSION" == x],
++ [AC_MSG_RESULT(no)
++ $1=""
++ AC_MSG_NOTICE([We only support llvm $3 to $4 (no version found).])],
++ [AC_MSG_CHECKING([$$1 version ($PROG_VERSION) is between $3 and $4])
++ AX_COMPARE_VERSION([$PROG_VERSION], [lt], [$3],
++ [AC_MSG_RESULT(no)
++ $1=""
++ AC_MSG_NOTICE([We only support llvm $3 to $4 (found $PROG_VERSION).])],
++ [AX_COMPARE_VERSION([$PROG_VERSION], [gt], [$4],
++ [AC_MSG_RESULT(no)
++ $1=""
++ AC_MSG_NOTICE([We only support llvm $3 to $4 (found $PROG_VERSION).])],
++ [AC_MSG_RESULT(yes)])])])])
+ ])
+
+ # CHECK_LD_COPY_BUG()
+diff --git a/compiler/GHC/CmmToLlvm.hs b/compiler/GHC/CmmToLlvm.hs
+index ac8e9718e4..0d2ecb16be 100644
+--- a/compiler/GHC/CmmToLlvm.hs
++++ b/compiler/GHC/CmmToLlvm.hs
+@@ -64,7 +64,8 @@ llvmCodeGen dflags h cmm_stream
+ let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags
+ when (not (llvmVersionSupported ver) && doWarn) $ putMsg dflags $
+ "You are using an unsupported version of LLVM!" $$
+- "Currently only " <> text (llvmVersionStr supportedLlvmVersion) <> " is supported." <+>
++ "Currently only" <+> text (llvmVersionStr supportedLlvmVersionMin) <+>
++ "to" <+> text (llvmVersionStr supportedLlvmVersionMax) <+> "is supported." <+>
+ "System LLVM version: " <> text (llvmVersionStr ver) $$
+ "We will try though..."
+ let isS390X = platformArch (targetPlatform dflags) == ArchS390X
+@@ -73,8 +74,14 @@ llvmCodeGen dflags h cmm_stream
+ "Warning: For s390x the GHC calling convention is only supported since LLVM version 10." <+>
+ "You are using LLVM version: " <> text (llvmVersionStr ver)
+
++ -- HACK: the Nothing case here is potentially wrong here but we
++ -- currently don't use the LLVM version to guide code generation
++ -- so this is okay.
++ let llvm_ver :: LlvmVersion
++ llvm_ver = fromMaybe supportedLlvmVersionMin mb_ver
++
+ -- run code generation
+- a <- runLlvm dflags (fromMaybe supportedLlvmVersion mb_ver) bufh $
++ a <- runLlvm dflags llvm_ver bufh $
+ llvmCodeGen' dflags (liftStream cmm_stream)
+
+ bFlush bufh
+diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs
+index ead3572a79..a47bfd3baa 100644
+--- a/compiler/GHC/CmmToLlvm/Base.hs
++++ b/compiler/GHC/CmmToLlvm/Base.hs
+@@ -15,7 +15,8 @@ module GHC.CmmToLlvm.Base (
+ LiveGlobalRegs,
+ LlvmUnresData, LlvmData, UnresLabel, UnresStatic,
+
+- LlvmVersion, supportedLlvmVersion, llvmVersionSupported, parseLlvmVersion,
++ LlvmVersion, supportedLlvmVersionMin, supportedLlvmVersionMax,
++ llvmVersionSupported, parseLlvmVersion,
+ llvmVersionStr, llvmVersionList,
+
+ LlvmM,
+@@ -266,6 +267,7 @@ llvmPtrBits platform = widthInBits $ typeWidth $ gcWord platform
+
+ -- Newtype to avoid using the Eq instance!
+ newtype LlvmVersion = LlvmVersion { llvmVersionNE :: NE.NonEmpty Int }
++ deriving (Eq, Ord)
+
+ parseLlvmVersion :: String -> Maybe LlvmVersion
+ parseLlvmVersion =
+@@ -282,11 +284,13 @@ parseLlvmVersion =
+ (ver_str, rest) = span isDigit s
+
+ -- | The LLVM Version that is currently supported.
+-supportedLlvmVersion :: LlvmVersion
+-supportedLlvmVersion = LlvmVersion (sUPPORTED_LLVM_VERSION NE.:| [])
++supportedLlvmVersionMin, supportedLlvmVersionMax :: LlvmVersion
++supportedLlvmVersionMin = LlvmVersion (sUPPORTED_LLVM_VERSION_MIN NE.:| [])
++supportedLlvmVersionMax = LlvmVersion (sUPPORTED_LLVM_VERSION_MAX NE.:| [])
+
+ llvmVersionSupported :: LlvmVersion -> Bool
+-llvmVersionSupported (LlvmVersion v) = NE.head v == sUPPORTED_LLVM_VERSION
++llvmVersionSupported v =
++ v > supportedLlvmVersionMin && v <= supportedLlvmVersionMax
+
+ llvmVersionStr :: LlvmVersion -> String
+ llvmVersionStr = intercalate "." . map show . llvmVersionList
+diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
+index 7dc40cef04..1ab3a0a425 100644
+--- a/compiler/GHC/SysTools/Tasks.hs
++++ b/compiler/GHC/SysTools/Tasks.hs
+@@ -11,6 +11,7 @@ module GHC.SysTools.Tasks where
+
+ import GHC.Utils.Exception as Exception
+ import GHC.Utils.Error
++import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersionMin, supportedLlvmVersionMax, llvmVersionStr, parseLlvmVersion)
+ import GHC.Driver.Types
+ import GHC.Driver.Session
+ import GHC.Utils.Outputable
+@@ -23,8 +24,6 @@ import System.IO
+ import System.Process
+ import GHC.Prelude
+
+-import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersion, parseLlvmVersion)
+-
+ import GHC.SysTools.Process
+ import GHC.SysTools.Info
+
+@@ -236,8 +235,10 @@ figureLlvmVersion dflags = traceToolCommand dflags "llc" $ do
+ errorMsg dflags $ vcat
+ [ text "Warning:", nest 9 $
+ text "Couldn't figure out LLVM version!" $$
+- text ("Make sure you have installed LLVM " ++
+- llvmVersionStr supportedLlvmVersion) ]
++ text ("Make sure you have installed LLVM between "
++ ++ llvmVersionStr supportedLlvmVersionMin
++ ++ " and "
++ ++ llvmVersionStr supportedLlvmVersionMax) ]
+ return Nothing)
+
+
+diff --git a/configure.ac b/configure.ac
+index d967d90e70..c6a1c96d02 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -716,10 +716,14 @@ AC_SUBST(InstallNameToolCmd)
+ # tools we are looking for. In the past, GHC supported a number of
+ # versions of LLVM simultaneously, but that stopped working around
+ # 3.5/3.6 release of LLVM.
+-LlvmVersion=9
+-AC_SUBST([LlvmVersion])
+-sUPPORTED_LLVM_VERSION=$(echo \($LlvmVersion\) | sed 's/\./,/')
+-AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION], ${sUPPORTED_LLVM_VERSION}, [The supported LLVM version number])
++LlvmMinVersion=10
++LlvmMaxVersion=12 # inclusive
++AC_SUBST([LlvmMinVersion])
++AC_SUBST([LlvmMaxVersion])
++sUPPORTED_LLVM_VERSION_MIN=$(echo \($LlvmMinVersion\) | sed 's/\./,/')
++sUPPORTED_LLVM_VERSION_MAX=$(echo \($LlvmMaxVersion\) | sed 's/\./,/')
++AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MIN], ${sUPPORTED_LLVM_VERSION_MIN}, [The minimum supported LLVM version number])
++AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MAX], ${sUPPORTED_LLVM_VERSION_MAX}, [The maximum supported LLVM version number])
+
+ dnl ** Which LLVM clang to use?
+ dnl --------------------------------------------------------------
+diff --git a/distrib/configure.ac.in b/distrib/configure.ac.in
+index 4de89941df..c287c3368d 100644
+--- a/distrib/configure.ac.in
++++ b/distrib/configure.ac.in
+@@ -118,19 +118,20 @@ AC_SUBST([StripCmd])
+ # tools we are looking for. In the past, GHC supported a number of
+ # versions of LLVM simultaneously, but that stopped working around
+ # 3.5/3.6 release of LLVM.
+-LlvmVersion=@LlvmVersion@
++LlvmMinVersion=@LlvmMinVersion@
++LlvmMaxVersion=@LlvmMaxVersion@
+
+ dnl ** Which LLVM llc to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]])
+-FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion])
++FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
+ LlcCmd="$LLC"
+ AC_SUBST([LlcCmd])
+
+ dnl ** Which LLVM opt to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]])
+-FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion])
++FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
+ OptCmd="$OPT"
+ AC_SUBST([OptCmd])
+
+diff --git a/ghc.mk b/ghc.mk
+index 8434bd1d6e..0623e3eb5d 100644
+--- a/ghc.mk
++++ b/ghc.mk
+@@ -1074,7 +1074,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk
+ unix-binary-dist-prep: $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM) $(includes_1_H_VERSION)
+ $(call removeTrees,bindistprep/)
+ "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR)
+- set -e; for i in packages LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh llvm-targets llvm-passes ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
++ set -e; for i in packages LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile m4 aclocal.m4 config.sub config.guess install-sh llvm-targets llvm-passes ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done
+ echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK)
+ echo "BUILD_SPHINX_HTML = $(BUILD_SPHINX_HTML)" >> $(BIN_DIST_MK)
+ echo "BUILD_SPHINX_PDF = $(BUILD_SPHINX_PDF)" >> $(BIN_DIST_MK)
+@@ -1167,12 +1167,13 @@ SRC_DIST_TESTSUITE_TARBALL = $(SRC_DIST_ROOT)/$(SRC_DIST_TESTSUITE_NAME).
+ #
+ # Files to include in source distributions
+ #
+-SRC_DIST_GHC_DIRS = mk rules docs distrib bindisttest libffi includes \
++SRC_DIST_GHC_DIRS = mk m4 rules docs distrib bindisttest libffi includes \
+ utils docs rts compiler ghc driver libraries libffi-tarballs \
+- hadrian
++ hadrian
+ SRC_DIST_GHC_FILES += \
+ configure.ac config.guess config.sub configure \
+- aclocal.m4 README.md ANNOUNCE HACKING.md INSTALL.md LICENSE Makefile \
++ aclocal.m4 m4/ax_compare_version.m4 \
++ README.md ANNOUNCE HACKING.md INSTALL.md LICENSE Makefile \
+ install-sh llvm-targets llvm-passes VERSION GIT_COMMIT_ID \
+ boot packages ghc.mk MAKEHELP.md
+
+diff --git a/hadrian/src/Rules/BinaryDist.hs b/hadrian/src/Rules/BinaryDist.hs
+index 8709de6b26..a527664b23 100644
+--- a/hadrian/src/Rules/BinaryDist.hs
++++ b/hadrian/src/Rules/BinaryDist.hs
+@@ -203,11 +203,14 @@ bindistRules = do
+ root -/- "bindist" -/- "ghc-*" -/- "configure" %> \configurePath -> do
+ ghcRoot <- topDirectory
+ copyFile (ghcRoot -/- "aclocal.m4") (ghcRoot -/- "distrib" -/- "aclocal.m4")
++ copyDirectory (ghcRoot -/- "m4") (ghcRoot -/- "distrib")
+ buildWithCmdOptions [] $
+ target (vanillaContext Stage1 ghc) (Autoreconf $ ghcRoot -/- "distrib") [] []
+ -- We clean after ourselves, moving the configure script we generated in
+ -- our bindist dir
+ removeFile (ghcRoot -/- "distrib" -/- "aclocal.m4")
++ removeDirectory (ghcRoot -/- "distrib" -/- "m4")
++
+ moveFile (ghcRoot -/- "distrib" -/- "configure") configurePath
+
+ -- Generate the Makefile that enables the "make install" part
+diff --git a/hadrian/src/Rules/SourceDist.hs b/hadrian/src/Rules/SourceDist.hs
+index 78c1539b3d..de35922ae1 100644
+--- a/hadrian/src/Rules/SourceDist.hs
++++ b/hadrian/src/Rules/SourceDist.hs
+@@ -113,7 +113,8 @@ prepareTree dest = do
+ , "mk"
+ , "rts"
+ , "rules"
+- , "utils" ]
++ , "utils"
++ , "m4" ]
+ srcFiles =
+ [ "GIT_COMMIT_ID"
+ , "HACKING.md"
+diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4
+new file mode 100644
+index 0000000000..ffb4997e8b
+--- /dev/null
++++ b/m4/ax_compare_version.m4
+@@ -0,0 +1,177 @@
++# ===========================================================================
++# https://www.gnu.org/software/autoconf-archive/ax_compare_version.html
++# ===========================================================================
++#
++# SYNOPSIS
++#
++# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
++#
++# DESCRIPTION
++#
++# This macro compares two version strings. Due to the various number of
++# minor-version numbers that can exist, and the fact that string
++# comparisons are not compatible with numeric comparisons, this is not
++# necessarily trivial to do in a autoconf script. This macro makes doing
++# these comparisons easy.
++#
++# The six basic comparisons are available, as well as checking equality
++# limited to a certain number of minor-version levels.
++#
++# The operator OP determines what type of comparison to do, and can be one
++# of:
++#
++# eq - equal (test A == B)
++# ne - not equal (test A != B)
++# le - less than or equal (test A <= B)
++# ge - greater than or equal (test A >= B)
++# lt - less than (test A < B)
++# gt - greater than (test A > B)
++#
++# Additionally, the eq and ne operator can have a number after it to limit
++# the test to that number of minor versions.
++#
++# eq0 - equal up to the length of the shorter version
++# ne0 - not equal up to the length of the shorter version
++# eqN - equal up to N sub-version levels
++# neN - not equal up to N sub-version levels
++#
++# When the condition is true, shell commands ACTION-IF-TRUE are run,
++# otherwise shell commands ACTION-IF-FALSE are run. The environment
++# variable 'ax_compare_version' is always set to either 'true' or 'false'
++# as well.
++#
++# Examples:
++#
++# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
++# AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
++#
++# would both be true.
++#
++# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
++# AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
++#
++# would both be false.
++#
++# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
++#
++# would be true because it is only comparing two minor versions.
++#
++# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
++#
++# would be true because it is only comparing the lesser number of minor
++# versions of the two values.
++#
++# Note: The characters that separate the version numbers do not matter. An
++# empty string is the same as version 0. OP is evaluated by autoconf, not
++# configure, so must be a string, not a variable.
++#
++# The author would like to acknowledge Guido Draheim whose advice about
++# the m4_case and m4_ifvaln functions make this macro only include the
++# portions necessary to perform the specific comparison specified by the
++# OP argument in the final configure script.
++#
++# LICENSE
++#
++# Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
++#
++# Copying and distribution of this file, with or without modification, are
++# permitted in any medium without royalty provided the copyright notice
++# and this notice are preserved. This file is offered as-is, without any
++# warranty.
++
++#serial 13
++
++dnl #########################################################################
++AC_DEFUN([AX_COMPARE_VERSION], [
++ AC_REQUIRE([AC_PROG_AWK])
++
++ # Used to indicate true or false condition
++ ax_compare_version=false
++
++ # Convert the two version strings to be compared into a format that
++ # allows a simple string comparison. The end result is that a version
++ # string of the form 1.12.5-r617 will be converted to the form
++ # 0001001200050617. In other words, each number is zero padded to four
++ # digits, and non digits are removed.
++ AS_VAR_PUSHDEF([A],[ax_compare_version_A])
++ A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
++ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/[[^0-9]]//g'`
++
++ AS_VAR_PUSHDEF([B],[ax_compare_version_B])
++ B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
++ -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
++ -e 's/[[^0-9]]//g'`
++
++ dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
++ dnl # then the first line is used to determine if the condition is true.
++ dnl # The sed right after the echo is to remove any indented white space.
++ m4_case(m4_tolower($2),
++ [lt],[
++ ax_compare_version=`echo "x$A
++x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
++ ],
++ [gt],[
++ ax_compare_version=`echo "x$A
++x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
++ ],
++ [le],[
++ ax_compare_version=`echo "x$A
++x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
++ ],
++ [ge],[
++ ax_compare_version=`echo "x$A
++x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
++ ],[
++ dnl Split the operator from the subversion count if present.
++ m4_bmatch(m4_substr($2,2),
++ [0],[
++ # A count of zero means use the length of the shorter version.
++ # Determine the number of characters in A and B.
++ ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
++ ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
++
++ # Set A to no more than B's length and B to no more than A's length.
++ A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
++ B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
++ ],
++ [[0-9]+],[
++ # A count greater than zero means use only that many subversions
++ A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
++ B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
++ ],
++ [.+],[
++ AC_WARNING(
++ [invalid OP numeric parameter: $2])
++ ],[])
++
++ # Pad zeros at end of numbers to make same length.
++ ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
++ B="$B`echo $A | sed 's/./0/g'`"
++ A="$ax_compare_version_tmp_A"
++
++ # Check for equality or inequality as necessary.
++ m4_case(m4_tolower(m4_substr($2,0,2)),
++ [eq],[
++ test "x$A" = "x$B" && ax_compare_version=true
++ ],
++ [ne],[
++ test "x$A" != "x$B" && ax_compare_version=true
++ ],[
++ AC_WARNING([invalid OP parameter: $2])
++ ])
++ ])
++
++ AS_VAR_POPDEF([A])dnl
++ AS_VAR_POPDEF([B])dnl
++
++ dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
++ if test "$ax_compare_version" = "true" ; then
++ m4_ifvaln([$4],[$4],[:])dnl
++ m4_ifvaln([$5],[else $5])dnl
++ fi
++]) dnl AX_COMPARE_VERSION
+--
+2.33.0
+
diff --git a/skip/ghc/0004-Fix-autoconf-after-6d6edb1bbb.patch b/skip/ghc/0004-Fix-autoconf-after-6d6edb1bbb.patch
new file mode 100644
index 0000000..8f20645
--- /dev/null
+++ b/skip/ghc/0004-Fix-autoconf-after-6d6edb1bbb.patch
@@ -0,0 +1,33 @@
+From 2b3d2665e6aa3de86a4d4e1979c34453542b7b07 Mon Sep 17 00:00:00 2001
+From: Haochen Tong <i@hexchain.org>
+Date: Sun, 5 Sep 2021 16:22:31 +0800
+Subject: [PATCH 4/9] Fix autoconf after 6d6edb1bbb
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c6a1c96d02..cf93f10938 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -735,14 +735,14 @@ AC_SUBST([ClangCmd])
+ dnl ** Which LLVM llc to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]])
+-FIND_LLVM_PROG([LLC], [llc], [$LlvmVersion])
++FIND_LLVM_PROG([LLC], [llc], [$LlvmMinVersion], [$LlvmMaxVersion])
+ LlcCmd="$LLC"
+ AC_SUBST([LlcCmd])
+
+ dnl ** Which LLVM opt to use?
+ dnl --------------------------------------------------------------
+ AC_ARG_VAR(OPT,[Use as the path to LLVM's opt [default=autodetect]])
+-FIND_LLVM_PROG([OPT], [opt], [$LlvmVersion])
++FIND_LLVM_PROG([OPT], [opt], [$LlvmMinVersion], [$LlvmMaxVersion])
+ OptCmd="$OPT"
+ AC_SUBST([OptCmd])
+
+--
+2.33.0
+
diff --git a/skip/ghc/0005-Set-min-LLVM-version-to-9-and-make-version-checking-.patch b/skip/ghc/0005-Set-min-LLVM-version-to-9-and-make-version-checking-.patch
new file mode 100644
index 0000000..f2a00c3
--- /dev/null
+++ b/skip/ghc/0005-Set-min-LLVM-version-to-9-and-make-version-checking-.patch
@@ -0,0 +1,143 @@
+From 5279eac5ce1a82d661dfaa911e892a591c7f95c0 Mon Sep 17 00:00:00 2001
+From: Zubin Duggal <zubin.duggal@gmail.com>
+Date: Thu, 17 Jun 2021 16:25:46 +0530
+Subject: [PATCH 5/9] Set min LLVM version to 9 and make version checking use a
+ non-inclusive upper bound.
+
+We use a non-inclusive upper bound so that setting the upper bound to 13 for
+example means that all 12.x versions are accepted.
+---
+ aclocal.m4 | 2 +-
+ compiler/GHC/CmmToLlvm.hs | 6 +++---
+ compiler/GHC/CmmToLlvm/Base.hs | 16 +++++++++-------
+ compiler/GHC/SysTools/Tasks.hs | 9 +++++----
+ configure.ac | 4 ++--
+ 5 files changed, 20 insertions(+), 17 deletions(-)
+
+diff --git a/aclocal.m4 b/aclocal.m4
+index a296dbc243..0219ea3a61 100644
+--- a/aclocal.m4
++++ b/aclocal.m4
+@@ -2251,7 +2251,7 @@ AC_DEFUN([FIND_LLVM_PROG],[
+ [AC_MSG_RESULT(no)
+ $1=""
+ AC_MSG_NOTICE([We only support llvm $3 to $4 (found $PROG_VERSION).])],
+- [AX_COMPARE_VERSION([$PROG_VERSION], [gt], [$4],
++ [AX_COMPARE_VERSION([$PROG_VERSION], [ge], [$4],
+ [AC_MSG_RESULT(no)
+ $1=""
+ AC_MSG_NOTICE([We only support llvm $3 to $4 (found $PROG_VERSION).])],
+diff --git a/compiler/GHC/CmmToLlvm.hs b/compiler/GHC/CmmToLlvm.hs
+index 0d2ecb16be..8bc7dc65b4 100644
+--- a/compiler/GHC/CmmToLlvm.hs
++++ b/compiler/GHC/CmmToLlvm.hs
+@@ -64,8 +64,8 @@ llvmCodeGen dflags h cmm_stream
+ let doWarn = wopt Opt_WarnUnsupportedLlvmVersion dflags
+ when (not (llvmVersionSupported ver) && doWarn) $ putMsg dflags $
+ "You are using an unsupported version of LLVM!" $$
+- "Currently only" <+> text (llvmVersionStr supportedLlvmVersionMin) <+>
+- "to" <+> text (llvmVersionStr supportedLlvmVersionMax) <+> "is supported." <+>
++ "Currently only" <+> text (llvmVersionStr supportedLlvmVersionLowerBound) <+>
++ "to" <+> text (llvmVersionStr supportedLlvmVersionUpperBound) <+> "is supported." <+>
+ "System LLVM version: " <> text (llvmVersionStr ver) $$
+ "We will try though..."
+ let isS390X = platformArch (targetPlatform dflags) == ArchS390X
+@@ -78,7 +78,7 @@ llvmCodeGen dflags h cmm_stream
+ -- currently don't use the LLVM version to guide code generation
+ -- so this is okay.
+ let llvm_ver :: LlvmVersion
+- llvm_ver = fromMaybe supportedLlvmVersionMin mb_ver
++ llvm_ver = fromMaybe supportedLlvmVersionLowerBound mb_ver
+
+ -- run code generation
+ a <- runLlvm dflags llvm_ver bufh $
+diff --git a/compiler/GHC/CmmToLlvm/Base.hs b/compiler/GHC/CmmToLlvm/Base.hs
+index a47bfd3baa..86f9944f59 100644
+--- a/compiler/GHC/CmmToLlvm/Base.hs
++++ b/compiler/GHC/CmmToLlvm/Base.hs
+@@ -15,7 +15,7 @@ module GHC.CmmToLlvm.Base (
+ LiveGlobalRegs,
+ LlvmUnresData, LlvmData, UnresLabel, UnresStatic,
+
+- LlvmVersion, supportedLlvmVersionMin, supportedLlvmVersionMax,
++ LlvmVersion, supportedLlvmVersionLowerBound, supportedLlvmVersionUpperBound,
+ llvmVersionSupported, parseLlvmVersion,
+ llvmVersionStr, llvmVersionList,
+
+@@ -265,7 +265,6 @@ llvmPtrBits platform = widthInBits $ typeWidth $ gcWord platform
+ -- * Llvm Version
+ --
+
+--- Newtype to avoid using the Eq instance!
+ newtype LlvmVersion = LlvmVersion { llvmVersionNE :: NE.NonEmpty Int }
+ deriving (Eq, Ord)
+
+@@ -283,14 +282,17 @@ parseLlvmVersion =
+ where
+ (ver_str, rest) = span isDigit s
+
+--- | The LLVM Version that is currently supported.
+-supportedLlvmVersionMin, supportedLlvmVersionMax :: LlvmVersion
+-supportedLlvmVersionMin = LlvmVersion (sUPPORTED_LLVM_VERSION_MIN NE.:| [])
+-supportedLlvmVersionMax = LlvmVersion (sUPPORTED_LLVM_VERSION_MAX NE.:| [])
++-- | The (inclusive) lower bound on the LLVM Version that is currently supported.
++supportedLlvmVersionLowerBound :: LlvmVersion
++supportedLlvmVersionLowerBound = LlvmVersion (sUPPORTED_LLVM_VERSION_MIN NE.:| [])
++
++-- | The (not-inclusive) upper bound bound on the LLVM Version that is currently supported.
++supportedLlvmVersionUpperBound :: LlvmVersion
++supportedLlvmVersionUpperBound = LlvmVersion (sUPPORTED_LLVM_VERSION_MAX NE.:| [])
+
+ llvmVersionSupported :: LlvmVersion -> Bool
+ llvmVersionSupported v =
+- v > supportedLlvmVersionMin && v <= supportedLlvmVersionMax
++ v >= supportedLlvmVersionLowerBound && v < supportedLlvmVersionUpperBound
+
+ llvmVersionStr :: LlvmVersion -> String
+ llvmVersionStr = intercalate "." . map show . llvmVersionList
+diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs
+index 1ab3a0a425..4d5158e940 100644
+--- a/compiler/GHC/SysTools/Tasks.hs
++++ b/compiler/GHC/SysTools/Tasks.hs
+@@ -11,7 +11,7 @@ module GHC.SysTools.Tasks where
+
+ import GHC.Utils.Exception as Exception
+ import GHC.Utils.Error
+-import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersionMin, supportedLlvmVersionMax, llvmVersionStr, parseLlvmVersion)
++import GHC.CmmToLlvm.Base (LlvmVersion, llvmVersionStr, supportedLlvmVersionLowerBound, supportedLlvmVersionUpperBound, llvmVersionStr, parseLlvmVersion)
+ import GHC.Driver.Types
+ import GHC.Driver.Session
+ import GHC.Utils.Outputable
+@@ -235,10 +235,11 @@ figureLlvmVersion dflags = traceToolCommand dflags "llc" $ do
+ errorMsg dflags $ vcat
+ [ text "Warning:", nest 9 $
+ text "Couldn't figure out LLVM version!" $$
+- text ("Make sure you have installed LLVM between "
+- ++ llvmVersionStr supportedLlvmVersionMin
++ text ("Make sure you have installed LLVM between ["
++ ++ llvmVersionStr supportedLlvmVersionLowerBound
+ ++ " and "
+- ++ llvmVersionStr supportedLlvmVersionMax) ]
++ ++ llvmVersionStr supportedLlvmVersionUpperBound
++ ++ ")") ]
+ return Nothing)
+
+
+diff --git a/configure.ac b/configure.ac
+index cf93f10938..e0423add87 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -716,8 +716,8 @@ AC_SUBST(InstallNameToolCmd)
+ # tools we are looking for. In the past, GHC supported a number of
+ # versions of LLVM simultaneously, but that stopped working around
+ # 3.5/3.6 release of LLVM.
+-LlvmMinVersion=10
+-LlvmMaxVersion=12 # inclusive
++LlvmMinVersion=9 # inclusive
++LlvmMaxVersion=13 # not inclusive
+ AC_SUBST([LlvmMinVersion])
+ AC_SUBST([LlvmMaxVersion])
+ sUPPORTED_LLVM_VERSION_MIN=$(echo \($LlvmMinVersion\) | sed 's/\./,/')
+--
+2.33.0
+
diff --git a/skip/ghc/0005-buildpath-abi-stability.patch b/skip/ghc/0005-buildpath-abi-stability.patch
new file mode 100644
index 0000000..377eb41
--- /dev/null
+++ b/skip/ghc/0005-buildpath-abi-stability.patch
@@ -0,0 +1,25 @@
+Forwarded to https://gitlab.haskell.org/ghc/ghc/-/issues/10424
+
+Index: ghc/compiler/GHC/Iface/Utils.hs
+===================================================================
+--- a/compiler/GHC/Iface/Recomp.hs
++++ b/compiler/GHC/Iface/Recomp.hs
+@@ -556,7 +556,7 @@
+ iface_hash <- computeFingerprint putNameLiterally
+ (mod_hash,
+ ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
+- mi_usages iface0,
++ usages,
+ sorted_deps,
+ mi_hpc iface0)
+
+@@ -589,6 +589,9 @@
+ (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0)
+ fix_fn = mi_fix_fn iface0
+ ann_fn = mkIfaceAnnCache (mi_anns iface0)
++ -- Do not allow filenames to affect the interface
++ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ]
++
+
+ getOrphanHashes :: HscEnv -> [Module] -> IO [Fingerprint]
+ getOrphanHashes hsc_env mods = do
diff --git a/skip/ghc/0006-Optimiser-Correctly-deal-with-strings-starting-with-unicode.patch b/skip/ghc/0006-Optimiser-Correctly-deal-with-strings-starting-with-unicode.patch
new file mode 100644
index 0000000..19673a9
--- /dev/null
+++ b/skip/ghc/0006-Optimiser-Correctly-deal-with-strings-starting-with-unicode.patch
@@ -0,0 +1,132 @@
+From a02fbadaf59521b5f1af3f05b45933b245093531 Mon Sep 17 00:00:00 2001
+From: Matthew Pickering <matthewtpickering@gmail.com>
+Date: Fri, 11 Jun 2021 10:48:25 +0100
+Subject: [PATCH] Optimiser: Correctly deal with strings starting with unicode
+ characters in exprConApp_maybe
+
+For example:
+
+"\0" is encoded to "C0 80", then the rule would correct use a decoding
+function to work out the first character was "C0 80" but then just used
+BS.tail so the rest of the string was "80". This resulted in
+
+"\0" being transformed into '\C0\80' : unpackCStringUTF8# "80"
+
+Which is obviously bogus.
+
+I rewrote the function to call utf8UnconsByteString directly and avoid
+the roundtrip through Faststring so now the head/tail is computed by the
+same call.
+
+Fixes #19976
+
+(cherry picked from commit 7f6454fb8cd92b2b2ad4e88fa6d81e34d43edb9a)
+---
+ compiler/GHC/Core/SimpleOpt.hs | 38 +++++++++----------
+ compiler/GHC/Utils/Encoding.hs | 9 +++++
+ .../tests/simplCore/should_compile/T9400.hs | 4 ++
+ 3 files changed, 30 insertions(+), 21 deletions(-)
+
+diff --git a/compiler/GHC/Core/SimpleOpt.hs b/compiler/GHC/Core/SimpleOpt.hs
+index 5f1ed2ba528..9fca9d0b4b8 100644
+--- a/compiler/GHC/Core/SimpleOpt.hs
++++ b/compiler/GHC/Core/SimpleOpt.hs
+@@ -52,13 +52,13 @@ import GHC.Builtin.Types
+ import GHC.Builtin.Names
+ import GHC.Types.Basic
+ import GHC.Unit.Module ( Module )
++import GHC.Utils.Encoding
+ import GHC.Utils.Error
+ import GHC.Driver.Session
+ import GHC.Utils.Outputable
+ import GHC.Data.Pair
+ import GHC.Utils.Misc
+ import GHC.Data.Maybe ( orElse )
+-import GHC.Data.FastString
+ import Data.List
+ import qualified Data.ByteString as BS
+
+@@ -841,9 +841,8 @@ calls to unpackCString# and returns:
+
+ Just (':', [Char], ['a', unpackCString# "bc"]).
+
+-We need to be careful about UTF8 strings here. ""# contains a ByteString, so
+-we must parse it back into a FastString to split off the first character.
+-That way we can treat unpackCString# and unpackCStringUtf8# in the same way.
++We need to be careful about UTF8 strings here. ""# contains an encoded ByteString, so
++we call utf8UnconsByteString to correctly deal with the encoding and splitting.
+
+ We must also be careful about
+ lvl = "foo"#
+@@ -852,6 +851,8 @@ to ensure that we see through the let-binding for 'lvl'. Hence the
+ (exprIsLiteral_maybe .. arg) in the guard before the call to
+ dealWithStringLiteral.
+
++The tests for this function are in T9400.
++
+ Note [Push coercions in exprIsConApp_maybe]
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ In #13025 I found a case where we had
+@@ -1204,23 +1205,18 @@ dealWithStringLiteral :: Var -> BS.ByteString -> Coercion
+ -- This is not possible with user-supplied empty literals, GHC.Core.Make.mkStringExprFS
+ -- turns those into [] automatically, but just in case something else in GHC
+ -- generates a string literal directly.
+-dealWithStringLiteral _ str co
+- | BS.null str
+- = pushCoDataCon nilDataCon [Type charTy] co
+-
+-dealWithStringLiteral fun str co
+- = let strFS = mkFastStringByteString str
+-
+- char = mkConApp charDataCon [mkCharLit (headFS strFS)]
+- charTail = BS.tail (bytesFS strFS)
+-
+- -- In singleton strings, just add [] instead of unpackCstring# ""#.
+- rest = if BS.null charTail
+- then mkConApp nilDataCon [Type charTy]
+- else App (Var fun)
+- (Lit (LitString charTail))
+-
+- in pushCoDataCon consDataCon [Type charTy, char, rest] co
++dealWithStringLiteral fun str co =
++ case utf8UnconsByteString str of
++ Nothing -> pushCoDataCon nilDataCon [Type charTy] co
++ Just (char, charTail) ->
++ let char_expr = mkConApp charDataCon [mkCharLit char]
++ -- In singleton strings, just add [] instead of unpackCstring# ""#.
++ rest = if BS.null charTail
++ then mkConApp nilDataCon [Type charTy]
++ else App (Var fun)
++ (Lit (LitString charTail))
++
++ in pushCoDataCon consDataCon [Type charTy, char_expr, rest] co
+
+ {-
+ Note [Unfolding DFuns]
+diff --git a/compiler/GHC/Utils/Encoding.hs b/compiler/GHC/Utils/Encoding.hs
+index 24637a3bffa..273706befe5 100644
+--- a/compiler/GHC/Utils/Encoding.hs
++++ b/compiler/GHC/Utils/Encoding.hs
+@@ -18,6 +18,7 @@ module GHC.Utils.Encoding (
+ utf8CharStart,
+ utf8DecodeChar,
+ utf8DecodeByteString,
++ utf8UnconsByteString,
+ utf8DecodeShortByteString,
+ utf8DecodeStringLazy,
+ utf8EncodeChar,
+@@ -154,6 +155,14 @@ utf8DecodeByteString :: ByteString -> [Char]
+ utf8DecodeByteString (BS.PS fptr offset len)
+ = utf8DecodeStringLazy fptr offset len
+
++utf8UnconsByteString :: ByteString -> Maybe (Char, ByteString)
++utf8UnconsByteString (BS.PS _ _ 0) = Nothing
++utf8UnconsByteString (BS.PS fptr offset len)
++ = unsafeDupablePerformIO $
++ withForeignPtr fptr $ \ptr -> do
++ let (c,n) = utf8DecodeChar (ptr `plusPtr` offset)
++ return $ Just (c, BS.PS fptr (offset + n) (len - n))
++
+ utf8DecodeStringLazy :: ForeignPtr Word8 -> Int -> Int -> [Char]
+ utf8DecodeStringLazy fp offset (I# len#)
+ = unsafeDupablePerformIO $ do
diff --git a/skip/ghc/ghc.xibuild b/skip/ghc/ghc.xibuild
new file mode 100644
index 0000000..ecd9adf
--- /dev/null
+++ b/skip/ghc/ghc.xibuild
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+NAME="ghc"
+DESC="The Glasgow Haskell Compiler"
+
+MAKEDEPS="make "
+DEPS="sbase gcc gmp libffi llvm musl ncurses perl "
+
+PKG_VER=9.0.1
+SOURCE="https://downloads.haskell.org/~ghc/$PKG_VER/ghc-$PKG_VER-src.tar.xz"
+ADDITIONAL="tests-use-iterable-from-collections-abc.patch skip-tests.patch 0006-Optimiser-Correctly-deal-with-strings-starting-with-unicode.patch 0005-buildpath-abi-stability.patch 0005-Set-min-LLVM-version-to-9-and-make-version-checking-.patch 0004-Fix-autoconf-after-6d6edb1bbb.patch 0003-llvmGen-Accept-range-of-LLVM-versions.patch 0002-configure-fix-the-use-of-some-obsolete-macros-19189.patch 0001-Replace-more-autotools-obsolete-macros-19189.patch 0000-bootstrap.patch "
+
+prepare () {
+ apply_patches
+
+ cp mk/build.mk.sample mk/build.mk
+
+ cat >> mk/build.mk <<-EOF
+ BuildFlavour = perf-llvm
+ EOF
+ autoreconf -fi
+}
+
+build () {
+ ./configure \
+ --prefix=/usr \
+ --bindir=/usr/bin \
+ --sysconfdir=/etc \
+ --with-system-libffi \
+ --disable-ld-override
+ make
+}
+
+package () {
+ make DESTDIR=$PKG_DEST install
+}
diff --git a/skip/ghc/skip-tests.patch b/skip/ghc/skip-tests.patch
new file mode 100644
index 0000000..684f18f
--- /dev/null
+++ b/skip/ghc/skip-tests.patch
@@ -0,0 +1,39 @@
+diff --git a/libraries/base/tests/IO/all.T b/libraries/base/tests/IO/all.T
+index 9475183..ba662de 100644
+--- a/libraries/base/tests/IO/all.T
++++ b/libraries/base/tests/IO/all.T
+@@ -119,7 +119,9 @@ test('encoding001', [], compile_and_run, [''])
+
+ test('encoding002', normal, compile_and_run, [''])
+ test('encoding003', normal, compile_and_run, [''])
+-test('encoding004', extra_files(['encoded-data/']), compile_and_run, [''])
++test('encoding004',
++ [when(platform('x86_64-alpine-linux'), skip), extra_files(['encoded-data/'])],
++ compile_and_run, [''])
+ test('encoding005', normal, compile_and_run, [''])
+
+ test('environment001', [], makefile_test, ['environment001-test'])
+diff --git a/testsuite/tests/ghci/linking/all.T b/testsuite/tests/ghci/linking/all.T
+index 29a3142..0fd3be9 100644
+--- a/testsuite/tests/ghci/linking/all.T
++++ b/testsuite/tests/ghci/linking/all.T
+@@ -7,6 +7,7 @@ test('ghcilink001',
+
+ test('ghcilink002', [extra_files(['TestLink.hs', 'f.c']),
+ when(unregisterised(), fragile(16085)),
++ when(platform('x86_64-alpine-linux'), skip),
+ unless(doing_ghci, skip)],
+ makefile_test, ['ghcilink002'])
+
+diff --git a/testsuite/tests/ghci/linking/dyn/all.T b/testsuite/tests/ghci/linking/dyn/all.T
+index 127c970..62b053c 100644
+--- a/testsuite/tests/ghci/linking/dyn/all.T
++++ b/testsuite/tests/ghci/linking/dyn/all.T
+@@ -25,6 +25,7 @@ test('T10955dyn', [extra_files(['A.c', 'B.c'])], makefile_test, ['compile_libAB_
+ test('T10458',
+ [extra_files(['A.c']),
+ unless(doing_ghci, skip),
++ when(platform('x86_64-alpine-linux'), skip),
+ pre_cmd('$MAKE -s --no-print-directory compile_libT10458'),
+ extra_hc_opts('-L"$PWD/T10458dir" -lAS')],
+ ghci_script, ['T10458.script'])
diff --git a/skip/ghc/tests-use-iterable-from-collections-abc.patch b/skip/ghc/tests-use-iterable-from-collections-abc.patch
new file mode 100644
index 0000000..cf77555
--- /dev/null
+++ b/skip/ghc/tests-use-iterable-from-collections-abc.patch
@@ -0,0 +1,23 @@
+Iterable has been moved to collections.abc
+diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
+index e899d61b..2f967666 100644
+--- a/testsuite/driver/testlib.py
++++ b/testsuite/driver/testlib.py
+@@ -15,7 +15,7 @@ import glob
+ import sys
+ from math import ceil, trunc
+ from pathlib import Path, PurePath
+-import collections
++import collections.abc
+ import subprocess
+
+ from testglobals import config, ghc_env, default_testopts, brokens, t, \
+@@ -809,7 +809,7 @@ def join_normalisers(*a):
+ Taken from http://stackoverflow.com/a/2158532/946226
+ """
+ for el in l:
+- if (isinstance(el, collections.Iterable)
++ if (isinstance(el, collections.abc.Iterable)
+ and not isinstance(el, (bytes, str))):
+ for sub in flatten(el):
+ yield sub
diff --git a/skip/icecat/allow-custom-rust-vendor.patch b/skip/icecat/allow-custom-rust-vendor.patch
new file mode 100644
index 0000000..218650f
--- /dev/null
+++ b/skip/icecat/allow-custom-rust-vendor.patch
@@ -0,0 +1,564 @@
+From a5a3db2d32ff1d359aef5ec586b91164570c1685 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Tue, 5 Nov 2019 09:56:15 -0800
+Subject: [PATCH 1/7] Support custom vendor strings.
+
+Add support for custom vendors, as in "x86_64-gentoo-linux-musl".
+
+Fixes #33.
+---
+ src/targets.rs | 108 ++++++++++++++++++++++++++++++++++++++++++++++++-
+ src/triple.rs | 4 --
+ 2 files changed, 106 insertions(+), 6 deletions(-)
+
+diff --git a/src/targets.rs b/src/targets.rs
+index 6ae570e..90b2736 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/targets.rs
+@@ -1,6 +1,8 @@
+ // This file defines all the identifier enums and target-aware logic.
+
+ use crate::triple::{Endianness, PointerWidth, Triple};
++use alloc::boxed::Box;
++use alloc::string::String;
+ use core::fmt;
+ use core::str::FromStr;
+
+@@ -292,7 +294,7 @@ impl Aarch64Architecture {
+
+ /// The "vendor" field, which in practice is little more than an arbitrary
+ /// modifier.
+-#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
++#[derive(Clone, Debug, PartialEq, Eq, Hash)]
+ #[allow(missing_docs)]
+ pub enum Vendor {
+ Unknown,
+@@ -306,6 +308,15 @@ pub enum Vendor {
+ Sun,
+ Uwp,
+ Wrs,
++
++ /// A custom vendor. "Custom" in this context means that the vendor is
++ /// not specifically recognized by upstream Autotools, LLVM, Rust, or other
++ /// relevant authorities on triple naming. It's useful for people building
++ /// and using locally patched toolchains.
++ ///
++ /// Outside of such patched environments, users of `target-lexicon` should
++ /// treat `Custom` the same as `Unknown` and ignore the string.
++ Custom(Box<String>),
+ }
+
+ /// The "operating system" field, which sometimes implies an environment, and
+@@ -717,6 +728,7 @@ impl fmt::Display for Vendor {
+ Vendor::Sun => "sun",
+ Vendor::Uwp => "uwp",
+ Vendor::Wrs => "wrs",
++ Vendor::Custom(ref name) => name,
+ };
+ f.write_str(s)
+ }
+@@ -738,7 +750,46 @@ impl FromStr for Vendor {
+ "sun" => Vendor::Sun,
+ "uwp" => Vendor::Uwp,
+ "wrs" => Vendor::Wrs,
+- _ => return Err(()),
++ custom => {
++ use alloc::borrow::ToOwned;
++
++ // A custom vendor. Since triple syntax is so loosely defined,
++ // be as conservative as we can to avoid potential ambiguities.
++ // We err on the side of being too strict here, as we can
++ // always relax it if needed.
++
++ // Don't allow empty string names.
++ if custom.is_empty() {
++ return Err(());
++ }
++
++ // Don't allow any other recognized name as a custom vendor,
++ // since vendors can be omitted in some contexts.
++ if Architecture::from_str(custom).is_ok()
++ || OperatingSystem::from_str(custom).is_ok()
++ || Environment::from_str(custom).is_ok()
++ || BinaryFormat::from_str(custom).is_ok()
++ {
++ return Err(());
++ }
++
++ // Require the first character to be an ascii lowercase.
++ if !custom.chars().nth(0).unwrap().is_ascii_lowercase() {
++ return Err(());
++ }
++
++ // Restrict the set of characters permitted in a custom vendor.
++ if custom
++ .find(|c: char| {
++ !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
++ })
++ .is_some()
++ {
++ return Err(());
++ }
++
++ Vendor::Custom(Box::new(custom.to_owned()))
++ }
+ })
+ }
+ }
+@@ -1120,4 +1171,57 @@ mod tests {
+ assert_eq!(t.environment, Environment::Eabihf);
+ assert_eq!(t.binary_format, BinaryFormat::Elf);
+ }
++
++ #[test]
++ fn custom_vendors() {
++ assert!(Triple::from_str("x86_64--linux").is_err());
++ assert!(Triple::from_str("x86_64-42-linux").is_err());
++ assert!(Triple::from_str("x86_64-__customvendor__-linux").is_err());
++ assert!(Triple::from_str("x86_64-^-linux").is_err());
++ assert!(Triple::from_str("x86_64- -linux").is_err());
++ assert!(Triple::from_str("x86_64-CustomVendor-linux").is_err());
++ assert!(Triple::from_str("x86_64-linux-linux").is_err());
++ assert!(Triple::from_str("x86_64-x86_64-linux").is_err());
++ assert!(Triple::from_str("x86_64-elf-linux").is_err());
++ assert!(Triple::from_str("x86_64-gnu-linux").is_err());
++ assert!(Triple::from_str("x86_64-linux-customvendor").is_err());
++ assert!(Triple::from_str("customvendor").is_err());
++ assert!(Triple::from_str("customvendor-x86_64").is_err());
++ assert!(Triple::from_str("x86_64-").is_err());
++ assert!(Triple::from_str("x86_64--").is_err());
++
++ let t = Triple::from_str("x86_64-customvendor-linux")
++ .expect("can't parse target with custom vendor");
++ assert_eq!(t.architecture, Architecture::X86_64);
++ assert_eq!(
++ t.vendor,
++ Vendor::Custom(Box::new(String::from_str("customvendor").unwrap()))
++ );
++ assert_eq!(t.operating_system, OperatingSystem::Linux);
++ assert_eq!(t.environment, Environment::Unknown);
++ assert_eq!(t.binary_format, BinaryFormat::Elf);
++ assert_eq!(t.to_string(), "x86_64-customvendor-linux");
++
++ let t = Triple::from_str("x86_64-customvendor")
++ .expect("can't parse target with custom vendor");
++ assert_eq!(t.architecture, Architecture::X86_64);
++ assert_eq!(
++ t.vendor,
++ Vendor::Custom(Box::new(String::from_str("customvendor").unwrap()))
++ );
++ assert_eq!(t.operating_system, OperatingSystem::Unknown);
++ assert_eq!(t.environment, Environment::Unknown);
++ assert_eq!(t.binary_format, BinaryFormat::Unknown);
++
++ assert_eq!(
++ Triple::from_str("unknown-foo"),
++ Ok(Triple {
++ architecture: Architecture::Unknown,
++ vendor: Vendor::Custom(Box::new(String::from_str("foo").unwrap())),
++ operating_system: OperatingSystem::Unknown,
++ environment: Environment::Unknown,
++ binary_format: BinaryFormat::Unknown,
++ })
++ );
++ }
+ }
+diff --git a/src/triple.rs b/src/triple.rs
+index 36dcd9a..1abda26 100644
+--- a/third_party/rust/target-lexicon.0.9.0/src/triple.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/triple.rs
+@@ -322,10 +322,6 @@ mod tests {
+ Triple::from_str("foo"),
+ Err(ParseError::UnrecognizedArchitecture("foo".to_owned()))
+ );
+- assert_eq!(
+- Triple::from_str("unknown-foo"),
+- Err(ParseError::UnrecognizedVendor("foo".to_owned()))
+- );
+ assert_eq!(
+ Triple::from_str("unknown-unknown-foo"),
+ Err(ParseError::UnrecognizedOperatingSystem("foo".to_owned()))
+
+From 6f90d7274dce4e7f9bb120f6b36cf26881bde9a7 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Tue, 5 Nov 2019 10:33:56 -0800
+Subject: [PATCH 2/7] Add more tests.
+
+---
+ src/targets.rs | 30 ++++++++++++++++++++++++++++--
+ 1 file changed, 28 insertions(+), 2 deletions(-)
+
+diff --git a/src/targets.rs b/src/targets.rs
+index 90b2736..7d1f069 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/targets.rs
+@@ -1174,6 +1174,7 @@ mod tests {
+
+ #[test]
+ fn custom_vendors() {
++ // Test various invalid cases.
+ assert!(Triple::from_str("x86_64--linux").is_err());
+ assert!(Triple::from_str("x86_64-42-linux").is_err());
+ assert!(Triple::from_str("x86_64-__customvendor__-linux").is_err());
+@@ -1190,6 +1191,31 @@ mod tests {
+ assert!(Triple::from_str("x86_64-").is_err());
+ assert!(Triple::from_str("x86_64--").is_err());
+
++ // Test various Unicode things.
++ assert!(
++ Triple::from_str("x86_64-𝓬𝓾𝓼𝓽𝓸𝓶𝓿𝓮𝓷𝓭𝓸𝓻-linux").is_err(),
++ "unicode font hazard"
++ );
++ assert!(
++ Triple::from_str("x86_64-ćúśtőḿvéńdőŕ-linux").is_err(),
++ "diacritical mark stripping hazard"
++ );
++ assert!(
++ Triple::from_str("x86_64-customvendοr-linux").is_err(),
++ "homoglyph hazard"
++ );
++ assert!(Triple::from_str("x86_64-customvendor-linux").is_ok());
++ assert!(
++ Triple::from_str("x86_64-ffi-linux").is_err(),
++ "normalization hazard"
++ );
++ assert!(Triple::from_str("x86_64-ffi-linux").is_ok());
++ assert!(
++ Triple::from_str("x86_64-custom‍vendor-linux").is_err(),
++ "zero-width character hazard"
++ );
++
++ // Test some valid cases.
+ let t = Triple::from_str("x86_64-customvendor-linux")
+ .expect("can't parse target with custom vendor");
+ assert_eq!(t.architecture, Architecture::X86_64);
+@@ -1202,8 +1228,8 @@ mod tests {
+ assert_eq!(t.binary_format, BinaryFormat::Elf);
+ assert_eq!(t.to_string(), "x86_64-customvendor-linux");
+
+- let t = Triple::from_str("x86_64-customvendor")
+- .expect("can't parse target with custom vendor");
++ let t =
++ Triple::from_str("x86_64-customvendor").expect("can't parse target with custom vendor");
+ assert_eq!(t.architecture, Architecture::X86_64);
+ assert_eq!(
+ t.vendor,
+
+From c0e318b3c1be2d1965579f07dd563fb9cc0c4eb1 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Tue, 5 Nov 2019 12:56:31 -0800
+Subject: [PATCH 3/7] Use `.chars().any(...)` instead of
+ `.find(...).is_some()`.
+
+---
+ src/targets.rs | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/src/targets.rs b/src/targets.rs
+index 7d1f069..1078dd3 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon/src-0.9.0/targets.rs
+@@ -779,12 +779,9 @@ impl FromStr for Vendor {
+ }
+
+ // Restrict the set of characters permitted in a custom vendor.
+- if custom
+- .find(|c: char| {
+- !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
+- })
+- .is_some()
+- {
++ if custom.chars().any(|c: char| {
++ !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
++ }) {
+ return Err(());
+ }
+
+
+From f319950528654c772193d9eb3bf40bc8df35fcae Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Thu, 7 Nov 2019 15:15:48 -0800
+Subject: [PATCH 4/7] Fix build.rs to generate the correct code to build
+ Vendors.
+
+---
+ build.rs | 14 ++++++++++++--
+ 1 file changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/build.rs b/build.rs
+index a0ba3b7..446f9e7 100644
+--- a/third_party/rust/target-lexicon-0.9.0/build.rs
++++ b/third_party/rust/target-lexicon-0.9.0/build.rs
+@@ -32,6 +32,7 @@ mod parse_error {
+ }
+ }
+
++use self::targets::Vendor;
+ use self::triple::Triple;
+
+ fn main() {
+@@ -60,7 +61,7 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+ " architecture: Architecture::{:?},",
+ triple.architecture
+ )?;
+- writeln!(out, " vendor: Vendor::{:?},", triple.vendor)?;
++ writeln!(out, " vendor: {},", vendor_display(&triple.vendor))?;
+ writeln!(
+ out,
+ " operating_system: OperatingSystem::{:?},",
+@@ -90,7 +91,7 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+ writeln!(out, "impl Vendor {{")?;
+ writeln!(out, " /// Return the vendor for the current host.")?;
+ writeln!(out, " pub const fn host() -> Self {{")?;
+- writeln!(out, " Vendor::{:?}", triple.vendor)?;
++ writeln!(out, " {}", vendor_display(&triple.vendor))?;
+ writeln!(out, " }}")?;
+ writeln!(out, "}}")?;
+ writeln!(out)?;
+@@ -160,3 +161,12 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+
+ Ok(())
+ }
++
++fn vendor_display(vendor: &Vendor) -> String {
++ match vendor {
++ Vendor::Custom(custom) => {
++ format!("Vendor::Custom(Box::new(String::from_str({:?})))", custom)
++ }
++ known => format!("Vendor::{:?}", known),
++ }
++}
+
+From e558f6934535be3b8ccc9a99a33e861cb7431dfe Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Fri, 8 Nov 2019 12:10:34 -0800
+Subject: [PATCH 5/7] Fix custom vendors in `const fn` contexts.
+
+---
+ build.rs | 15 +++++++++++----
+ src/lib.rs | 4 ++--
+ src/targets.rs | 51 ++++++++++++++++++++++++++++++++++++++++++--------
+ 3 files changed, 56 insertions(+), 14 deletions(-)
+
+diff --git a/build.rs b/build.rs
+index 446f9e7..e88206e 100644
+--- a/third_party/rust/target-lexicon-0.9.0/build.rs
++++ b/third_party/rust/target-lexicon-0.9.0/build.rs
+@@ -53,6 +53,8 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+ writeln!(out, "use crate::Aarch64Architecture::*;")?;
+ writeln!(out, "#[allow(unused_imports)]")?;
+ writeln!(out, "use crate::ArmArchitecture::*;")?;
++ writeln!(out, "#[allow(unused_imports)]")?;
++ writeln!(out, "use crate::CustomVendor;")?;
+ writeln!(out)?;
+ writeln!(out, "/// The `Triple` of the current host.")?;
+ writeln!(out, "pub const HOST: Triple = Triple {{")?;
+@@ -139,7 +141,11 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+ " architecture: Architecture::{:?},",
+ triple.architecture
+ )?;
+- writeln!(out, " vendor: Vendor::{:?},", triple.vendor)?;
++ writeln!(
++ out,
++ " vendor: {},",
++ vendor_display(&triple.vendor)
++ )?;
+ writeln!(
+ out,
+ " operating_system: OperatingSystem::{:?},",
+@@ -164,9 +170,10 @@ fn write_host_rs(mut out: File, triple: Triple) -> io::Result<()> {
+
+ fn vendor_display(vendor: &Vendor) -> String {
+ match vendor {
+- Vendor::Custom(custom) => {
+- format!("Vendor::Custom(Box::new(String::from_str({:?})))", custom)
+- }
++ Vendor::Custom(custom) => format!(
++ "Vendor::Custom(CustomVendor::Static({:?}))",
++ custom.as_str()
++ ),
+ known => format!("Vendor::{:?}", known),
+ }
+ }
+diff --git a/src/lib.rs b/src/lib.rs
+index 8d6da8d..70f6488 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/lib.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/lib.rs
+@@ -28,7 +28,7 @@ mod triple;
+ pub use self::host::HOST;
+ pub use self::parse_error::ParseError;
+ pub use self::targets::{
+- Aarch64Architecture, Architecture, ArmArchitecture, BinaryFormat, Environment, OperatingSystem,
+- Vendor,
++ Aarch64Architecture, Architecture, ArmArchitecture, BinaryFormat, CustomVendor, Environment,
++ OperatingSystem, Vendor,
+ };
+ pub use self::triple::{CallingConvention, Endianness, PointerWidth, Triple};
+diff --git a/src/targets.rs b/src/targets.rs
+index 1078dd3..7152020 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/targets.rs
+@@ -4,6 +4,7 @@ use crate::triple::{Endianness, PointerWidth, Triple};
+ use alloc::boxed::Box;
+ use alloc::string::String;
+ use core::fmt;
++use core::hash::{Hash, Hasher};
+ use core::str::FromStr;
+
+ /// The "architecture" field, which in some cases also specifies a specific
+@@ -292,6 +293,39 @@ impl Aarch64Architecture {
+ }
+ }
+
++/// A string for a `Vendor::Custom` that can either be used in `const`
++/// contexts or hold dynamic strings.
++#[derive(Clone, Debug, Eq)]
++pub enum CustomVendor {
++ /// An owned `String`. This supports the general case.
++ Owned(Box<String>),
++ /// A static `str`, so that `CustomVendor` can be constructed in `const`
++ /// contexts.
++ Static(&'static str),
++}
++
++impl CustomVendor {
++ /// Extracts a string slice.
++ pub fn as_str(&self) -> &str {
++ match self {
++ CustomVendor::Owned(s) => s,
++ CustomVendor::Static(s) => s,
++ }
++ }
++}
++
++impl PartialEq for CustomVendor {
++ fn eq(&self, other: &Self) -> bool {
++ self.as_str() == other.as_str()
++ }
++}
++
++impl Hash for CustomVendor {
++ fn hash<H: Hasher>(&self, state: &mut H) {
++ self.as_str().hash(state)
++ }
++}
++
+ /// The "vendor" field, which in practice is little more than an arbitrary
+ /// modifier.
+ #[derive(Clone, Debug, PartialEq, Eq, Hash)]
+@@ -316,7 +350,7 @@ pub enum Vendor {
+ ///
+ /// Outside of such patched environments, users of `target-lexicon` should
+ /// treat `Custom` the same as `Unknown` and ignore the string.
+- Custom(Box<String>),
++ Custom(CustomVendor),
+ }
+
+ /// The "operating system" field, which sometimes implies an environment, and
+@@ -728,7 +762,7 @@ impl fmt::Display for Vendor {
+ Vendor::Sun => "sun",
+ Vendor::Uwp => "uwp",
+ Vendor::Wrs => "wrs",
+- Vendor::Custom(ref name) => name,
++ Vendor::Custom(ref name) => name.as_str(),
+ };
+ f.write_str(s)
+ }
+@@ -779,13 +813,14 @@ impl FromStr for Vendor {
+ }
+
+ // Restrict the set of characters permitted in a custom vendor.
+- if custom.chars().any(|c: char| {
++ fn is_prohibited_char(c: char) -> bool {
+ !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
+- }) {
++ }
++ if custom.chars().any(is_prohibited_char) {
+ return Err(());
+ }
+
+- Vendor::Custom(Box::new(custom.to_owned()))
++ Vendor::Custom(CustomVendor::Owned(Box::new(custom.to_owned())))
+ }
+ })
+ }
+@@ -1218,7 +1253,7 @@ mod tests {
+ assert_eq!(t.architecture, Architecture::X86_64);
+ assert_eq!(
+ t.vendor,
+- Vendor::Custom(Box::new(String::from_str("customvendor").unwrap()))
++ Vendor::Custom(CustomVendor::Static("customvendor"))
+ );
+ assert_eq!(t.operating_system, OperatingSystem::Linux);
+ assert_eq!(t.environment, Environment::Unknown);
+@@ -1230,7 +1265,7 @@ mod tests {
+ assert_eq!(t.architecture, Architecture::X86_64);
+ assert_eq!(
+ t.vendor,
+- Vendor::Custom(Box::new(String::from_str("customvendor").unwrap()))
++ Vendor::Custom(CustomVendor::Static("customvendor"))
+ );
+ assert_eq!(t.operating_system, OperatingSystem::Unknown);
+ assert_eq!(t.environment, Environment::Unknown);
+@@ -1240,7 +1275,7 @@ mod tests {
+ Triple::from_str("unknown-foo"),
+ Ok(Triple {
+ architecture: Architecture::Unknown,
+- vendor: Vendor::Custom(Box::new(String::from_str("foo").unwrap())),
++ vendor: Vendor::Custom(CustomVendor::Static("foo")),
+ operating_system: OperatingSystem::Unknown,
+ environment: Environment::Unknown,
+ binary_format: BinaryFormat::Unknown,
+
+From bc4b444133b8a5e56602f7c77c10ef3f1e7a7c78 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Mon, 18 Nov 2019 13:45:58 -0800
+Subject: [PATCH 6/7] Add a testcase with a BOM too, just in case.
+
+---
+ src/targets.rs | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/targets.rs b/src/targets.rs
+index 7152020..9a4d990 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/targets.rs
+@@ -1246,6 +1246,10 @@ mod tests {
+ Triple::from_str("x86_64-custom‍vendor-linux").is_err(),
+ "zero-width character hazard"
+ );
++ assert!(
++ Triple::from_str("x86_64-customvendor-linux").is_err(),
++ "BOM hazard"
++ );
+
+ // Test some valid cases.
+ let t = Triple::from_str("x86_64-customvendor-linux")
+
+From 721fbbe1c9cfd3adc9aaf011c62d6a36078f4133 Mon Sep 17 00:00:00 2001
+From: Dan Gohman <sunfish@mozilla.com>
+Date: Mon, 18 Nov 2019 20:56:40 -0800
+Subject: [PATCH 7/7] Use an anonymous function instead of just a local
+ function.
+
+---
+ src/targets.rs | 5 ++---
+ 1 file changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/src/targets.rs b/src/targets.rs
+index 9a4d990..eb5a088 100644
+--- a/third_party/rust/target-lexicon-0.9.0/src/targets.rs
++++ b/third_party/rust/target-lexicon-0.9.0/src/targets.rs
+@@ -813,10 +813,9 @@ impl FromStr for Vendor {
+ }
+
+ // Restrict the set of characters permitted in a custom vendor.
+- fn is_prohibited_char(c: char) -> bool {
++ if custom.chars().any(|c: char| {
+ !(c.is_ascii_lowercase() || c.is_ascii_digit() || c == '_' || c == '.')
+- }
+- if custom.chars().any(is_prohibited_char) {
++ }) {
+ return Err(());
+ }
+
diff --git a/skip/icecat/avoid-redefinition.patch b/skip/icecat/avoid-redefinition.patch
new file mode 100644
index 0000000..af11c50
--- /dev/null
+++ b/skip/icecat/avoid-redefinition.patch
@@ -0,0 +1,15 @@
+Author: Rasmus Thomsen <oss@cogitri.dev>
+Reason: FF is mixing userspace net headers (net/if.h) and kernelspace ones
+(linux/if.h), leading to redefinitions. We need to include net/if.h before
+linux/if.h because linux/if.h has redifinition guards whereas net/if.h doesnt
+Upstream: No
+--- a/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c.orig 2020-07-28 19:24:32.359751046 +0200
++++ b/dom/media/webrtc/transport/third_party/nICEr/src/stun/addrs-netlink.c 2020-07-28 19:24:37.856343751 +0200
+@@ -31,6 +31,7 @@
+ */
+
+ #if defined(LINUX)
++#include <net/if.h>
+ #include "addrs-netlink.h"
+ #include <csi_platform.h>
+ #include <assert.h>
diff --git a/skip/icecat/disable-moz-stackwalk.patch b/skip/icecat/disable-moz-stackwalk.patch
new file mode 100644
index 0000000..b6bc756
--- /dev/null
+++ b/skip/icecat/disable-moz-stackwalk.patch
@@ -0,0 +1,18 @@
+diff --git a/mozglue/misc/StackWalk.cpp b/mozglue/misc/StackWalk.cpp
+index 7d62921..adcfa44 100644
+--- a/mozglue/misc/StackWalk.cpp
++++ b/mozglue/misc/StackWalk.cpp
+@@ -33,13 +33,7 @@ using namespace mozilla;
+ # define MOZ_STACKWALK_SUPPORTS_MACOSX 0
+ #endif
+
+-#if (defined(linux) && \
+- ((defined(__GNUC__) && (defined(__i386) || defined(PPC))) || \
+- defined(HAVE__UNWIND_BACKTRACE)))
+-# define MOZ_STACKWALK_SUPPORTS_LINUX 1
+-#else
+ # define MOZ_STACKWALK_SUPPORTS_LINUX 0
+-#endif
+
+ #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1)
+ # define HAVE___LIBC_STACK_END 1
diff --git a/skip/icecat/disable-neon-in-aom.patch b/skip/icecat/disable-neon-in-aom.patch
new file mode 100644
index 0000000..6df05a1
--- /dev/null
+++ b/skip/icecat/disable-neon-in-aom.patch
@@ -0,0 +1,39 @@
+Firefox (75) and AOM itself fail to build with NEON enabled. As such
+we should disable it for now.
+
+In file included from /home/buildozer/aports/community/firefox/src/firefox-75.0/third_party/aom/aom_dsp/arm/blend_a64_mask_neon.c:12:
+/home/buildozer/aports/community/firefox/src/firefox-75.0/third_party/aom/av1/common/arm/mem_neon.h: In function 'load_u8_8x8':
+/usr/lib/gcc/armv7-alpine-linux-musleabihf/9.3.0/include/arm_neon.h:10303:1: error: inlining failed in call to always_inline 'vld1_u8': target specific option mismatch
+10303 | vld1_u8 (const uint8_t * __a)
+ | ^~~~~~~
+--- a/media/libaom/moz.build 2020-04-09 08:20:14.608439591 +0200
++++ b/media/libaom/moz.build 2020-04-09 08:20:21.801745246 +0200
+@@ -42,26 +42,6 @@
+ ASFLAGS += [ '-I%s/media/libaom/config/linux/ia32/' % TOPSRCDIR ]
+ LOCAL_INCLUDES += [ '/media/libaom/config/linux/ia32/' ]
+ EXPORTS.aom += [ 'config/linux/ia32/config/aom_config.h' ]
+-elif CONFIG['CPU_ARCH'] == 'arm':
+- EXPORTS.aom += files['ARM_EXPORTS']
+- ASFLAGS += [
+- '-I%s/media/libaom/config/linux/arm/' % TOPSRCDIR,
+- '-I%s/libaom' % OBJDIR,
+- ]
+- LOCAL_INCLUDES += [ '/media/libaom/config/linux/arm/' ]
+- EXPORTS.aom += [ 'config/linux/arm/config/aom_config.h' ]
+-
+- SOURCES += files['ARM_SOURCES']
+-
+- for f in SOURCES:
+- if f.endswith('neon.c'):
+- SOURCES[f].flags += CONFIG['VPX_ASFLAGS']
+-
+- if CONFIG['OS_TARGET'] == 'Android':
+- # For cpu-features.h
+- LOCAL_INCLUDES += [
+- '%%%s/sources/android/cpufeatures' % CONFIG['ANDROID_NDK'],
+- ]
+ else:
+ # Generic C-only configuration
+ EXPORTS.aom += files['GENERIC_EXPORTS']
+
+
diff --git a/skip/icecat/fix-fortify-system-wrappers.patch b/skip/icecat/fix-fortify-system-wrappers.patch
new file mode 100644
index 0000000..17cf7e3
--- /dev/null
+++ b/skip/icecat/fix-fortify-system-wrappers.patch
@@ -0,0 +1,13 @@
+The wrapper features.h gets pulled in by system headers causing thigns to
+break. We work around it by simply not wrap features.h
+
+--- ./config/system-headers.mozbuild.orig
++++ ./config/system-headers.mozbuild
+@@ -229,7 +229,6 @@
+ 'execinfo.h',
+ 'extras.h',
+ 'fcntl.h',
+- 'features.h',
+ 'fenv.h',
+ 'ffi.h',
+ 'fibdef.h',
diff --git a/skip/icecat/fix-rust-target.patch b/skip/icecat/fix-rust-target.patch
new file mode 100644
index 0000000..9342063
--- /dev/null
+++ b/skip/icecat/fix-rust-target.patch
@@ -0,0 +1,31 @@
+Allow us to just set RUST_TARGEt ourselves instead of hacking around in mozilla's
+weird custom build system...
+
+--- a/build/moz.configure/rust.configure
++++ b/build/moz.configure/rust.configure
+@@ -225,7 +225,9 @@
+ data.setdefault(key, []).append(namespace(rust_target=t, target=info))
+ return data
+
+-
++@imports('os')
++@imports(_from='mozbuild.util', _import='ensure_unicode')
++@imports(_from='mozbuild.util', _import='system_encoding')
+ def detect_rustc_target(
+ host_or_target, compiler_info, arm_target, rust_supported_targets
+ ):
+@@ -340,13 +342,13 @@
+
+ return None
+
+- rustc_target = find_candidate(candidates)
++ rustc_target = os.environ['RUST_TARGET']
+
+ if rustc_target is None:
+ die("Don't know how to translate {} for rustc".format(host_or_target.alias))
+
+- return rustc_target
++ return ensure_unicode(rustc_target, system_encoding)
+
+
+ @imports('os')
diff --git a/skip/icecat/fix-webrtc-glibcisms.patch b/skip/icecat/fix-webrtc-glibcisms.patch
new file mode 100644
index 0000000..4f9043b
--- /dev/null
+++ b/skip/icecat/fix-webrtc-glibcisms.patch
@@ -0,0 +1,20 @@
+--- a/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
++++ b/third_party/libwebrtc/system_wrappers/source/cpu_features_linux.cc
+@@ -18,7 +18,7 @@
+ #define WEBRTC_GLIBC_PREREQ(a, b) 0
+ #endif
+
+-#if WEBRTC_GLIBC_PREREQ(2, 16)
++#if !__GLIBC__ || WEBRTC_GLIBC_PREREQ(2, 16)
+ #include <sys/auxv.h>
+ #else
+ #include <errno.h>
+@@ -40,7 +40,7 @@
+ int architecture = 0;
+ uint64_t hwcap = 0;
+ const char* platform = NULL;
+-#if WEBRTC_GLIBC_PREREQ(2, 16)
++#if !__GLIBC__ || WEBRTC_GLIBC_PREREQ(2, 16)
+ hwcap = getauxval(AT_HWCAP);
+ platform = (const char*)getauxval(AT_PLATFORM);
+ #else
diff --git a/skip/icecat/icecat.desktop b/skip/icecat/icecat.desktop
new file mode 100644
index 0000000..950ad3a
--- /dev/null
+++ b/skip/icecat/icecat.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Exec=icecat %u
+Icon=icecat
+Type=Application
+Terminal=false
+Name=GNU IceCat
+Name[fi]=GNU IceCat
+GenericName=Web Browser
+GenericName[af]=Web Blaaier
+GenericName[ar]=متصفح ويب
+GenericName[az]=Veb Səyyahı
+GenericName[bg]=Браузър
+GenericName[bn]=ওয়েব ব্রাউজার
+GenericName[br]=Furcher ar Gwiad
+GenericName[bs]=WWW Preglednik
+GenericName[ca]=Fullejador web
+GenericName[cs]=WWW prohlížeč
+GenericName[cy]=Porydd Gwe
+GenericName[da]=Browser
+GenericName[de]=Web-Browser
+GenericName[el]=Περιηγητής Ιστού
+GenericName[eo]=TTT-legilo
+GenericName[es]=Navegador web
+GenericName[et]=Veebilehitseja
+GenericName[eu]=Web arakatzailea
+GenericName[fa]=مرورگر وب
+GenericName[fi]=WWW-selain
+GenericName[fo]=Alnótsfar
+GenericName[fr]=Navigateur web
+GenericName[gl]=Navegador Web
+GenericName[he]=דפדפן אינטרנט
+GenericName[hi]=वेब ब्राउज़र
+GenericName[hr]=Web preglednik
+GenericName[hu]=Webböngésző
+GenericName[is]=Vafri
+GenericName[it]=Browser Web
+GenericName[ja]=ウェブブラウザ
+GenericName[ko]=웹 브라우저
+GenericName[lo]=ເວັບບຣາວເຊີ
+GenericName[lt]=Žiniatinklio naršyklė
+GenericName[lv]=Web Pārlūks
+GenericName[mk]=Прелистувач на Интернет
+GenericName[mn]=Веб-Хөтөч
+GenericName[nb]=Nettleser
+GenericName[nds]=Nettkieker
+GenericName[nl]=Webbrowser
+GenericName[nn]=Nettlesar
+GenericName[nso]=Seinyakisi sa Web
+GenericName[pa]=ਵੈਬ ਝਲਕਾਰਾ
+GenericName[pl]=Przeglądarka WWW
+GenericName[pt]=Navegador Web
+GenericName[pt_BR]=Navegador Web
+GenericName[ro]=Navigator de web
+GenericName[ru]=Веб-браузер
+GenericName[se]=Fierpmádatlogan
+GenericName[sk]=Webový prehliadač
+GenericName[sl]=Spletni brskalnik
+GenericName[sr]=Веб претраживач
+GenericName[sr@Latn]=Veb pretraživač
+GenericName[ss]=Ibrawuza yeWeb
+GenericName[sv]=Webbläsare
+GenericName[ta]=வலை உலாவி
+GenericName[tg]=Тафсиргари вэб
+GenericName[th]=เว็บบราวเซอร์
+GenericName[tr]=Web Tarayıcı
+GenericName[uk]=Навігатор Тенет
+GenericName[uz]=Веб-браузер
+GenericName[ven]=Buronza ya Webu
+GenericName[vi]=Trình duyệt Web
+GenericName[wa]=Betchteu waibe
+GenericName[xh]=Umkhangeli zincwadi we Web
+GenericName[zh_CN]=网页浏览器
+GenericName[zh_TW]=網頁瀏覽器
+GenericName[zu]=Umcingi we-Web
+MimeType=text/html;
+StartupNotify=true
+Categories=Network;WebBrowser;
diff --git a/skip/icecat/icecat.xibuild b/skip/icecat/icecat.xibuild
new file mode 100644
index 0000000..61c8934
--- /dev/null
+++ b/skip/icecat/icecat.xibuild
@@ -0,0 +1,124 @@
+#!/bin/sh
+
+NAME="icecat"
+DESC="GNU IceCat web browser"
+
+MAKEDEPS="make rust cbindgen"
+DEPS="nodejs alsa-lib atk cairo dbus ffmpeg fontconfig freetype2 gdk-pixbuf glib gtk3 icu libevent libffi libpng libvpx libwebp libx11 libxcb libxcomposite libxdamage libxext libxfixes libxrandr musl nspr nss pango pixman zlib dbus-glib"
+
+PKG_VER=91.9.0
+commit_hash=d7d3e9a33d2b3b78a6e08060684580c72c0d6e93
+
+
+SOURCE="https://git.savannah.gnu.org/cgit/gnuzilla.git/snapshot/gnuzilla-$commit_hash.tar.gz"
+ADDITIONAL="
+icecat.desktop
+stab.h
+"
+
+#prepare () {
+
+ #sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/audio_thread_priority/.cargo-checksum.json
+ #sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/target-lexicon-0.9.0/.cargo-checksum.json
+#}
+
+build () {
+ mkdir -p objdir
+ cd objdir
+ export SHELL=/bin/sh
+ export USE_SHORT_LIBNAME=1
+ export MACH_USE_SYSTEM_PYTHON=1
+ export MOZBUILD_STATE_PATH=$BUILD_ROOT/mozbuild
+ # disable desktop notifications
+ export MOZ_NOSPAM=1
+ # Find our triplet JSON
+ export RUST_TARGET="x86_64-unknown-linux-musl"
+ # Build with Clang, takes less RAM
+ export CC="clang"
+ export CXX="clang++"
+
+ export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/icecat"
+ ../mach configure \
+ --without-wasm-sandboxed-libraries \
+ --prefix=/usr \
+ --disable-elf-hack \
+ --enable-rust-simd \
+ --enable-sandbox \
+ --disable-cargo-incremental \
+ --disable-crashreporter \
+ --disable-install-strip \
+ --disable-jemalloc \
+ --disable-minify \
+ --disable-profiling \
+ --disable-strip \
+ --disable-tests \
+ --disable-updater \
+ --enable-alsa \
+ --enable-dbus \
+ --enable-default-toolkit=cairo-gtk3-wayland \
+ --enable-dom-streams \
+ --enable-ffmpeg \
+ --enable-hardening \
+ --enable-necko-wifi \
+ --enable-official-branding \
+ --enable-optimize="$CFLAGS -O2" \
+ --enable-pulseaudio \
+ --enable-release \
+ --enable-system-ffi \
+ --enable-system-pixman \
+ --with-distribution-id=xilinux \
+ --with-libclang-path=/usr/lib \
+ --with-system-ffi \
+ --with-system-icu \
+ --with-system-jpeg \
+ --with-system-libevent \
+ --with-system-libvpx \
+ --with-system-nspr \
+ --with-system-nss \
+ --with-system-pixman \
+ --with-system-png \
+ --with-system-webp \
+ --with-system-zlib \
+ --with-unsigned-addon-scopes=app,system &&
+ ../mach build
+}
+
+package () {
+
+ DESTDIR="$PKG_DEST" MOZ_MAKE_FLAGS="$MAKEOPTS" ../mach install
+
+ install -m755 -d "$PKG_DEST"/usr/share/applications
+ install -m755 -d "$PKG_DEST"/usr/share/pixmaps
+
+ local _png
+ for _png in ../browser/branding/official/default*.png; do
+ local i=${_png%.png}
+ i=${i##*/default}
+ install -D -m644 "$_png" "$PKG_DEST"/usr/share/icons/hicolor/"$i"x"$i"/apps/icecat.png
+ done
+
+ install -m644 ../browser/branding/official/default48.png \
+ "$PKG_DEST"/usr/share/pixmaps/icecat.png
+ install -m644 ../icecat.desktop "$PKG_DEST"/usr/share/applications/org.mozilla.icecat.desktop
+
+ # Add StartupWMClass=icecat on the .desktop files so Desktop Environments
+ # correctly associate the window with their icon, the correct fix is to have
+ # icecat sets its own AppID but this will work for the meantime
+ # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1607399
+ echo "StartupWMClass=icecat" >> $PKG_DEST/usr/share/applications/org.mozilla.icecat.desktop
+
+ # install our vendor prefs
+ install -d $PKG_DEST/usr/lib/icecat/browser/defaults/preferences
+
+ cat >> $PKG_DEST/usr/lib/icecat/browser/defaults/preferences/icecat-branding.js <<- EOF
+ // Use LANG environment variable to choose locale
+ pref("intl.locale.requested", "");
+
+ // Disable default browser checking.
+ pref("browser.shell.checkDefaultBrowser", false);
+
+ // Don't disable our bundled extensions in the application directory
+ pref("extensions.autoDisableScopes", 11);
+ pref("extensions.shownSelectionUI", true);
+ EOF
+}
diff --git a/skip/icecat/mallinfo.patch b/skip/icecat/mallinfo.patch
new file mode 100644
index 0000000..7916a20
--- /dev/null
+++ b/skip/icecat/mallinfo.patch
@@ -0,0 +1,20 @@
+diff --git a/xpcom/base/nsMemoryReporterManager.cpp b/xpcom/base/nsMemoryReporterManager.cpp
+index 865e1b5430..9a00dafecb 100644
+--- a/xpcom/base/nsMemoryReporterManager.cpp
++++ b/xpcom/base/nsMemoryReporterManager.cpp
+@@ -124,6 +124,7 @@ static MOZ_MUST_USE nsresult ResidentUniqueDistinguishedAmount(int64_t* aN) {
+ return GetProcSelfSmapsPrivate(aN);
+ }
+
++#ifdef __GLIBC__
+ # ifdef HAVE_MALLINFO
+ # define HAVE_SYSTEM_HEAP_REPORTER 1
+ static MOZ_MUST_USE nsresult SystemHeapSize(int64_t* aSizeOut) {
+@@ -143,6 +144,7 @@ static MOZ_MUST_USE nsresult SystemHeapSize(int64_t* aSizeOut) {
+ return NS_OK;
+ }
+ # endif
++#endif
+
+ #elif defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
+ defined(__OpenBSD__) || defined(__FreeBSD_kernel__)
diff --git a/skip/icecat/sandbox-fork.patch b/skip/icecat/sandbox-fork.patch
new file mode 100644
index 0000000..c7222ab
--- /dev/null
+++ b/skip/icecat/sandbox-fork.patch
@@ -0,0 +1,15 @@
+make SYS_fork non-fatal, musl uses it for fork(2)
+
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1253,6 +1253,10 @@
+ // usually do something reasonable on error.
+ case __NR_clone:
+ return ClonePolicy(Error(EPERM));
++#ifdef __NR_fork
++ case __NR_fork:
++ return Error(ENOSYS);
++#endif
+
+ # ifdef __NR_fadvise64
+ case __NR_fadvise64:
diff --git a/skip/icecat/sandbox-largefile.patch b/skip/icecat/sandbox-largefile.patch
new file mode 100644
index 0000000..f1cf28b
--- /dev/null
+++ b/skip/icecat/sandbox-largefile.patch
@@ -0,0 +1,17 @@
+--- a/security/sandbox/linux/SandboxFilter.cpp 2020-11-23 22:41:14.556378950 +0100
++++ b/security/sandbox/linux/SandboxFilter.cpp 2020-11-23 22:40:23.595806444 +0100
+@@ -68,7 +68,13 @@
+
+ // The headers define O_LARGEFILE as 0 on x86_64, but we need the
+ // actual value because it shows up in file flags.
+-#define O_LARGEFILE_REAL 00100000
++#if defined(__x86_64__) || defined(__i386__) || defined(__mips__)
++#define O_LARGEFILE_REAL 0100000
++#elif defined(__powerpc__)
++#define O_LARGEFILE_REAL 0200000
++#else
++#define O_LARGEFILE_REAL O_LARGEFILE
++#endif
+
+ // Not part of UAPI, but userspace sees it in F_GETFL; see bug 1650751.
+ #define FMODE_NONOTIFY 0x4000000
diff --git a/skip/icecat/sandbox-sched_setscheduler.patch b/skip/icecat/sandbox-sched_setscheduler.patch
new file mode 100644
index 0000000..3163c9e
--- /dev/null
+++ b/skip/icecat/sandbox-sched_setscheduler.patch
@@ -0,0 +1,16 @@
+upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1657849
+--- a/security/sandbox/linux/SandboxFilter.cpp
++++ b/security/sandbox/linux/SandboxFilter.cpp
+@@ -1694,10 +1694,10 @@
+ return Allow();
+ case __NR_sched_get_priority_min:
+ case __NR_sched_get_priority_max:
++ case __NR_sched_setscheduler:
+ return Allow();
+ case __NR_sched_getparam:
+- case __NR_sched_getscheduler:
+- case __NR_sched_setscheduler: {
++ case __NR_sched_getscheduler: {
+ Arg<pid_t> pid(0);
+ return If(pid == 0, Allow()).Else(Trap(SchedTrap, nullptr));
+ }
diff --git a/skip/icecat/stab.h b/skip/icecat/stab.h
new file mode 100644
index 0000000..6f70af3
--- /dev/null
+++ b/skip/icecat/stab.h
@@ -0,0 +1,71 @@
+/* $OpenBSD: stab.h,v 1.3 2003/06/02 19:34:12 millert Exp $ */
+/* $NetBSD: stab.h,v 1.4 1994/10/26 00:56:25 cgd Exp $ */
+
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)stab.h 5.2 (Berkeley) 4/4/91
+ */
+
+#ifndef _STAB_H_
+#define _STAB_H_
+
+/*
+ * The following are symbols used by various debuggers and by the Pascal
+ * compiler. Each of them must have one (or more) of the bits defined by
+ * the N_STAB mask set.
+ */
+
+#define N_GSYM 0x20 /* global symbol */
+#define N_FNAME 0x22 /* F77 function name */
+#define N_FUN 0x24 /* procedure name */
+#define N_STSYM 0x26 /* data segment variable */
+#define N_LCSYM 0x28 /* bss segment variable */
+#define N_MAIN 0x2a /* main function name */
+#define N_PC 0x30 /* global Pascal symbol */
+#define N_RSYM 0x40 /* register variable */
+#define N_SLINE 0x44 /* text segment line number */
+#define N_DSLINE 0x46 /* data segment line number */
+#define N_BSLINE 0x48 /* bss segment line number */
+#define N_SSYM 0x60 /* structure/union element */
+#define N_SO 0x64 /* main source file name */
+#define N_LSYM 0x80 /* stack variable */
+#define N_BINCL 0x82 /* include file beginning */
+#define N_SOL 0x84 /* included source file name */
+#define N_PSYM 0xa0 /* parameter variable */
+#define N_EINCL 0xa2 /* include file end */
+#define N_ENTRY 0xa4 /* alternate entry point */
+#define N_LBRAC 0xc0 /* left bracket */
+#define N_EXCL 0xc2 /* deleted include file */
+#define N_RBRAC 0xe0 /* right bracket */
+#define N_BCOMM 0xe2 /* begin common */
+#define N_ECOMM 0xe4 /* end common */
+#define N_ECOML 0xe8 /* end common (local name) */
+#define N_LENG 0xfe /* length of preceding entry */
+
+#endif /* !_STAB_H_ */
diff --git a/skip/pandoc/cabal.project.freeze b/skip/pandoc/cabal.project.freeze
new file mode 100644
index 0000000..c532ee0
--- /dev/null
+++ b/skip/pandoc/cabal.project.freeze
@@ -0,0 +1,249 @@
+active-repositories: hackage.haskell.org:merge
+constraints: any.Cabal ==3.4.0.0,
+ any.Diff ==0.4.0,
+ any.Glob ==0.10.2,
+ any.HsYAML ==0.2.1.0,
+ HsYAML -exe,
+ any.JuicyPixels ==3.3.6,
+ JuicyPixels -mmap,
+ any.OneTuple ==0.3.1,
+ any.QuickCheck ==2.14.2,
+ QuickCheck -old-random +templatehaskell,
+ any.SHA ==1.6.4.4,
+ SHA -exe,
+ any.StateVar ==1.2.2,
+ any.aeson ==2.0.2.0,
+ aeson -bytestring-builder -cffi +ordered-keymap,
+ any.aeson-pretty ==0.8.9,
+ aeson-pretty -lib-only,
+ any.ansi-terminal ==0.11.1,
+ ansi-terminal -example,
+ any.ansi-wl-pprint ==0.6.9,
+ ansi-wl-pprint -example,
+ any.appar ==0.1.8,
+ any.array ==0.5.4.0,
+ any.asn1-encoding ==0.9.6,
+ any.asn1-parse ==0.9.5,
+ any.asn1-types ==0.3.4,
+ any.assoc ==1.0.2,
+ any.async ==2.2.4,
+ async -bench,
+ any.attoparsec ==0.14.3,
+ attoparsec -developer,
+ any.base ==4.15.0.0,
+ any.base-compat ==0.12.1,
+ any.base-compat-batteries ==0.12.1,
+ any.base-orphans ==0.8.6,
+ any.base16-bytestring ==1.0.2.0,
+ any.base64-bytestring ==1.2.1.0,
+ any.basement ==0.0.12,
+ any.bifunctors ==5.5.11,
+ bifunctors +semigroups +tagged,
+ any.binary ==0.8.8.0,
+ any.blaze-builder ==0.4.2.2,
+ any.blaze-html ==0.9.1.2,
+ any.blaze-markup ==0.8.2.8,
+ any.byteorder ==1.0.4,
+ any.bytestring ==0.10.12.1,
+ any.cabal-doctest ==1.0.9,
+ any.call-stack ==0.4.0,
+ any.case-insensitive ==1.2.1.0,
+ any.cereal ==0.5.8.2,
+ cereal -bytestring-builder,
+ any.citeproc ==0.6,
+ citeproc -executable -icu,
+ any.clock ==0.8.2,
+ clock -llvm,
+ any.cmdargs ==0.10.21,
+ cmdargs +quotation -testprog,
+ any.colour ==2.3.6,
+ any.commonmark ==0.2.1.1,
+ any.commonmark-extensions ==0.2.2.1,
+ any.commonmark-pandoc ==0.2.1.1,
+ any.comonad ==5.0.8,
+ comonad +containers +distributive +indexed-traversable,
+ any.conduit ==1.3.4.2,
+ any.conduit-extra ==1.3.5,
+ any.connection ==0.3.1,
+ any.containers ==0.6.4.1,
+ any.contravariant ==1.5.5,
+ contravariant +semigroups +statevar +tagged,
+ any.cookie ==0.4.5,
+ any.cryptonite ==0.29,
+ cryptonite -check_alignment +integer-gmp -old_toolchain_inliner +support_aesni +support_deepseq -support_pclmuldq +support_rdrand -support_sse +use_target_attributes,
+ any.data-default ==0.7.1.1,
+ any.data-default-class ==0.1.2.0,
+ any.data-default-instances-containers ==0.0.1,
+ any.data-default-instances-dlist ==0.0.1,
+ any.data-default-instances-old-locale ==0.0.1,
+ any.data-fix ==0.3.2,
+ any.deepseq ==1.4.5.0,
+ any.digest ==0.0.1.3,
+ digest -bytestring-in-base,
+ any.directory ==1.3.6.1,
+ any.distributive ==0.6.2.1,
+ distributive +semigroups +tagged,
+ any.dlist ==1.0,
+ dlist -werror,
+ any.doclayout ==0.3.1.1,
+ any.doctemplates ==0.10.0.1,
+ any.emojis ==0.1.2,
+ any.errors ==2.3.0,
+ any.exceptions ==0.10.4,
+ any.file-embed ==0.0.15.0,
+ any.filepath ==1.4.2.1,
+ any.ghc-bignum ==1.0,
+ any.ghc-bignum-orphans ==0.1.1,
+ any.ghc-boot-th ==9.0.1,
+ any.ghc-prim ==0.7.0,
+ any.haddock-library ==1.10.0,
+ any.happy ==1.20.0,
+ any.hashable ==1.4.0.1,
+ hashable +containers +integer-gmp -random-initial-seed,
+ any.haskell-lexer ==1.1,
+ any.hourglass ==0.2.12,
+ any.hsc2hs ==0.68.8,
+ hsc2hs -in-ghc-tree,
+ any.hslua ==2.0.1,
+ any.hslua-classes ==2.0.0,
+ any.hslua-core ==2.0.0.2,
+ any.hslua-marshalling ==2.0.1,
+ any.hslua-module-path ==1.0.0,
+ any.hslua-module-system ==1.0.0,
+ any.hslua-module-text ==1.0.0,
+ any.hslua-module-version ==1.0.0,
+ any.hslua-objectorientation ==2.0.1,
+ any.hslua-packaging ==2.0.0,
+ any.http-client ==0.7.9,
+ http-client +network-uri,
+ any.http-client-tls ==0.3.5.3,
+ any.http-types ==0.12.3,
+ any.indexed-traversable ==0.1.2,
+ any.indexed-traversable-instances ==0.1.1,
+ any.integer-gmp ==1.1,
+ any.integer-logarithms ==1.0.3.1,
+ integer-logarithms -check-bounds +integer-gmp,
+ any.iproute ==1.7.12,
+ any.ipynb ==0.1.0.2,
+ any.jira-wiki-markup ==1.4.0,
+ any.libyaml ==0.1.2,
+ libyaml -no-unicode -system-libyaml,
+ any.lpeg ==1.0.1,
+ lpeg -rely-on-shared-lpeg-library,
+ any.lua ==2.0.2,
+ lua +allow-unsafe-gc -apicheck +export-dynamic +hardcode-reg-keys -lua_32bits -pkg-config -system-lua,
+ any.memory ==0.16.0,
+ memory +support_basement +support_bytestring +support_deepseq +support_foundation,
+ any.mime-types ==0.1.0.9,
+ any.mono-traversable ==1.0.15.3,
+ any.mtl ==2.2.2,
+ any.network ==3.1.2.5,
+ network -devel,
+ any.network-uri ==2.6.4.1,
+ any.old-locale ==1.0.0.7,
+ any.optparse-applicative ==0.16.1.0,
+ optparse-applicative +process,
+ pandoc +embed_data_files -trypandoc,
+ any.pandoc-types ==1.22.1,
+ any.parsec ==3.1.14.0,
+ any.pem ==0.2.4,
+ any.pretty ==1.1.3.6,
+ any.pretty-show ==1.10,
+ any.primitive ==0.7.3.0,
+ any.process ==1.6.11.0,
+ any.random ==1.2.1,
+ any.resourcet ==1.2.4.3,
+ any.rts ==1.0,
+ any.safe ==0.3.19,
+ any.scientific ==0.3.7.0,
+ scientific -bytestring-builder -integer-simple,
+ any.semialign ==1.2.0.1,
+ semialign +semigroupoids,
+ any.semigroupoids ==5.3.6,
+ semigroupoids +comonad +containers +contravariant +distributive +tagged +unordered-containers,
+ any.skylighting ==0.12.1,
+ skylighting -executable,
+ any.skylighting-core ==0.12.1,
+ skylighting-core -executable,
+ any.socks ==0.6.1,
+ any.split ==0.2.3.4,
+ any.splitmix ==0.1.0.4,
+ splitmix -optimised-mixer,
+ any.stm ==2.5.0.0,
+ any.streaming-commons ==0.2.2.3,
+ streaming-commons -use-bytestring-builder,
+ any.strict ==0.4.0.1,
+ strict +assoc,
+ any.syb ==0.7.2.1,
+ any.tagged ==0.8.6.1,
+ tagged +deepseq +transformers,
+ any.tagsoup ==0.14.8,
+ any.tasty ==1.4.2.1,
+ tasty +clock +unix,
+ any.tasty-bench ==0.3.1,
+ tasty-bench -debug +tasty,
+ any.tasty-golden ==2.3.4,
+ tasty-golden -build-example,
+ any.tasty-hunit ==0.10.0.3,
+ any.tasty-lua ==1.0.0,
+ any.tasty-quickcheck ==0.10.2,
+ any.template-haskell ==2.17.0.0,
+ any.temporary ==1.3,
+ any.texmath ==0.12.3.2,
+ texmath -executable +network-uri,
+ any.text ==1.2.4.1,
+ any.text-conversions ==0.3.1,
+ any.text-short ==0.1.4,
+ text-short -asserts,
+ any.th-abstraction ==0.4.3.0,
+ any.th-compat ==0.1.3,
+ any.th-lift ==0.8.2,
+ any.th-lift-instances ==0.1.18,
+ any.these ==1.1.1.1,
+ these +assoc,
+ any.time ==1.9.3,
+ any.time-compat ==1.9.6.1,
+ time-compat -old-locale,
+ any.tls ==1.5.5,
+ tls +compat -hans +network,
+ any.transformers ==0.5.6.2,
+ any.transformers-compat ==0.7.1,
+ transformers-compat -five +five-three -four +generic-deriving +mtl -three -two,
+ any.typed-process ==0.2.8.0,
+ any.unbounded-delays ==0.1.1.1,
+ any.unicode-collation ==0.1.3.1,
+ unicode-collation -doctests -executable,
+ any.unicode-data ==0.1.0.1,
+ unicode-data -ucd2haskell,
+ any.unicode-transforms ==0.3.8,
+ unicode-transforms -bench-show -dev -has-icu -has-llvm -use-gauge,
+ any.uniplate ==1.6.13,
+ any.unix ==2.7.2.2,
+ any.unix-compat ==0.5.3,
+ unix-compat -old-time,
+ any.unliftio-core ==0.2.0.1,
+ any.unordered-containers ==0.2.16.0,
+ unordered-containers -debug,
+ any.utf8-string ==1.0.2,
+ any.uuid-types ==1.0.5,
+ any.vector ==0.12.3.1,
+ vector +boundschecks -internalchecks -unsafechecks -wall,
+ any.vector-algorithms ==0.8.0.4,
+ vector-algorithms +bench +boundschecks -internalchecks -llvm +properties -unsafechecks,
+ any.wcwidth ==0.0.2,
+ wcwidth -cli +split-base,
+ any.witherable ==0.4.2,
+ any.x509 ==1.7.5,
+ any.x509-store ==1.6.7,
+ any.x509-system ==1.6.6,
+ any.x509-validation ==1.6.11,
+ any.xml ==1.3.14,
+ any.xml-conduit ==1.9.1.1,
+ any.xml-types ==0.3.8,
+ any.yaml ==0.11.7.0,
+ yaml +no-examples +no-exe,
+ any.zip-archive ==0.4.1,
+ zip-archive -executable,
+ any.zlib ==0.6.2.3,
+ zlib -bundled-c-zlib -non-blocking-ffi -pkg-config
+index-state: hackage.haskell.org 2021-12-11T21:58:01Z
diff --git a/skip/pandoc/pandoc.xibuild b/skip/pandoc/pandoc.xibuild
new file mode 100644
index 0000000..fd6988c
--- /dev/null
+++ b/skip/pandoc/pandoc.xibuild
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+NAME="pandoc"
+DESC="universal markup converter"
+
+MAKEDEPS="cabal"
+DEPS="gmp libffi musl zlib "
+
+PKG_VER=2.16.2
+SOURCE="https://hackage.haskell.org/package/pandoc-$PKG_VER/pandoc-$PKG_VER.tar.gz"
+ADDITIONAL="cabal.project.freeze "
+
+prepare () {
+ cp "$srcdir/cabal.project.freeze" .
+ cabal update
+ cabal configure \
+ --prefix='/usr' \
+ --enable-tests \
+ --enable-split-sections \
+ --ghc-option="-split-sections" \
+ --ghc-option="-j" \
+ --ghc-option="-O1" \
+ --flags="+embed_data_files -trypandoc +static"
+}
+
+build () {
+ cabal install --only-dependencies
+ cabal build --jobs=${JOBS:-1}
+}
+
+package () {
+ bindir="$PKG_DEST/usr/bin"
+ mkdir -p "$bindir"
+ cabal install \
+ --installdir="$bindir" \
+ --install-method=copy
+ install -Dm644 man/pandoc.1 "$PKG_DEST"/usr/share/man/man1/pandoc.1
+}
diff --git a/skip/qt5-qtbase/qt-musl-iconv-no-bom.patch b/skip/qt5-qtbase/qt-musl-iconv-no-bom.patch
new file mode 100644
index 0000000..8bf35ec
--- /dev/null
+++ b/skip/qt5-qtbase/qt-musl-iconv-no-bom.patch
@@ -0,0 +1,11 @@
+--- qtbase/src/corelib/codecs/qiconvcodec.cpp 2017-01-18 15:20:58.000000000 +0100
++++ qtbase/src/corelib/codecs/qiconvcodec.cpp 2017-02-21 14:33:32.423808603 +0100
+@@ -64,7 +64,7 @@
+ #elif defined(Q_OS_AIX)
+ # define NO_BOM
+ # define UTF16 "UCS-2"
+-#elif defined(Q_OS_FREEBSD)
++#elif defined(Q_OS_FREEBSD) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
+ # define NO_BOM
+ # if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ # define UTF16 "UTF-16BE"
diff --git a/skip/qt5-qtbase/qt5-base-cflags.patch b/skip/qt5-qtbase/qt5-base-cflags.patch
new file mode 100644
index 0000000..c33aa78
--- /dev/null
+++ b/skip/qt5-qtbase/qt5-base-cflags.patch
@@ -0,0 +1,46 @@
+diff --git a/mkspecs/common/g++-unix.conf b/mkspecs/common/g++-unix.conf
+index a493cd5984..41342f5020 100644
+--- a/mkspecs/common/g++-unix.conf
++++ b/mkspecs/common/g++-unix.conf
+@@ -10,5 +10,6 @@
+
+ include(g++-base.conf)
+
+-QMAKE_LFLAGS_RELEASE += -Wl,-O1
++SYSTEM_LDFLAGS = $$(LDFLAGS)
++!isEmpty(SYSTEM_LDFLAGS) { eval(QMAKE_LFLAGS_RELEASE += $$(LDFLAGS)) } else { QMAKE_LFLAGS_RELEASE += -Wl,-O1 }
+ QMAKE_LFLAGS_NOUNDEF += -Wl,--no-undefined
+diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
+index 1f919d270a..7ef6046326 100644
+--- a/mkspecs/common/gcc-base.conf
++++ b/mkspecs/common/gcc-base.conf
+@@ -40,9 +40,11 @@ QMAKE_CFLAGS_OPTIMIZE_SIZE = -Os
+ QMAKE_CFLAGS_DEPS += -M
+ QMAKE_CFLAGS_WARN_ON += -Wall -Wextra
+ QMAKE_CFLAGS_WARN_OFF += -w
+-QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
+-QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
+-QMAKE_CFLAGS_DEBUG += -g
++SYSTEM_CFLAGS = $$(CFLAGS)
++SYSTEM_DEBUG_CFLAGS = $$(DEBUG_CFLAGS)
++!isEmpty(SYSTEM_CFLAGS) { eval(QMAKE_CFLAGS_RELEASE += $$(CPPFLAGS) $$(CFLAGS)) } else { QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE }
++!isEmpty(SYSTEM_CFLAGS) { eval(QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$(CPPFLAGS) -g $$(CFLAGS)) } else { QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g }
++!isEmpty(SYSTEM_DEBUG_CFLAGS) { eval(QMAKE_CFLAGS_DEBUG += $$(DEBUG_CFLAGS)) } else { QMAKE_CFLAGS_DEBUG += -g }
+ QMAKE_CFLAGS_SHLIB += $$QMAKE_CFLAGS_PIC
+ QMAKE_CFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_PIC
+ QMAKE_CFLAGS_APP += $$QMAKE_CFLAGS_PIC
+@@ -59,9 +61,11 @@ QMAKE_CXXFLAGS += $$QMAKE_CFLAGS
+ QMAKE_CXXFLAGS_DEPS += $$QMAKE_CFLAGS_DEPS
+ QMAKE_CXXFLAGS_WARN_ON += $$QMAKE_CFLAGS_WARN_ON
+ QMAKE_CXXFLAGS_WARN_OFF += $$QMAKE_CFLAGS_WARN_OFF
+-QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_RELEASE
+-QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
+-QMAKE_CXXFLAGS_DEBUG += $$QMAKE_CFLAGS_DEBUG
++SYSTEM_CXXFLAGS = $$(CXXFLAGS)
++SYSTEM_DEBUG_CXXFLAGS = $$(DEBUG_CXXFLAGS)
++!isEmpty(SYSTEM_CXXFLAGS) { eval(QMAKE_CXXFLAGS_RELEASE += $$(CPPFLAGS) $$(CXXFLAGS)) } else { QMAKE_CXXFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE }
++!isEmpty(SYSTEM_CXXFLAGS) { eval(QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$(CPPFLAGS) -g $$(CXXFLAGS)) } else { QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g }
++!isEmpty(SYSTEM_DEBUG_CXXFLAGS) { eval(QMAKE_CXXFLAGS_DEBUG += $$(DEBUG_CXXFLAGS)) } else { QMAKE_CXXFLAGS_DEBUG += -g }
+ QMAKE_CXXFLAGS_SHLIB += $$QMAKE_CFLAGS_SHLIB
+ QMAKE_CXXFLAGS_STATIC_LIB += $$QMAKE_CFLAGS_STATIC_LIB
+ QMAKE_CXXFLAGS_APP += $$QMAKE_CFLAGS_APP
diff --git a/skip/qt5-qtbase/qt5-base-nostrip.patch b/skip/qt5-qtbase/qt5-base-nostrip.patch
new file mode 100644
index 0000000..17d24b4
--- /dev/null
+++ b/skip/qt5-qtbase/qt5-base-nostrip.patch
@@ -0,0 +1,13 @@
+diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
+index 99d77156fd..fc840fe9f6 100644
+--- a/mkspecs/common/gcc-base.conf
++++ b/mkspecs/common/gcc-base.conf
+@@ -31,6 +31,8 @@
+ # you can use the manual test in tests/manual/mkspecs.
+ #
+
++CONFIG += nostrip
++
+ QMAKE_CFLAGS_OPTIMIZE = -O2
+ QMAKE_CFLAGS_OPTIMIZE_FULL = -O3
+ QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Og
diff --git a/skip/qt5-qtbase/qt5-qtbase.xibuild b/skip/qt5-qtbase/qt5-qtbase.xibuild
new file mode 100644
index 0000000..d9e4791
--- /dev/null
+++ b/skip/qt5-qtbase/qt5-qtbase.xibuild
@@ -0,0 +1,78 @@
+#!/bin/sh
+
+NAME="qt5-qtbase"
+DESC="Qt5 - QtBase components"
+
+MAKEDEPS="make libexecinfo"
+DEPS="dbus glib icu openssl pcre2 xdg-utils zlib zstd musl "
+
+PKG_VER=5.15.4
+commit="e0a15c11b853954d4189b2e30aa2450184de0987"
+SOURCE="https://invent.kde.org/qt/qt/qtbase/-/archive/$commit/qtbase-$commit.tar.gz"
+ADDITIONAL="
+compile-with-libexecinfo-enabled.patch
+qt-musl-iconv-no-bom.patch
+qt5-base-cflags.patch
+qt5-base-nostrip.patch
+qt5-qtbase.xibuild
+"
+
+qt5_prefix=/usr/lib/qt5
+qt5_datadir=/usr/share/qt5
+
+prepare () {
+ apply_patches
+ sed -i -e "s|-O2|$CXXFLAGS|" \
+ -e "/^QMAKE_RPATH/s| -Wl,-rpath,||g" \
+ -e "/^QMAKE_LFLAGS\s/s|+=|+= $LDFLAGS|g" \
+ mkspecs/common/*.conf
+
+ mkdir .git
+}
+
+build () {
+ ./configure -confirm-license -opensource \
+ -archdatadir "$qt5_prefix" \
+ -bindir "$qt5_prefix"/bin \
+ -datadir "$qt5_datadir" \
+ -dbus-linked \
+ -docdir /usr/share/doc/qt5 \
+ -examplesdir /usr/share/doc/qt5/examples \
+ -glib \
+ -headerdir /usr/include/qt5 \
+ -icu \
+ -importdir "$qt5_prefix"/imports \
+ -libexecdir "$qt5_prefix"/libexec \
+ -no-rpath \
+ -no-separate-debug-info \
+ -no-pch \
+ -nomake examples \
+ -opengl \
+ -openssl-linked \
+ -optimized-qmake \
+ -plugin-sql-sqlite \
+ -plugindir "$qt5_prefix"/plugins \
+ -prefix /usr \
+ -sysconfdir /etc/xdg \
+ -system-libjpeg \
+ -system-libpng \
+ -system-sqlite \
+ -system-zlib \
+ -translationdir "$qt5_datadir"/translations \
+ -no-reduce-relocations
+ export LDFLAGS="-lexecinfo"
+ make
+}
+
+package () {
+ make INSTALL_ROOT=$PKG_DEST install
+ install -d $PKG_DEST/usr/bin
+ for i in "$PKG_DEST"/"$qt5_prefix"/bin/*; do
+ name=${i##*/}
+ case $_name in
+ *.*) dest="$PKG_DEST"/usr/bin/${name%.*}-qt5.${name##*.};;
+ *) dest="$PKG_DEST"/usr/bin/${name%.*}-qt5;;
+ esac
+ ln -s ../lib/qt5/bin/"$name" "$dest"
+ done
+}