ghc@9.2 9.2.5
parent
ba797cbe3e
commit
1a792f3734
|
@ -1,8 +1,8 @@
|
|||
class GhcAT92 < Formula
|
||||
desc "Glorious Glasgow Haskell Compilation System"
|
||||
homepage "https://haskell.org/ghc/"
|
||||
url "https://downloads.haskell.org/~ghc/9.2.4/ghc-9.2.4-src.tar.xz"
|
||||
sha256 "15213888064a0ec4e7723d075f31b87a678ce0851773d58b44ef7aa3de996458"
|
||||
url "https://downloads.haskell.org/~ghc/9.2.5/ghc-9.2.5-src.tar.xz"
|
||||
sha256 "0606797d1b38e2d88ee2243f38ec6b9a1aa93e9b578e95f0de9a9c0a4144021c"
|
||||
# We build bundled copies of libffi and GMP so GHC inherits the licenses
|
||||
license all_of: [
|
||||
"BSD-3-Clause",
|
||||
|
@ -36,10 +36,13 @@ class GhcAT92 < Formula
|
|||
|
||||
on_linux do
|
||||
depends_on "gmp" => :build
|
||||
on_arm do
|
||||
depends_on "numactl" => :build
|
||||
end
|
||||
end
|
||||
|
||||
# GHC 9.2.4 user manual recommend use LLVM 9 through 12
|
||||
# https://downloads.haskell.org/~ghc/9.2.4/docs/html/users_guide/9.2.4-notes.html
|
||||
# GHC 9.2.5 user manual recommend use LLVM 9 through 12
|
||||
# https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/9.2.5-notes.html
|
||||
# and we met some unknown issue w/ LLVM 13 before https://gitlab.haskell.org/ghc/ghc/-/issues/20559
|
||||
# so conservatively use LLVM 12 here
|
||||
on_arm do
|
||||
|
@ -59,19 +62,32 @@ class GhcAT92 < Formula
|
|||
end
|
||||
end
|
||||
on_linux do
|
||||
url "https://downloads.haskell.org/~ghc/9.0.2/ghc-9.0.2-x86_64-ubuntu20.04-linux.tar.xz"
|
||||
sha256 "a0ff9893618d597534682123360e7c80f97441f0e49f261828416110e8348ea0"
|
||||
on_arm do
|
||||
url "https://downloads.haskell.org/~ghc/9.0.2/ghc-9.0.2-aarch64-deb10-linux.tar.xz"
|
||||
sha256 "cb016344c70a872738a24af60bd15d3b18749087b9905c1b3f1b1549dc01f46d"
|
||||
end
|
||||
on_intel do
|
||||
url "https://downloads.haskell.org/~ghc/9.0.2/ghc-9.0.2-x86_64-ubuntu20.04-linux.tar.xz"
|
||||
sha256 "a0ff9893618d597534682123360e7c80f97441f0e49f261828416110e8348ea0"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Backport fix for segfaults on macOS Ventura ARM
|
||||
# Ref: https://gitlab.haskell.org/ghc/ghc/-/commit/74ca6191fa0dbbe8cee3dc53741b8d59fbf16b09
|
||||
patch :DATA
|
||||
# Fix build with sphinx-doc 6+ using open upstream MR.
|
||||
# TODO: Update commit when upstream MR is merged.
|
||||
# TODO: Remove patch if fix is backported to 9.2.
|
||||
# Ref: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9625
|
||||
patch do
|
||||
url "https://gitlab.haskell.org/ghc/ghc/-/commit/10e94a556b4f90769b7fd718b9790d58ae566600.diff"
|
||||
sha256 "354baeb8727fbbfb6da2e88f9748acaab23bcccb5806f8f59787997753231dbb"
|
||||
end
|
||||
|
||||
def install
|
||||
ENV["CC"] = ENV.cc
|
||||
ENV["LD"] = "ld"
|
||||
ENV["PYTHON"] = which("python3.11")
|
||||
# ARM64 Linux bootstrap binary is linked to libnuma so help it find our copy
|
||||
ENV.append_path "LD_LIBRARY_PATH", Formula["numactl"].opt_lib if OS.linux? && Hardware::CPU.arm?
|
||||
# Work around build failure: fatal error: 'ffitarget_arm64.h' file not found
|
||||
# Issue ref: https://gitlab.haskell.org/ghc/ghc/-/issues/20592
|
||||
# TODO: remove once bootstrap ghc is 9.2.3 or later.
|
||||
|
@ -112,24 +128,3 @@ class GhcAT92 < Formula
|
|||
assert_match "Hello Homebrew", shell_output("#{bin}/runghc hello.hs")
|
||||
end
|
||||
end
|
||||
|
||||
__END__
|
||||
diff --git a/includes/CodeGen.Platform.hs b/includes/CodeGen.Platform.hs
|
||||
index 0dfac62a3f125d87fc68d990decfb83c0c511b62..ebec0212bd0f48071ae51673fdeb7b86c156936d 100644
|
||||
--- a/includes/CodeGen.Platform.hs
|
||||
+++ b/includes/CodeGen.Platform.hs
|
||||
@@ -1028,6 +1028,14 @@ freeReg 29 = False
|
||||
-- ip0 -- used for spill offset computations
|
||||
freeReg 16 = False
|
||||
|
||||
+#if defined(darwin_HOST_OS) || defined(ios_HOST_OS)
|
||||
+-- x18 is reserved by the platform on Darwin/iOS, and can not be used
|
||||
+-- More about ARM64 ABI that Apple platforms support:
|
||||
+-- https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
|
||||
+-- https://github.com/Siguza/ios-resources/blob/master/bits/arm64.md
|
||||
+freeReg 18 = False
|
||||
+#endif
|
||||
+
|
||||
# if defined(REG_Base)
|
||||
freeReg REG_Base = False
|
||||
# endif
|
||||
|
|
Loading…
Reference in New Issue