commit b071b3dba7aa28c1fae18bd49b538134ba676646
Author: Jan Palus <[email protected]>
Date:   Thu Mar 17 13:15:31 2022 +0100

    fix llvm backend and add deps for it

 ghc-pld.patch | 14 ++++++++++++++
 ghc.spec      | 23 ++++++++++++++++++++++-
 2 files changed, 36 insertions(+), 1 deletion(-)
---
diff --git a/ghc.spec b/ghc.spec
index 051ce01..e951cde 100644
--- a/ghc.spec
+++ b/ghc.spec
@@ -48,6 +48,11 @@
 
 %define                bootversion             8.6.5
 
+# native code generator (-fasm) support
+%ifarch %{ix86} %{x8664} ppc ppc64 ppc64le sparc
+%define                with_ncg        1
+%endif
+
 Summary:       Glasgow Haskell Compilation system
 Summary(pl.UTF-8):     System kompilacji Glasgow Haskell
 Name:          ghc
@@ -75,6 +80,7 @@ BuildRequires:        OpenAL-devel
 BuildRequires: OpenGL-GLU-devel
 BuildRequires: OpenGL-devel
 BuildRequires: OpenGL-glut-devel
+BuildRequires: bash
 BuildRequires: binutils >= 4:2.30
 BuildRequires: freealut-devel
 BuildRequires: gmp-devel
@@ -90,6 +96,9 @@ BuildRequires:        xz
 %ifarch %{x8664} %{ix86}
 BuildRequires: compat-ncurses5
 %endif
+%if %{without unregisterised} && %{without ncg}
+BuildRequires: llvm >= 9
+%endif
 %else
 BuildRequires: alex >= 2.0
 BuildRequires: ghc >= 8.6
@@ -117,7 +126,14 @@ BuildRequires:     latexmk
 #For generating documentation in PDF: fop or xmltex
 BuildRequires: sphinx-pdg-3
 %endif
-%{?with_unregisterised:Requires:       gcc}
+%if %{with unregisterised}
+Requires:      gcc
+%else
+%if %{without ncg}
+# targets without ncg use llvm backend by default which requires llc/opt
+Requires:      llvm >= 9
+%endif
+%endif
 Provides:      ghc-array = %{gpv_array}
 Provides:      ghc-base = %{gpv_base}
 Provides:      ghc-binary = %{gpv_binary}
@@ -151,6 +167,9 @@ Provides:   ghc-transformers = %{gpv_transformers}
 Provides:      ghc-unix = %{gpv_unix}
 Provides:      ghc-xhtml = %{gpv_xhtml}
 Suggests:      ghc-haskell-platform
+%if %{without unregisterised} && %{with ncg}
+Suggests:      llvm >= 9
+%endif
 Provides:      haddock
 Obsoletes:     haddock
 ExclusiveArch: %{ix86} %{x8664} x32
@@ -298,6 +317,8 @@ cd ..
 %patch5 -p1
 
 %build
+%{__bash} ./utils/llvm-targets/gen-data-layout.sh > llvm-targets
+
 %{__autoconf}
 cd libraries/terminfo
 %{__autoconf}
diff --git a/ghc-pld.patch b/ghc-pld.patch
index 2efaa08..2dbe9dc 100644
--- a/ghc-pld.patch
+++ b/ghc-pld.patch
@@ -18,3 +18,17 @@
              ;;
          *)
              AC_MSG_WARN([Unknown vendor [$]1])
+--- ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh.orig      2021-06-21 
08:54:36.000000000 +0200
++++ ghc-8.10.7/utils/llvm-targets/gen-data-layout.sh   2022-03-17 
13:08:22.374325129 +0100
+@@ -58,9 +58,11 @@
+     "i386-unknown-linux-gnu"
+     "i386-unknown-linux-musl"
+     "i386-unknown-linux"
++    "i686-pld-linux"
+     "x86_64-unknown-linux-gnu"
+     "x86_64-unknown-linux-musl"
+     "x86_64-unknown-linux"
++    "x86_64-pld-linux"
+     # Linux Android
+     "x86_64-unknown-linux-android"
+     "armv7-unknown-linux-androideabi"
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/ghc.git/commitdiff/6d507b632ff1c6737787817db35f795868c0315b

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to