backport build configs from 8.4 module; extend quickbuild to perf_build

- backport quickbuild config from 8.4 module
- disable -Wall on s390x like in 8.4 module to silence warning flood
  and simplify setting of CFLAGS
- setup build.mk in setup section, taken from copr and module
- enable buildpath-abi-stability.patch (from Debian)
This commit is contained in:
Jens Petersen 2018-10-17 12:07:29 +09:00
parent 20edd0d34e
commit 65eec31b69
2 changed files with 46 additions and 31 deletions

View File

@ -1,10 +1,8 @@
Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424 Forwarded to https://ghc.haskell.org/trac/ghc/ticket/10424
Index: ghc-7.10.1/compiler/iface/MkIface.hs --- a/compiler/iface/MkIface.hs
=================================================================== +++ b/compiler/iface/MkIface.hs
--- ghc-7.10.1.orig/compiler/iface/MkIface.hs 2015-05-17 20:34:02.808643844 +0200 @@ -681,7 +681,7 @@ addFingerprints hsc_env mb_old_fingerpri
+++ ghc-7.10.1/compiler/iface/MkIface.hs 2015-05-17 20:34:02.804643799 +0200
@@ -611,7 +611,7 @@
iface_hash <- computeFingerprint putNameLiterally iface_hash <- computeFingerprint putNameLiterally
(mod_hash, (mod_hash,
ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache ann_fn (mkVarOcc "module"), -- See mkIfaceAnnCache
@ -13,7 +11,7 @@ Index: ghc-7.10.1/compiler/iface/MkIface.hs
sorted_deps, sorted_deps,
mi_hpc iface0) mi_hpc iface0)
@@ -644,6 +644,9 @@ @@ -714,6 +714,9 @@ addFingerprints hsc_env mb_old_fingerpri
(non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0) (non_orph_fis, orph_fis) = mkOrphMap ifFamInstOrph (mi_fam_insts iface0)
fix_fn = mi_fix_fn iface0 fix_fn = mi_fix_fn iface0
ann_fn = mkIfaceAnnCache (mi_anns iface0) ann_fn = mkIfaceAnnCache (mi_anns iface0)
@ -21,5 +19,5 @@ Index: ghc-7.10.1/compiler/iface/MkIface.hs
+ usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ] + usages = [ case u of UsageFile _ fp -> UsageFile "" fp; _ -> u | u <- mi_usages iface0 ]
+ +
getOrphanHashes :: HscEnv -> [Module] -> IO [Fingerprint] -- | Retrieve the orphan hashes 'mi_orphan_hash' for a list of modules
getOrphanHashes hsc_env mods = do -- (in particular, the orphan modules which are transitively imported by the

View File

@ -1,5 +1,6 @@
# perf production build (disable for quick build) # disable prof, docs, perf build
%bcond_without perf_build # NB This SHOULD be disabled 'bcond_with' for all koji production builds
%bcond_with quickbuild
# to handle RCs # to handle RCs
%global ghc_release %{version} %global ghc_release %{version}
@ -9,12 +10,22 @@
# skip testsuite (takes time and not really being used) # skip testsuite (takes time and not really being used)
%bcond_with testsuite %bcond_with testsuite
# build profiling libraries # build profiling libraries
%bcond_without prof
# build docs (haddock and manuals) # build docs (haddock and manuals)
# combined since disabling haddock seems to cause no manuals built # - combined since disabling haddock seems to cause no manuals built
# <https://ghc.haskell.org/trac/ghc/ticket/15190> # - <https://ghc.haskell.org/trac/ghc/ticket/15190>
# perf production build (disable for quick build)
%if %{with quickbuild}
%bcond_with prof
%bcond_with docs
%bcond_with perf_build
%else
%bcond_without prof
%bcond_without docs %bcond_without docs
%bcond_without perf_build
%endif
# 8.2 needs llvm-3.9 # 8.2 needs llvm-3.9
%global llvm_major 3.9 %global llvm_major 3.9
@ -53,9 +64,12 @@ Patch5: ghc-configure-fix-sphinx-version-check.patch
Patch12: ghc-armv7-VFPv3D16--NEON.patch Patch12: ghc-armv7-VFPv3D16--NEON.patch
# for s390x
# https://ghc.haskell.org/trac/ghc/ticket/15689
Patch15: ghc-warnings.mk-CC-Wall.patch
# Debian patches: # Debian patches:
# doesn't apply to 8.2 Patch24: ghc-Debian-buildpath-abi-stability.patch
#Patch24: ghc-Debian-buildpath-abi-stability.patch
Patch26: ghc-Debian-no-missing-haddock-file-warning.patch Patch26: ghc-Debian-no-missing-haddock-file-warning.patch
Patch27: ghc-Debian-reproducible-tmp-names.patch Patch27: ghc-Debian-reproducible-tmp-names.patch
Patch28: ghc-Debian-x32-use-native-x86_64-insn.patch Patch28: ghc-Debian-x32-use-native-x86_64-insn.patch
@ -270,7 +284,11 @@ rm -r libffi-tarballs
%patch12 -p1 -b .orig %patch12 -p1 -b .orig
%endif %endif
#%%patch24 -p1 -b .orig %ifarch s390x
%patch15 -p1 -b .orig
%endif
%patch24 -p1 -b .orig
%patch26 -p1 -b .orig %patch26 -p1 -b .orig
%patch27 -p1 -b .orig %patch27 -p1 -b .orig
%patch28 -p1 -b .orig %patch28 -p1 -b .orig
@ -283,8 +301,6 @@ if [ ! -f "libraries/%{gen_contents_index}" ]; then
fi fi
%endif %endif
%build
# http://hackage.haskell.org/trac/ghc/wiki/Platforms # http://hackage.haskell.org/trac/ghc/wiki/Platforms
# cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc # cf https://github.com/gentoo-haskell/gentoo-haskell/tree/master/dev-lang/ghc
cat > mk/build.mk << EOF cat > mk/build.mk << EOF
@ -318,6 +334,7 @@ EOF
## (http://ghc.haskell.org/trac/ghc/wiki/Debugging/RuntimeSystem) ## (http://ghc.haskell.org/trac/ghc/wiki/Debugging/RuntimeSystem)
#EXTRA_HC_OPTS=-debug #EXTRA_HC_OPTS=-debug
%build
# for patch12 # for patch12
%ifarch armv7hl %ifarch armv7hl
autoreconf autoreconf
@ -326,19 +343,10 @@ autoreconf
autoconf autoconf
%endif %endif
%if 0%{?fedora} > 28 # replace later with ghc_set_gcc_flags
%ghc_set_cflags export CFLAGS="${CFLAGS:-%optflags}"
%else
# -Wunused-label is extremely noisy
%ifarch aarch64 s390x
CFLAGS="${CFLAGS:-$(echo %optflags | sed -e 's/-Wall //' -e 's/-Werror=format-security //')}"
%else
CFLAGS="${CFLAGS:-%optflags}"
%endif
export CFLAGS
%endif
export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}" export LDFLAGS="${LDFLAGS:-%{?__global_ldflags}}"
# for ghc-8.2 # for ghc >= 8.2
export CC=%{_bindir}/gcc export CC=%{_bindir}/gcc
# * %%configure induces cross-build due to different target/host/build platform names # * %%configure induces cross-build due to different target/host/build platform names
./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \ ./configure --prefix=%{_prefix} --exec-prefix=%{_exec_prefix} \
@ -624,14 +632,23 @@ fi
%files manual %files manual
## needs pandoc ## needs pandoc
#%%{ghc_html_dir}/Cabal #%%{ghc_html_dir}/Cabal
%if %{with docs}
%{ghc_html_dir}/haddock %{ghc_html_dir}/haddock
%endif
%{ghc_html_dir}/index.html %{ghc_html_dir}/index.html
%{ghc_html_dir}/users_guide %{ghc_html_dir}/users_guide
%endif %endif
%changelog %changelog
* Tue Oct 16 2018 Peter Robinson <pbrobinson@fedoraproject.org> 8.2.2-70 * 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
and simplify setting of CFLAGS
- enable buildpath-abi-stability.patch (from Debian)
- setup build.mk in setup section, taken from copr and module
* Tue Oct 16 2018 Peter Robinson <pbrobinson@fedoraproject.org>
- Update alternatives dependencies - Update alternatives dependencies
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.2.2-69 * Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 8.2.2-69