summaryrefslogtreecommitdiff
path: root/skip/ghc
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-05-31 11:04:17 +0100
committerdavidovski <david@davidovski.xyz>2022-05-31 11:04:17 +0100
commit871b2b573f01c1b3176a0f65458b3d281b41c437 (patch)
tree1311c682a9307026b039de9ba0e93bd22e35e2f5 /skip/ghc
parentdfcdf333c80ae1d7171f6fa145fd87fecb8c5b73 (diff)
added pandoc and qt5
Diffstat (limited to 'skip/ghc')
-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
11 files changed, 1381 insertions, 0 deletions
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