[Pkg-ganeti-devel] [ganeti] 08/10: Backport GHC 7.8 support from upstream's master
Apollon Oikonomopoulos
apoikos at moszumanska.debian.org
Thu Apr 30 08:23:24 UTC 2015
This is an automated email from the git hooks/post-receive script.
apoikos pushed a commit to branch master
in repository ganeti.
commit c78a0c06b9cf065a2025f75099689fe00352f76c
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date: Wed Apr 29 19:26:59 2015 +0300
Backport GHC 7.8 support from upstream's master
Apply the changes introduced by the following upstream commits:
b78a2c3 Makefile.am: Fix wrong -dep-suffix for GHC 7.8
083776b Fix compiler invocation for GHC >= 7.8
9664aff Makefile.am: Don't use dots in -osuf
1ad14f3 Makefile.am: Don't use -dynamic-too for .hpc_o files
---
debian/patches/ghc7.8.patch | 138 ++++++++++++++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 139 insertions(+)
diff --git a/debian/patches/ghc7.8.patch b/debian/patches/ghc7.8.patch
new file mode 100644
index 0000000..010b011
--- /dev/null
+++ b/debian/patches/ghc7.8.patch
@@ -0,0 +1,138 @@
+Author: Apollon Oikonomopoulos <apoikos at debian.org>
+Description: GHC 7.8 support
+ Cherry-pick the following commits from upstream's master branch:
+ .
+ b78a2c3 Makefile.am: Fix wrong -dep-suffix for GHC 7.8
+ 083776b Fix compiler invocation for GHC >= 7.8
+ 9664aff Makefile.am: Don't use dots in -osuf
+ 1ad14f3 Makefile.am: Don't use -dynamic-too for .hpc_o files
+
+Forwarded: not-needed
+Last-Update: 2015-04-30
+diff --git a/Makefile.am b/Makefile.am
+index 645577e..ac1dddf 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -728,6 +728,28 @@ endif
+ HTEST_SUFFIX = hpc
+ HPROF_SUFFIX = prof
+
++DEP_SUFFIXES =
++if GHC_LE_76
++DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX) -dep-suffix $(HTEST_SUFFIX)
++else
++# GHC >= 7.8 stopped putting underscores into -dep-suffix by itself
++# (https://ghc.haskell.org/trac/ghc/ticket/9749) so we have to put them.
++# It also needs -dep-suffix "" for the .o file.
++DEP_SUFFIXES += -dep-suffix $(HPROF_SUFFIX)_ -dep-suffix $(HTEST_SUFFIX)_ \
++ -dep-suffix ""
++endif
++
++# GHC > 7.6 needs -dynamic-too when using Template Haskell since its
++# ghci is switched to loading dynamic libraries by default.
++# It must only be used in non-profiling GHC invocations.
++# We also don't use it in compilations that use HTEST_SUFFIX (which are
++# compiled with -fhpc) because HPC coverage doesn't interact well with
++# GHCI shared lib loading (https://ghc.haskell.org/trac/ghc/ticket/9762).
++HFLAGS_DYNAMIC =
++if !GHC_LE_76
++HFLAGS_DYNAMIC += -dynamic-too
++endif
++
+ if HPROFILE
+ HPROFFLAGS = -prof -fprof-auto-top -osuf $(HPROF_SUFFIX)_o \
+ -hisuf $(HPROF_SUFFIX)_hi -rtsopts
+@@ -740,8 +762,8 @@ HFLAGS += -DTEST
+ endif
+
+ HTEST_FLAGS = $(HFLAGS) -fhpc -itest/hs \
+- -osuf .$(HTEST_SUFFIX)_o \
+- -hisuf .$(HTEST_SUFFIX)_hi
++ -osuf $(HTEST_SUFFIX)_o \
++ -hisuf $(HTEST_SUFFIX)_hi
+
+ # extra flags that can be overriden on the command line (e.g. -Wwarn, etc.)
+ HEXTRA =
+@@ -1196,8 +1218,8 @@ HS_MAKEFILE_GHC_SRCS += $(HS_TEST_PROGS:%=%.hs)
+ endif
+ Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile hs-pkg-versions \
+ | $(built_base_sources) $(HS_BUILT_SRCS)
+- $(GHC) -M -dep-makefile $@ -dep-suffix $(HPROF_SUFFIX) \
+- -dep-suffix $(HTEST_SUFFIX) $(HFLAGS) -itest/hs \
++ $(GHC) -M -dep-makefile $@ $(DEP_SUFFIXES) $(HFLAGS) $(HFLAGS_DYNAMIC) \
++ -itest/hs \
+ $(shell cat hs-pkg-versions) \
+ $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(HS_MAKEFILE_GHC_SRCS)
+ # Since ghc -M does not generate dependency line for object files, dependencies
+@@ -1214,9 +1236,20 @@ Makefile.ghc: $(HS_MAKEFILE_GHC_SRCS) Makefile hs-pkg-versions \
+
+ @include_makefile_ghc@
+
+-%.o: hs-pkg-versions
++# Like the %.o rule, but allows access to the test/hs directory.
++# This uses HFLAGS instead of HTEST_FLAGS because it's only for generating
++# object files (.o for GHC <= 7.6, .o/.so for newer GHCs) that are loaded
++# in GHCI when evaluating TH. The actual test-with-coverage .hpc_o files
++# are created in the `%.$(HTEST_SUFFIX)_o` rule.
++test/hs/%.o:
++ @echo '[GHC|test]: $@ <- test/hs/$^'
++ @$(GHC) -c $(HFLAGS) -itest/hs $(HFLAGS_DYNAMIC) \
++ $(shell cat hs-pkg-versions) \
++ $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
++
++%.o:
+ @echo '[GHC]: $@ <- $^'
+- @$(GHC) -c $(HFLAGS) \
++ @$(GHC) -c $(HFLAGS) $(HFLAGS_DYNAMIC) \
+ $(shell cat hs-pkg-versions) \
+ $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) $(@:%.o=%.hs)
+
+@@ -1233,7 +1266,11 @@ if HPROFILE
+ $(@:%.$(HPROF_SUFFIX)_o=%.hs)
+ endif
+
+-%.$(HTEST_SUFFIX)_o: hs-pkg-versions
++# We depend on the non-test .o file here because we need the corresponding .so
++# file for GHC > 7.6 ghci dynamic loading for TH, and creating the .o file
++# will create the .so file since we use -dynamic-too (using the `test/hs/%.o`
++# rule).
++%.$(HTEST_SUFFIX)_o: hs-pkg-versions %.o
+ @echo '[GHC|test]: $@ <- $^'
+ @$(GHC) -c $(HTEST_FLAGS) \
+ $(shell cat hs-pkg-versions) \
+@@ -1245,14 +1282,16 @@ endif
+
+ if HPROFILE
+ $(HS_SRC_PROGS): %: %.$(HPROF_SUFFIX)_o | stamp-directories
++ @echo '[GHC-link]: $@'
++ $(GHC) $(HFLAGS) $(HPROFFLAGS) \
++ $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
+ else
+-$(HS_SRC_PROGS): %: %.o hs-pkg-versions | stamp-directories
+-endif
++$(HS_SRC_PROGS): %: %.o | stamp-directories
+ @echo '[GHC-link]: $@'
+- $(GHC) $(HFLAGS) \
++ $(GHC) $(HFLAGS) $(HFLAGS_DYNAMIC) \
+ $(shell cat hs-pkg-versions) \
+- $(HPROFFLAGS) \
+ $(HS_PARALLEL3) $(HS_REGEX_PCRE) $(HEXTRA_COMBINED) --make $(@:%=%.hs)
++endif
+ @rm -f $(notdir $@).tix
+ @touch "$@"
+
+diff --git a/configure.ac b/configure.ac
+index 46a7096..422a5ff 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -619,6 +619,10 @@ if test -z "$GHC"; then
+ AC_MSG_FAILURE([ghc not found, compilation will not possible])
+ fi
+
++# Note: Character classes ([...]) need to be double quoted due to autoconf
++# using m4
++AM_CONDITIONAL([GHC_LE_76], [$GHC --numeric-version | grep -q '^7\.[[0-6]]\.'])
++
+ AC_MSG_CHECKING([checking for extra GHC flags])
+ GHC_BYVERSION_FLAGS=
+ # check for GHC supported flags that vary accross versions
diff --git a/debian/patches/series b/debian/patches/series
index 71e520b..81f8aae 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ fix-startup-with-old-config.patch
cfgupgrade12-remove-old-ssconf.patch
0003-Disable-local-checks-during-build.patch
do-not-backup-export-dir.patch
+ghc7.8.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git
More information about the Pkg-ganeti-devel
mailing list