Compare commits

...

2 Commits

Author SHA1 Message Date
David Abdurachmanov 92f668b74e
Set LD_STAGE0, AR_STAGE0; Remove BR for ghc*
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-10-24 22:59:51 +02:00
David Abdurachmanov 86dcdd1d13
1st attempt at bootstrapping unregistered build for RISC-V
Signed-off-by: David Abdurachmanov <david.abdurachmanov@gmail.com>
2018-10-24 11:00:17 +02:00
2 changed files with 62 additions and 13 deletions

26
ghc-8.2.20-riscv.patch Normal file
View File

@ -0,0 +1,26 @@
diff --git a/aclocal.m4 b/aclocal.m4
index d5078de..cf0a0fe 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -216,7 +216,7 @@ AC_DEFUN([FPTOOLS_SET_HASKELL_PLATFORM_VARS],
mipsel)
test -z "[$]2" || eval "[$]2=ArchMipsel"
;;
- hppa|hppa1_1|ia64|m68k|rs6000|s390|s390x|sh4|vax)
+ hppa|hppa1_1|ia64|m68k|riscv32|riscv64|rs6000|s390|s390x|sh4|vax)
test -z "[$]2" || eval "[$]2=ArchUnknown"
;;
*)
@@ -1895,6 +1895,12 @@ case "$1" in
powerpc*)
$2="powerpc"
;;
+ riscv64*)
+ $2="riscv64"
+ ;;
+ riscv|riscv32*)
+ $2="riscv32"
+ ;;
rs6000)
$2="rs6000"
;;

View File

@ -1,12 +1,20 @@
# disable prof, docs, perf build
# NB This SHOULD be disabled 'bcond_with' for all koji production builds
%ifnarch riscv64
%bcond_with quickbuild
%else
%bcond_without quickbuild
%endif
# to handle RCs
%global ghc_release %{version}
# make sure ghc libraries' ABI hashes unchanged
%ifnarch riscv64
%bcond_without abicheck
%else
%bcond_with abicheck
%endif
# skip testsuite (takes time and not really being used)
%bcond_with testsuite
@ -38,7 +46,7 @@ Version: 8.2.2
# - release can only be reset if *all* library versions get bumped simultaneously
# (sometimes after a major release)
# - minor release numbers for a branch should be incremented monotonically
Release: 70%{?dist}
Release: 70.2.riscv64%{?dist}
Summary: Glasgow Haskell Compiler
License: BSD and HaskellReport
@ -74,23 +82,26 @@ Patch26: ghc-Debian-no-missing-haddock-file-warning.patch
Patch27: ghc-Debian-reproducible-tmp-names.patch
Patch28: ghc-Debian-x32-use-native-x86_64-insn.patch
# RISC-V support (already upstreamed and available in newer versions)
Patch40: ghc-8.2.20-riscv.patch
# fedora ghc has been bootstrapped on
# %%{ix86} x86_64 ppc ppc64 armv7hl s390 s390x ppc64le aarch64
# and retired arches: alpha sparcv9 armv5tel
# see also deprecated ghc_arches defined in /etc/rpm/macros.ghc-srpm by redhat-rpm-macros
BuildRequires: ghc-compiler
#BuildRequires: ghc-compiler
# for ABI hash checking
%if %{with abicheck}
BuildRequires: ghc
#BuildRequires: ghc
%endif
BuildRequires: ghc-rpm-macros-extra >= 1.8
BuildRequires: ghc-binary-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-directory-devel
BuildRequires: ghc-pretty-devel
BuildRequires: ghc-process-devel
#BuildRequires: ghc-rpm-macros-extra >= 1.8
#BuildRequires: ghc-binary-devel
#BuildRequires: ghc-bytestring-devel
#BuildRequires: ghc-containers-devel
#BuildRequires: ghc-directory-devel
#BuildRequires: ghc-pretty-devel
#BuildRequires: ghc-process-devel
BuildRequires: gmp-devel
BuildRequires: libffi-devel
# for terminfo
@ -293,6 +304,10 @@ rm -r libffi-tarballs
%patch27 -p1 -b .orig
%patch28 -p1 -b .orig
%ifarch riscv64
%patch40 -p1 -b .riscv64
%endif
%global gen_contents_index gen_contents_index.orig
%if %{with docs}
if [ ! -f "libraries/%{gen_contents_index}" ]; then
@ -334,8 +349,8 @@ EOF
#EXTRA_HC_OPTS=-debug
%build
# for patch12
%ifarch armv7hl
# for patch12 and patch40
%ifarch armv7hl riscv64
autoreconf
%else
# for patch5
@ -347,6 +362,9 @@ export CFLAGS="${CFLAGS:-%optflags}"
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
# for ghc >= 8.2
export CC=%{_bindir}/gcc
export CC_STAGE0=%{_bindir}/gcc
export AR_STAGE0=%{_bindir}/ar
export LD_STAGE0=%{_bindir}/ld
# * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
--bindir=%{_bindir} --sbindir=%{_sbindir} --sysconfdir=%{_sysconfdir} \
@ -354,7 +372,9 @@ export CC=%{_bindir}/gcc
--libexecdir=%{_libexecdir} --localstatedir=%{_localstatedir} \
--sharedstatedir=%{_sharedstatedir} --mandir=%{_mandir} \
--docdir=%{_docdir}/ghc \
%ifarch %{ghc_llvm_archs}
--with-llc=%{_bindir}/llc-%{llvm_major} --with-opt=%{_bindir}/opt-%{llvm_major} \
%endif
%if 0%{?fedora} || 0%{?rhel} > 6
--with-system-libffi \
%endif
@ -574,7 +594,7 @@ fi
%{ghclibdir}/bin/ghc-iserv-prof
%endif
%{ghclibdir}/bin/runghc
%ifnarch s390 s390x %{mips}
%ifnarch s390 s390x %{mips} riscv64
%{ghclibdir}/bin/ghc-split
%endif
%{ghclibdir}/bin/hp2ps
@ -640,6 +660,9 @@ fi
%changelog
* Wed Oct 24 2018 David Abdurachmanov <david.abdurachmanov@gmail.com> - 8.2.2-70.2.riscv64
- 1st attempt to bootstrap unregistered build for RISC-V (riscv64)
* Wed Oct 17 2018 Jens Petersen <petersen@redhat.com> - 8.2.2-70
- backport quickbuild config from 8.4 module and extend to perf_build
- disable -Wall on s390x like in 8.4 module to silence warning flood