summaryrefslogtreecommitdiff
path: root/skip
diff options
context:
space:
mode:
Diffstat (limited to 'skip')
-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
36 files changed, 3035 insertions, 0 deletions
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
+}